Thu, 13 Jan 2011 07:28:47 -0800
Merge
src/cpu/sparc/vm/assembler_sparc.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Wed Jan 12 18:33:25 2011 -0800 1.2 +++ b/.hgtags Thu Jan 13 07:28:47 2011 -0800 1.3 @@ -138,3 +138,5 @@ 1.4 5484e7c53fa7da5e869902437ee08a9ae10c1c69 hs20-b03 1.5 9669f9b284108a9ee0a0ccbe215c37a130c9dcf5 jdk7-b123 1.6 9669f9b284108a9ee0a0ccbe215c37a130c9dcf5 hs20-b04 1.7 +0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 jdk7-b124 1.8 +0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 hs20-b05
2.1 --- a/agent/src/os/linux/libproc_impl.c Wed Jan 12 18:33:25 2011 -0800 2.2 +++ b/agent/src/os/linux/libproc_impl.c Thu Jan 13 07:28:47 2011 -0800 2.3 @@ -1,5 +1,5 @@ 2.4 /* 2.5 - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 2.6 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 2.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.8 * 2.9 * This code is free software; you can redistribute it and/or modify it
3.1 --- a/agent/src/os/linux/ps_core.c Wed Jan 12 18:33:25 2011 -0800 3.2 +++ b/agent/src/os/linux/ps_core.c Thu Jan 13 07:28:47 2011 -0800 3.3 @@ -1,5 +1,5 @@ 3.4 /* 3.5 - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. 3.6 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.8 * 3.9 * This code is free software; you can redistribute it and/or modify it
4.1 --- a/agent/src/os/linux/ps_proc.c Wed Jan 12 18:33:25 2011 -0800 4.2 +++ b/agent/src/os/linux/ps_proc.c Thu Jan 13 07:28:47 2011 -0800 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 4.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 * 4.9 * This code is free software; you can redistribute it and/or modify it
5.1 --- a/agent/src/os/linux/symtab.c Wed Jan 12 18:33:25 2011 -0800 5.2 +++ b/agent/src/os/linux/symtab.c Thu Jan 13 07:28:47 2011 -0800 5.3 @@ -1,5 +1,5 @@ 5.4 /* 5.5 - * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. 5.6 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 5.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.8 * 5.9 * This code is free software; you can redistribute it and/or modify it
6.1 --- a/agent/src/os/linux/symtab.h Wed Jan 12 18:33:25 2011 -0800 6.2 +++ b/agent/src/os/linux/symtab.h Thu Jan 13 07:28:47 2011 -0800 6.3 @@ -1,5 +1,5 @@ 6.4 /* 6.5 - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 6.6 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 6.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.8 * 6.9 * This code is free software; you can redistribute it and/or modify it
7.1 --- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java Wed Jan 12 18:33:25 2011 -0800 7.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java Thu Jan 13 07:28:47 2011 -0800 7.3 @@ -1,5 +1,5 @@ 7.4 /* 7.5 - * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved. 7.6 + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 7.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.8 * 7.9 * This code is free software; you can redistribute it and/or modify it
8.1 --- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java Wed Jan 12 18:33:25 2011 -0800 8.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java Thu Jan 13 07:28:47 2011 -0800 8.3 @@ -1,5 +1,5 @@ 8.4 /* 8.5 - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. 8.6 + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 8.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8.8 * 8.9 * This code is free software; you can redistribute it and/or modify it
9.1 --- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java Wed Jan 12 18:33:25 2011 -0800 9.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java Thu Jan 13 07:28:47 2011 -0800 9.3 @@ -1,5 +1,5 @@ 9.4 /* 9.5 - * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved. 9.6 + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 9.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.8 * 9.9 * This code is free software; you can redistribute it and/or modify it
10.1 --- a/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Wed Jan 12 18:33:25 2011 -0800 10.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java Thu Jan 13 07:28:47 2011 -0800 10.3 @@ -1,5 +1,5 @@ 10.4 /* 10.5 - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. 10.6 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 10.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10.8 * 10.9 * This code is free software; you can redistribute it and/or modify it
11.1 --- a/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java Wed Jan 12 18:33:25 2011 -0800 11.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java Thu Jan 13 07:28:47 2011 -0800 11.3 @@ -1,5 +1,5 @@ 11.4 /* 11.5 - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. 11.6 + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 11.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.8 * 11.9 * This code is free software; you can redistribute it and/or modify it
12.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java Wed Jan 12 18:33:25 2011 -0800 12.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java Thu Jan 13 07:28:47 2011 -0800 12.3 @@ -1,5 +1,5 @@ 12.4 /* 12.5 - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. 12.6 + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 12.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 12.8 * 12.9 * This code is free software; you can redistribute it and/or modify it
13.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java Wed Jan 12 18:33:25 2011 -0800 13.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java Thu Jan 13 07:28:47 2011 -0800 13.3 @@ -1,5 +1,5 @@ 13.4 /* 13.5 - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. 13.6 + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 13.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 13.8 * 13.9 * This code is free software; you can redistribute it and/or modify it
14.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java Wed Jan 12 18:33:25 2011 -0800 14.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java Thu Jan 13 07:28:47 2011 -0800 14.3 @@ -1,5 +1,5 @@ 14.4 /* 14.5 - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. 14.6 + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 14.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 14.8 * 14.9 * This code is free software; you can redistribute it and/or modify it
15.1 --- a/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Wed Jan 12 18:33:25 2011 -0800 15.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Thu Jan 13 07:28:47 2011 -0800 15.3 @@ -1,5 +1,5 @@ 15.4 /* 15.5 - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. 15.6 + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 15.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 15.8 * 15.9 * This code is free software; you can redistribute it and/or modify it
16.1 --- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Wed Jan 12 18:33:25 2011 -0800 16.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Thu Jan 13 07:28:47 2011 -0800 16.3 @@ -1,5 +1,5 @@ 16.4 /* 16.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 16.6 + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 16.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 16.8 * 16.9 * This code is free software; you can redistribute it and/or modify it
17.1 --- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java Wed Jan 12 18:33:25 2011 -0800 17.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java Thu Jan 13 07:28:47 2011 -0800 17.3 @@ -1,5 +1,5 @@ 17.4 /* 17.5 - * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved. 17.6 + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 17.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 17.8 * 17.9 * This code is free software; you can redistribute it and/or modify it
18.1 --- a/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js Wed Jan 12 18:33:25 2011 -0800 18.2 +++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js Thu Jan 13 07:28:47 2011 -0800 18.3 @@ -1,5 +1,5 @@ 18.4 /* 18.5 - * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. 18.6 + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 18.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.8 * 18.9 * This code is free software; you can redistribute it and/or modify it
19.1 --- a/make/hotspot_distro Wed Jan 12 18:33:25 2011 -0800 19.2 +++ b/make/hotspot_distro Thu Jan 13 07:28:47 2011 -0800 19.3 @@ -1,5 +1,5 @@ 19.4 # 19.5 -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. 19.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 19.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 19.8 # 19.9 # This code is free software; you can redistribute it and/or modify it
20.1 --- a/make/hotspot_version Wed Jan 12 18:33:25 2011 -0800 20.2 +++ b/make/hotspot_version Thu Jan 13 07:28:47 2011 -0800 20.3 @@ -1,5 +1,5 @@ 20.4 # 20.5 -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. 20.6 +# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. 20.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 20.8 # 20.9 # This code is free software; you can redistribute it and/or modify it 20.10 @@ -31,11 +31,11 @@ 20.11 # 20.12 20.13 # Don't put quotes (fail windows build). 20.14 -HOTSPOT_VM_COPYRIGHT=Copyright 2010 20.15 +HOTSPOT_VM_COPYRIGHT=Copyright 2011 20.16 20.17 HS_MAJOR_VER=20 20.18 HS_MINOR_VER=0 20.19 -HS_BUILD_NUMBER=05 20.20 +HS_BUILD_NUMBER=06 20.21 20.22 JDK_MAJOR_VER=1 20.23 JDK_MINOR_VER=7
21.1 --- a/make/jprt.gmk Wed Jan 12 18:33:25 2011 -0800 21.2 +++ b/make/jprt.gmk Thu Jan 13 07:28:47 2011 -0800 21.3 @@ -1,5 +1,5 @@ 21.4 # 21.5 -# Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. 21.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 21.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 21.8 # 21.9 # This code is free software; you can redistribute it and/or modify it
22.1 --- a/make/jprt.properties Wed Jan 12 18:33:25 2011 -0800 22.2 +++ b/make/jprt.properties Thu Jan 13 07:28:47 2011 -0800 22.3 @@ -1,5 +1,5 @@ 22.4 # 22.5 -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. 22.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 22.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 22.8 # 22.9 # This code is free software; you can redistribute it and/or modify it
23.1 --- a/make/linux/makefiles/defs.make Wed Jan 12 18:33:25 2011 -0800 23.2 +++ b/make/linux/makefiles/defs.make Thu Jan 13 07:28:47 2011 -0800 23.3 @@ -1,5 +1,5 @@ 23.4 # 23.5 -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. 23.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 23.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 23.8 # 23.9 # This code is free software; you can redistribute it and/or modify it
24.1 --- a/make/linux/makefiles/jvmti.make Wed Jan 12 18:33:25 2011 -0800 24.2 +++ b/make/linux/makefiles/jvmti.make Thu Jan 13 07:28:47 2011 -0800 24.3 @@ -1,5 +1,5 @@ 24.4 # 24.5 -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. 24.6 +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 24.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 24.8 # 24.9 # This code is free software; you can redistribute it and/or modify it
25.1 --- a/make/linux/makefiles/mapfile-vers-debug Wed Jan 12 18:33:25 2011 -0800 25.2 +++ b/make/linux/makefiles/mapfile-vers-debug Thu Jan 13 07:28:47 2011 -0800 25.3 @@ -3,7 +3,7 @@ 25.4 # 25.5 25.6 # 25.7 -# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. 25.8 +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 25.9 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 25.10 # 25.11 # This code is free software; you can redistribute it and/or modify it
26.1 --- a/make/linux/makefiles/mapfile-vers-product Wed Jan 12 18:33:25 2011 -0800 26.2 +++ b/make/linux/makefiles/mapfile-vers-product Thu Jan 13 07:28:47 2011 -0800 26.3 @@ -3,7 +3,7 @@ 26.4 # 26.5 26.6 # 26.7 -# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. 26.8 +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 26.9 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 26.10 # 26.11 # This code is free software; you can redistribute it and/or modify it
27.1 --- a/make/linux/makefiles/product.make Wed Jan 12 18:33:25 2011 -0800 27.2 +++ b/make/linux/makefiles/product.make Thu Jan 13 07:28:47 2011 -0800 27.3 @@ -1,5 +1,5 @@ 27.4 # 27.5 -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 27.6 +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 27.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 27.8 # 27.9 # This code is free software; you can redistribute it and/or modify it
28.1 --- a/make/linux/makefiles/saproc.make Wed Jan 12 18:33:25 2011 -0800 28.2 +++ b/make/linux/makefiles/saproc.make Thu Jan 13 07:28:47 2011 -0800 28.3 @@ -1,5 +1,5 @@ 28.4 # 28.5 -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. 28.6 +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 28.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 28.8 # 28.9 # This code is free software; you can redistribute it and/or modify it
29.1 --- a/make/linux/makefiles/shark.make Wed Jan 12 18:33:25 2011 -0800 29.2 +++ b/make/linux/makefiles/shark.make Thu Jan 13 07:28:47 2011 -0800 29.3 @@ -1,5 +1,5 @@ 29.4 # 29.5 -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 29.6 +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 29.7 # Copyright 2008, 2010 Red Hat, Inc. 29.8 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 29.9 #
30.1 --- a/make/linux/makefiles/sparcWorks.make Wed Jan 12 18:33:25 2011 -0800 30.2 +++ b/make/linux/makefiles/sparcWorks.make Thu Jan 13 07:28:47 2011 -0800 30.3 @@ -1,5 +1,5 @@ 30.4 # 30.5 -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 30.6 +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 30.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 30.8 # 30.9 # This code is free software; you can redistribute it and/or modify it
31.1 --- a/make/solaris/makefiles/defs.make Wed Jan 12 18:33:25 2011 -0800 31.2 +++ b/make/solaris/makefiles/defs.make Thu Jan 13 07:28:47 2011 -0800 31.3 @@ -1,5 +1,5 @@ 31.4 # 31.5 -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. 31.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 31.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 31.8 # 31.9 # This code is free software; you can redistribute it and/or modify it
32.1 --- a/make/solaris/makefiles/fastdebug.make Wed Jan 12 18:33:25 2011 -0800 32.2 +++ b/make/solaris/makefiles/fastdebug.make Thu Jan 13 07:28:47 2011 -0800 32.3 @@ -1,5 +1,5 @@ 32.4 # 32.5 -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. 32.6 +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 32.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 32.8 # 32.9 # This code is free software; you can redistribute it and/or modify it
33.1 --- a/make/solaris/makefiles/jvmti.make Wed Jan 12 18:33:25 2011 -0800 33.2 +++ b/make/solaris/makefiles/jvmti.make Thu Jan 13 07:28:47 2011 -0800 33.3 @@ -1,5 +1,5 @@ 33.4 # 33.5 -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. 33.6 +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 33.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.8 # 33.9 # This code is free software; you can redistribute it and/or modify it
34.1 --- a/make/solaris/makefiles/optimized.make Wed Jan 12 18:33:25 2011 -0800 34.2 +++ b/make/solaris/makefiles/optimized.make Thu Jan 13 07:28:47 2011 -0800 34.3 @@ -1,5 +1,5 @@ 34.4 # 34.5 -# Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. 34.6 +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 34.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.8 # 34.9 # This code is free software; you can redistribute it and/or modify it
35.1 --- a/make/solaris/makefiles/product.make Wed Jan 12 18:33:25 2011 -0800 35.2 +++ b/make/solaris/makefiles/product.make Thu Jan 13 07:28:47 2011 -0800 35.3 @@ -1,5 +1,5 @@ 35.4 # 35.5 -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 35.6 +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 35.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 35.8 # 35.9 # This code is free software; you can redistribute it and/or modify it
36.1 --- a/make/solaris/makefiles/saproc.make Wed Jan 12 18:33:25 2011 -0800 36.2 +++ b/make/solaris/makefiles/saproc.make Thu Jan 13 07:28:47 2011 -0800 36.3 @@ -1,5 +1,5 @@ 36.4 # 36.5 -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. 36.6 +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 36.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 36.8 # 36.9 # This code is free software; you can redistribute it and/or modify it
37.1 --- a/make/windows/build.bat Wed Jan 12 18:33:25 2011 -0800 37.2 +++ b/make/windows/build.bat Thu Jan 13 07:28:47 2011 -0800 37.3 @@ -1,6 +1,6 @@ 37.4 @echo off 37.5 REM 37.6 -REM Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 37.7 +REM Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 37.8 REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 37.9 REM 37.10 REM This code is free software; you can redistribute it and/or modify it
38.1 --- a/make/windows/get_msc_ver.sh Wed Jan 12 18:33:25 2011 -0800 38.2 +++ b/make/windows/get_msc_ver.sh Thu Jan 13 07:28:47 2011 -0800 38.3 @@ -1,5 +1,5 @@ 38.4 # 38.5 -# Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. 38.6 +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 38.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 38.8 # 38.9 # This code is free software; you can redistribute it and/or modify it
39.1 --- a/make/windows/makefiles/defs.make Wed Jan 12 18:33:25 2011 -0800 39.2 +++ b/make/windows/makefiles/defs.make Thu Jan 13 07:28:47 2011 -0800 39.3 @@ -1,5 +1,5 @@ 39.4 # 39.5 -# Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. 39.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 39.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 39.8 # 39.9 # This code is free software; you can redistribute it and/or modify it
40.1 --- a/make/windows/makefiles/sanity.make Wed Jan 12 18:33:25 2011 -0800 40.2 +++ b/make/windows/makefiles/sanity.make Thu Jan 13 07:28:47 2011 -0800 40.3 @@ -1,5 +1,5 @@ 40.4 # 40.5 -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved. 40.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 40.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 40.8 # 40.9 # This code is free software; you can redistribute it and/or modify it
41.1 --- a/src/cpu/sparc/vm/assembler_sparc.cpp Wed Jan 12 18:33:25 2011 -0800 41.2 +++ b/src/cpu/sparc/vm/assembler_sparc.cpp Thu Jan 13 07:28:47 2011 -0800 41.3 @@ -1,5 +1,5 @@ 41.4 /* 41.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 41.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 41.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41.8 * 41.9 * This code is free software; you can redistribute it and/or modify it 41.10 @@ -4102,11 +4102,15 @@ 41.11 store_klass(t2, top); 41.12 verify_oop(top); 41.13 41.14 + ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); 41.15 + sub(top, t1, t1); // size of tlab's allocated portion 41.16 + incr_allocated_bytes(t1, 0, t2); 41.17 + 41.18 // refill the tlab with an eden allocation 41.19 bind(do_refill); 41.20 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); 41.21 sll_ptr(t1, LogHeapWordSize, t1); 41.22 - // add object_size ?? 41.23 + // allocate new tlab, address returned in top 41.24 eden_allocate(top, t1, 0, t2, t3, slow_case); 41.25 41.26 st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_start_offset())); 41.27 @@ -4134,6 +4138,22 @@ 41.28 delayed()->nop(); 41.29 } 41.30 41.31 +void MacroAssembler::incr_allocated_bytes(Register var_size_in_bytes, 41.32 + int con_size_in_bytes, 41.33 + Register t1) { 41.34 + // Bump total bytes allocated by this thread 41.35 + assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch 41.36 + assert_different_registers(var_size_in_bytes, t1); 41.37 + // v8 support has gone the way of the dodo 41.38 + ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); 41.39 + if (var_size_in_bytes->is_valid()) { 41.40 + add(t1, var_size_in_bytes, t1); 41.41 + } else { 41.42 + add(t1, con_size_in_bytes, t1); 41.43 + } 41.44 + stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); 41.45 +} 41.46 + 41.47 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { 41.48 switch (cond) { 41.49 // Note some conditions are synonyms for others
42.1 --- a/src/cpu/sparc/vm/assembler_sparc.hpp Wed Jan 12 18:33:25 2011 -0800 42.2 +++ b/src/cpu/sparc/vm/assembler_sparc.hpp Thu Jan 13 07:28:47 2011 -0800 42.3 @@ -2399,6 +2399,7 @@ 42.4 Label& slow_case // continuation point if fast allocation fails 42.5 ); 42.6 void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); 42.7 + void incr_allocated_bytes(Register var_size_in_bytes, int con_size_in_bytes, Register t1); 42.8 42.9 // interface method calling 42.10 void lookup_interface_method(Register recv_klass,
43.1 --- a/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Wed Jan 12 18:33:25 2011 -0800 43.2 +++ b/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Thu Jan 13 07:28:47 2011 -0800 43.3 @@ -166,7 +166,7 @@ 43.4 Register obj, // result: pointer to object after successful allocation 43.5 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise 43.6 int con_size_in_bytes, // object size in bytes if known at compile time 43.7 - Register t1, // temp register 43.8 + Register t1, // temp register, must be global register for incr_allocated_bytes 43.9 Register t2, // temp register 43.10 Label& slow_case // continuation point if fast allocation fails 43.11 ) { 43.12 @@ -174,6 +174,7 @@ 43.13 tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); 43.14 } else { 43.15 eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); 43.16 + incr_allocated_bytes(var_size_in_bytes, con_size_in_bytes, t1); 43.17 } 43.18 } 43.19 43.20 @@ -214,7 +215,7 @@ 43.21 void C1_MacroAssembler::allocate_object( 43.22 Register obj, // result: pointer to object after successful allocation 43.23 Register t1, // temp register 43.24 - Register t2, // temp register 43.25 + Register t2, // temp register, must be a global register for try_allocate 43.26 Register t3, // temp register 43.27 int hdr_size, // object header size in words 43.28 int obj_size, // object size in words
44.1 --- a/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp Wed Jan 12 18:33:25 2011 -0800 44.2 +++ b/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp Thu Jan 13 07:28:47 2011 -0800 44.3 @@ -1,5 +1,5 @@ 44.4 /* 44.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 44.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 44.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 44.8 * 44.9 * This code is free software; you can redistribute it and/or modify it
45.1 --- a/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Wed Jan 12 18:33:25 2011 -0800 45.2 +++ b/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp Thu Jan 13 07:28:47 2011 -0800 45.3 @@ -1,5 +1,5 @@ 45.4 /* 45.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 45.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 45.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 45.8 * 45.9 * This code is free software; you can redistribute it and/or modify it 45.10 @@ -448,7 +448,9 @@ 45.11 45.12 // get the instance size 45.13 __ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size); 45.14 + 45.15 __ tlab_allocate(O0_obj, G1_obj_size, 0, G3_t1, slow_path); 45.16 + 45.17 __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); 45.18 __ verify_oop(O0_obj); 45.19 __ mov(O0, I0); 45.20 @@ -459,6 +461,8 @@ 45.21 // get the instance size 45.22 __ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size); 45.23 __ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path); 45.24 + __ incr_allocated_bytes(G1_obj_size, 0, G3_t1); 45.25 + 45.26 __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); 45.27 __ verify_oop(O0_obj); 45.28 __ mov(O0, I0); 45.29 @@ -573,6 +577,7 @@ 45.30 __ and3(G1_arr_size, ~MinObjAlignmentInBytesMask, G1_arr_size); 45.31 45.32 __ eden_allocate(O0_obj, G1_arr_size, 0, G3_t1, O1_t2, slow_path); // preserves G1_arr_size 45.33 + __ incr_allocated_bytes(G1_arr_size, 0, G3_t1); 45.34 45.35 __ initialize_header(O0_obj, G5_klass, G4_length, G3_t1, O1_t2); 45.36 __ ldub(klass_lh, G3_t1, klass_lh_header_size_offset);
46.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp Wed Jan 12 18:33:25 2011 -0800 46.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Jan 13 07:28:47 2011 -0800 46.3 @@ -3393,21 +3393,21 @@ 46.4 __ delayed()->st_ptr(RnewTopValue, G2_thread, in_bytes(JavaThread::tlab_top_offset())); 46.5 46.6 if (allow_shared_alloc) { 46.7 - // Check if tlab should be discarded (refill_waste_limit >= free) 46.8 - __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), RtlabWasteLimitValue); 46.9 - __ sub(RendValue, RoldTopValue, RfreeValue); 46.10 + // Check if tlab should be discarded (refill_waste_limit >= free) 46.11 + __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), RtlabWasteLimitValue); 46.12 + __ sub(RendValue, RoldTopValue, RfreeValue); 46.13 #ifdef _LP64 46.14 - __ srlx(RfreeValue, LogHeapWordSize, RfreeValue); 46.15 + __ srlx(RfreeValue, LogHeapWordSize, RfreeValue); 46.16 #else 46.17 - __ srl(RfreeValue, LogHeapWordSize, RfreeValue); 46.18 + __ srl(RfreeValue, LogHeapWordSize, RfreeValue); 46.19 #endif 46.20 - __ cmp(RtlabWasteLimitValue, RfreeValue); 46.21 - __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, slow_case); // tlab waste is small 46.22 - __ delayed()->nop(); 46.23 - 46.24 - // increment waste limit to prevent getting stuck on this slow path 46.25 - __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); 46.26 - __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); 46.27 + __ cmp(RtlabWasteLimitValue, RfreeValue); 46.28 + __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, slow_case); // tlab waste is small 46.29 + __ delayed()->nop(); 46.30 + 46.31 + // increment waste limit to prevent getting stuck on this slow path 46.32 + __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); 46.33 + __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); 46.34 } else { 46.35 // No allocation in the shared eden. 46.36 __ br(Assembler::always, false, Assembler::pt, slow_case); 46.37 @@ -3445,6 +3445,9 @@ 46.38 __ cmp(RoldTopValue, RnewTopValue); 46.39 __ brx(Assembler::notEqual, false, Assembler::pn, retry); 46.40 __ delayed()->nop(); 46.41 + 46.42 + // bump total bytes allocated by this thread 46.43 + __ incr_allocated_bytes(Roffset, 0, G1_scratch); 46.44 } 46.45 46.46 if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) {
47.1 --- a/src/cpu/x86/vm/assembler_x86.cpp Wed Jan 12 18:33:25 2011 -0800 47.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp Thu Jan 13 07:28:47 2011 -0800 47.3 @@ -1,5 +1,5 @@ 47.4 /* 47.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 47.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 47.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 47.8 * 47.9 * This code is free software; you can redistribute it and/or modify it 47.10 @@ -820,7 +820,20 @@ 47.11 } 47.12 47.13 47.14 -// Now the Assembler instruction (identical for 32/64 bits) 47.15 +// Now the Assembler instructions (identical for 32/64 bits) 47.16 + 47.17 +void Assembler::adcl(Address dst, int32_t imm32) { 47.18 + InstructionMark im(this); 47.19 + prefix(dst); 47.20 + emit_arith_operand(0x81, rdx, dst, imm32); 47.21 +} 47.22 + 47.23 +void Assembler::adcl(Address dst, Register src) { 47.24 + InstructionMark im(this); 47.25 + prefix(dst, src); 47.26 + emit_byte(0x11); 47.27 + emit_operand(src, dst); 47.28 +} 47.29 47.30 void Assembler::adcl(Register dst, int32_t imm32) { 47.31 prefix(dst); 47.32 @@ -2195,9 +2208,7 @@ 47.33 void Assembler::orl(Address dst, int32_t imm32) { 47.34 InstructionMark im(this); 47.35 prefix(dst); 47.36 - emit_byte(0x81); 47.37 - emit_operand(rcx, dst, 4); 47.38 - emit_long(imm32); 47.39 + emit_arith_operand(0x81, rcx, dst, imm32); 47.40 } 47.41 47.42 void Assembler::orl(Register dst, int32_t imm32) { 47.43 @@ -2205,7 +2216,6 @@ 47.44 emit_arith(0x81, 0xC8, dst, imm32); 47.45 } 47.46 47.47 - 47.48 void Assembler::orl(Register dst, Address src) { 47.49 InstructionMark im(this); 47.50 prefix(src, dst); 47.51 @@ -2213,7 +2223,6 @@ 47.52 emit_operand(dst, src); 47.53 } 47.54 47.55 - 47.56 void Assembler::orl(Register dst, Register src) { 47.57 (void) prefix_and_encode(dst->encoding(), src->encoding()); 47.58 emit_arith(0x0B, 0xC0, dst, src); 47.59 @@ -2692,15 +2701,14 @@ 47.60 void Assembler::subl(Address dst, int32_t imm32) { 47.61 InstructionMark im(this); 47.62 prefix(dst); 47.63 - if (is8bit(imm32)) { 47.64 - emit_byte(0x83); 47.65 - emit_operand(rbp, dst, 1); 47.66 - emit_byte(imm32 & 0xFF); 47.67 - } else { 47.68 - emit_byte(0x81); 47.69 - emit_operand(rbp, dst, 4); 47.70 - emit_long(imm32); 47.71 - } 47.72 + emit_arith_operand(0x81, rbp, dst, imm32); 47.73 +} 47.74 + 47.75 +void Assembler::subl(Address dst, Register src) { 47.76 + InstructionMark im(this); 47.77 + prefix(dst, src); 47.78 + emit_byte(0x29); 47.79 + emit_operand(src, dst); 47.80 } 47.81 47.82 void Assembler::subl(Register dst, int32_t imm32) { 47.83 @@ -2708,13 +2716,6 @@ 47.84 emit_arith(0x81, 0xE8, dst, imm32); 47.85 } 47.86 47.87 -void Assembler::subl(Address dst, Register src) { 47.88 - InstructionMark im(this); 47.89 - prefix(dst, src); 47.90 - emit_byte(0x29); 47.91 - emit_operand(src, dst); 47.92 -} 47.93 - 47.94 void Assembler::subl(Register dst, Address src) { 47.95 InstructionMark im(this); 47.96 prefix(src, dst); 47.97 @@ -4333,6 +4334,7 @@ 47.98 emit_byte(0xD3); 47.99 emit_byte(0xF8 | encode); 47.100 } 47.101 + 47.102 void Assembler::sbbq(Address dst, int32_t imm32) { 47.103 InstructionMark im(this); 47.104 prefixq(dst); 47.105 @@ -4392,15 +4394,14 @@ 47.106 void Assembler::subq(Address dst, int32_t imm32) { 47.107 InstructionMark im(this); 47.108 prefixq(dst); 47.109 - if (is8bit(imm32)) { 47.110 - emit_byte(0x83); 47.111 - emit_operand(rbp, dst, 1); 47.112 - emit_byte(imm32 & 0xFF); 47.113 - } else { 47.114 - emit_byte(0x81); 47.115 - emit_operand(rbp, dst, 4); 47.116 - emit_long(imm32); 47.117 - } 47.118 + emit_arith_operand(0x81, rbp, dst, imm32); 47.119 +} 47.120 + 47.121 +void Assembler::subq(Address dst, Register src) { 47.122 + InstructionMark im(this); 47.123 + prefixq(dst, src); 47.124 + emit_byte(0x29); 47.125 + emit_operand(src, dst); 47.126 } 47.127 47.128 void Assembler::subq(Register dst, int32_t imm32) { 47.129 @@ -4408,13 +4409,6 @@ 47.130 emit_arith(0x81, 0xE8, dst, imm32); 47.131 } 47.132 47.133 -void Assembler::subq(Address dst, Register src) { 47.134 - InstructionMark im(this); 47.135 - prefixq(dst, src); 47.136 - emit_byte(0x29); 47.137 - emit_operand(src, dst); 47.138 -} 47.139 - 47.140 void Assembler::subq(Register dst, Address src) { 47.141 InstructionMark im(this); 47.142 prefixq(src, dst); 47.143 @@ -7136,9 +7130,9 @@ 47.144 } 47.145 47.146 // Preserves rbx, and rdx. 47.147 -void MacroAssembler::tlab_refill(Label& retry, 47.148 - Label& try_eden, 47.149 - Label& slow_case) { 47.150 +Register MacroAssembler::tlab_refill(Label& retry, 47.151 + Label& try_eden, 47.152 + Label& slow_case) { 47.153 Register top = rax; 47.154 Register t1 = rcx; 47.155 Register t2 = rsi; 47.156 @@ -7185,7 +7179,7 @@ 47.157 47.158 // if tlab is currently allocated (top or end != null) then 47.159 // fill [top, end + alignment_reserve) with array object 47.160 - testptr (top, top); 47.161 + testptr(top, top); 47.162 jcc(Assembler::zero, do_refill); 47.163 47.164 // set up the mark word 47.165 @@ -7197,16 +7191,20 @@ 47.166 movl(Address(top, arrayOopDesc::length_offset_in_bytes()), t1); 47.167 // set klass to intArrayKlass 47.168 // dubious reloc why not an oop reloc? 47.169 - movptr(t1, ExternalAddress((address) Universe::intArrayKlassObj_addr())); 47.170 + movptr(t1, ExternalAddress((address)Universe::intArrayKlassObj_addr())); 47.171 // store klass last. concurrent gcs assumes klass length is valid if 47.172 // klass field is not null. 47.173 store_klass(top, t1); 47.174 47.175 + movptr(t1, top); 47.176 + subptr(t1, Address(thread_reg, in_bytes(JavaThread::tlab_start_offset()))); 47.177 + incr_allocated_bytes(thread_reg, t1, 0); 47.178 + 47.179 // refill the tlab with an eden allocation 47.180 bind(do_refill); 47.181 movptr(t1, Address(thread_reg, in_bytes(JavaThread::tlab_size_offset()))); 47.182 shlptr(t1, LogHeapWordSize); 47.183 - // add object_size ?? 47.184 + // allocate new tlab, address returned in top 47.185 eden_allocate(top, t1, 0, t2, slow_case); 47.186 47.187 // Check that t1 was preserved in eden_allocate. 47.188 @@ -7234,6 +7232,34 @@ 47.189 movptr(Address(thread_reg, in_bytes(JavaThread::tlab_end_offset())), top); 47.190 verify_tlab(); 47.191 jmp(retry); 47.192 + 47.193 + return thread_reg; // for use by caller 47.194 +} 47.195 + 47.196 +void MacroAssembler::incr_allocated_bytes(Register thread, 47.197 + Register var_size_in_bytes, 47.198 + int con_size_in_bytes, 47.199 + Register t1) { 47.200 +#ifdef _LP64 47.201 + if (var_size_in_bytes->is_valid()) { 47.202 + addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); 47.203 + } else { 47.204 + addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); 47.205 + } 47.206 +#else 47.207 + if (!thread->is_valid()) { 47.208 + assert(t1->is_valid(), "need temp reg"); 47.209 + thread = t1; 47.210 + get_thread(thread); 47.211 + } 47.212 + 47.213 + if (var_size_in_bytes->is_valid()) { 47.214 + addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); 47.215 + } else { 47.216 + addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); 47.217 + } 47.218 + adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0); 47.219 +#endif 47.220 } 47.221 47.222 static const double pi_4 = 0.7853981633974483;
48.1 --- a/src/cpu/x86/vm/assembler_x86.hpp Wed Jan 12 18:33:25 2011 -0800 48.2 +++ b/src/cpu/x86/vm/assembler_x86.hpp Thu Jan 13 07:28:47 2011 -0800 48.3 @@ -1,5 +1,5 @@ 48.4 /* 48.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 48.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 48.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 48.8 * 48.9 * This code is free software; you can redistribute it and/or modify it 48.10 @@ -674,12 +674,14 @@ 48.11 // Utilities 48.12 48.13 #ifdef _LP64 48.14 - static bool is_simm(int64_t x, int nbits) { return -( CONST64(1) << (nbits-1) ) <= x && x < ( CONST64(1) << (nbits-1) ); } 48.15 + static bool is_simm(int64_t x, int nbits) { return -(CONST64(1) << (nbits-1)) <= x && 48.16 + x < (CONST64(1) << (nbits-1)); } 48.17 static bool is_simm32(int64_t x) { return x == (int64_t)(int32_t)x; } 48.18 #else 48.19 - static bool is_simm(int32_t x, int nbits) { return -( 1 << (nbits-1) ) <= x && x < ( 1 << (nbits-1) ); } 48.20 + static bool is_simm(int32_t x, int nbits) { return -(1 << (nbits-1)) <= x && 48.21 + x < (1 << (nbits-1)); } 48.22 static bool is_simm32(int32_t x) { return true; } 48.23 -#endif // LP64 48.24 +#endif // _LP64 48.25 48.26 // Generic instructions 48.27 // Does 32bit or 64bit as needed for the platform. In some sense these 48.28 @@ -705,7 +707,6 @@ 48.29 void push(void* v); 48.30 void pop(void* v); 48.31 48.32 - 48.33 // These do register sized moves/scans 48.34 void rep_mov(); 48.35 void rep_set(); 48.36 @@ -716,6 +717,8 @@ 48.37 48.38 // Vanilla instructions in lexical order 48.39 48.40 + void adcl(Address dst, int32_t imm32); 48.41 + void adcl(Address dst, Register src); 48.42 void adcl(Register dst, int32_t imm32); 48.43 void adcl(Register dst, Address src); 48.44 void adcl(Register dst, Register src); 48.45 @@ -724,7 +727,6 @@ 48.46 void adcq(Register dst, Address src); 48.47 void adcq(Register dst, Register src); 48.48 48.49 - 48.50 void addl(Address dst, int32_t imm32); 48.51 void addl(Address dst, Register src); 48.52 void addl(Register dst, int32_t imm32); 48.53 @@ -737,7 +739,6 @@ 48.54 void addq(Register dst, Address src); 48.55 void addq(Register dst, Register src); 48.56 48.57 - 48.58 void addr_nop_4(); 48.59 void addr_nop_5(); 48.60 void addr_nop_7(); 48.61 @@ -759,7 +760,6 @@ 48.62 void andq(Register dst, Address src); 48.63 void andq(Register dst, Register src); 48.64 48.65 - 48.66 // Bitwise Logical AND of Packed Double-Precision Floating-Point Values 48.67 void andpd(XMMRegister dst, Address src); 48.68 void andpd(XMMRegister dst, XMMRegister src); 48.69 @@ -1151,7 +1151,7 @@ 48.70 #ifdef _LP64 48.71 void movq(Register dst, Register src); 48.72 void movq(Register dst, Address src); 48.73 - void movq(Address dst, Register src); 48.74 + void movq(Address dst, Register src); 48.75 #endif 48.76 48.77 void movq(Address dst, MMXRegister src ); 48.78 @@ -1177,7 +1177,7 @@ 48.79 void movsbq(Register dst, Register src); 48.80 48.81 // Move signed 32bit immediate to 64bit extending sign 48.82 - void movslq(Address dst, int32_t imm64); 48.83 + void movslq(Address dst, int32_t imm64); 48.84 void movslq(Register dst, int32_t imm64); 48.85 48.86 void movslq(Register dst, Address src); 48.87 @@ -1857,7 +1857,10 @@ 48.88 Register t2, // temp register 48.89 Label& slow_case // continuation point if fast allocation fails 48.90 ); 48.91 - void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); 48.92 + Register tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); // returns TLS address 48.93 + void incr_allocated_bytes(Register thread, 48.94 + Register var_size_in_bytes, int con_size_in_bytes, 48.95 + Register t1 = noreg); 48.96 48.97 // interface method calling 48.98 void lookup_interface_method(Register recv_klass, 48.99 @@ -2180,9 +2183,9 @@ 48.100 void divss(XMMRegister dst, Address src) { Assembler::divss(dst, src); } 48.101 void divss(XMMRegister dst, AddressLiteral src) { Assembler::divss(dst, as_Address(src)); } 48.102 48.103 - void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); } 48.104 - void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); } 48.105 - void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); } 48.106 + void movsd(XMMRegister dst, XMMRegister src) { Assembler::movsd(dst, src); } 48.107 + void movsd(Address dst, XMMRegister src) { Assembler::movsd(dst, src); } 48.108 + void movsd(XMMRegister dst, Address src) { Assembler::movsd(dst, src); } 48.109 void movsd(XMMRegister dst, AddressLiteral src) { Assembler::movsd(dst, as_Address(src)); } 48.110 48.111 void mulsd(XMMRegister dst, XMMRegister src) { Assembler::mulsd(dst, src); }
49.1 --- a/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Wed Jan 12 18:33:25 2011 -0800 49.2 +++ b/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Thu Jan 13 07:28:47 2011 -0800 49.3 @@ -1,5 +1,5 @@ 49.4 /* 49.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 49.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 49.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 49.8 * 49.9 * This code is free software; you can redistribute it and/or modify it 49.10 @@ -141,6 +141,7 @@ 49.11 tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); 49.12 } else { 49.13 eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); 49.14 + incr_allocated_bytes(noreg, var_size_in_bytes, con_size_in_bytes, t1); 49.15 } 49.16 } 49.17 49.18 @@ -234,7 +235,7 @@ 49.19 49.20 void C1_MacroAssembler::allocate_object(Register obj, Register t1, Register t2, int header_size, int object_size, Register klass, Label& slow_case) { 49.21 assert(obj == rax, "obj must be in rax, for cmpxchg"); 49.22 - assert(obj != t1 && obj != t2 && t1 != t2, "registers must be different"); // XXX really? 49.23 + assert_different_registers(obj, t1, t2); // XXX really? 49.24 assert(header_size >= 0 && object_size >= header_size, "illegal sizes"); 49.25 49.26 try_allocate(obj, noreg, object_size * BytesPerWord, t1, t2, slow_case);
50.1 --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp Wed Jan 12 18:33:25 2011 -0800 50.2 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp Thu Jan 13 07:28:47 2011 -0800 50.3 @@ -1,5 +1,5 @@ 50.4 /* 50.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 50.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 50.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 50.8 * 50.9 * This code is free software; you can redistribute it and/or modify it 50.10 @@ -977,7 +977,6 @@ 50.11 // verify that that there is really a valid exception in rax, 50.12 __ verify_not_null_oop(exception_oop); 50.13 50.14 - 50.15 oop_maps = new OopMapSet(); 50.16 OopMap* oop_map = generate_oop_map(sasm, 1); 50.17 generate_handle_exception(sasm, oop_maps, oop_map); 50.18 @@ -1037,13 +1036,16 @@ 50.19 // if we got here then the TLAB allocation failed, so try 50.20 // refilling the TLAB or allocating directly from eden. 50.21 Label retry_tlab, try_eden; 50.22 - __ tlab_refill(retry_tlab, try_eden, slow_path); // does not destroy rdx (klass) 50.23 + const Register thread = 50.24 + __ tlab_refill(retry_tlab, try_eden, slow_path); // does not destroy rdx (klass), returns rdi 50.25 50.26 __ bind(retry_tlab); 50.27 50.28 // get the instance size (size is postive so movl is fine for 64bit) 50.29 __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); 50.30 + 50.31 __ tlab_allocate(obj, obj_size, 0, t1, t2, slow_path); 50.32 + 50.33 __ initialize_object(obj, klass, obj_size, 0, t1, t2); 50.34 __ verify_oop(obj); 50.35 __ pop(rbx); 50.36 @@ -1053,7 +1055,10 @@ 50.37 __ bind(try_eden); 50.38 // get the instance size (size is postive so movl is fine for 64bit) 50.39 __ movl(obj_size, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); 50.40 + 50.41 __ eden_allocate(obj, obj_size, 0, t1, slow_path); 50.42 + __ incr_allocated_bytes(thread, obj_size, 0); 50.43 + 50.44 __ initialize_object(obj, klass, obj_size, 0, t1, t2); 50.45 __ verify_oop(obj); 50.46 __ pop(rbx); 50.47 @@ -1143,12 +1148,13 @@ 50.48 // if we got here then the TLAB allocation failed, so try 50.49 // refilling the TLAB or allocating directly from eden. 50.50 Label retry_tlab, try_eden; 50.51 - __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves rbx, & rdx 50.52 + const Register thread = 50.53 + __ tlab_refill(retry_tlab, try_eden, slow_path); // preserves rbx & rdx, returns rdi 50.54 50.55 __ bind(retry_tlab); 50.56 50.57 // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) 50.58 - // since size is postive movl does right thing on 64bit 50.59 + // since size is positive movl does right thing on 64bit 50.60 __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); 50.61 // since size is postive movl does right thing on 64bit 50.62 __ movl(arr_size, length); 50.63 @@ -1175,7 +1181,7 @@ 50.64 50.65 __ bind(try_eden); 50.66 // get the allocation size: round_up(hdr + length << (layout_helper & 0x1F)) 50.67 - // since size is postive movl does right thing on 64bit 50.68 + // since size is positive movl does right thing on 64bit 50.69 __ movl(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes())); 50.70 // since size is postive movl does right thing on 64bit 50.71 __ movl(arr_size, length); 50.72 @@ -1188,6 +1194,7 @@ 50.73 __ andptr(arr_size, ~MinObjAlignmentInBytesMask); 50.74 50.75 __ eden_allocate(obj, arr_size, 0, t1, slow_path); // preserves arr_size 50.76 + __ incr_allocated_bytes(thread, arr_size, 0); 50.77 50.78 __ initialize_header(obj, klass, length, t1, t2); 50.79 __ movb(t1, Address(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes() + (Klass::_lh_header_size_shift / BitsPerByte)));
51.1 --- a/src/cpu/x86/vm/templateTable_x86_32.cpp Wed Jan 12 18:33:25 2011 -0800 51.2 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp Thu Jan 13 07:28:47 2011 -0800 51.3 @@ -3196,10 +3196,12 @@ 51.4 const bool allow_shared_alloc = 51.5 Universe::heap()->supports_inline_contig_alloc() && !CMSIncrementalMode; 51.6 51.7 + const Register thread = rcx; 51.8 + if (UseTLAB || allow_shared_alloc) { 51.9 + __ get_thread(thread); 51.10 + } 51.11 + 51.12 if (UseTLAB) { 51.13 - const Register thread = rcx; 51.14 - 51.15 - __ get_thread(thread); 51.16 __ movptr(rax, Address(thread, in_bytes(JavaThread::tlab_top_offset()))); 51.17 __ lea(rbx, Address(rax, rdx, Address::times_1)); 51.18 __ cmpptr(rbx, Address(thread, in_bytes(JavaThread::tlab_end_offset()))); 51.19 @@ -3240,6 +3242,8 @@ 51.20 51.21 // if someone beat us on the allocation, try again, otherwise continue 51.22 __ jcc(Assembler::notEqual, retry); 51.23 + 51.24 + __ incr_allocated_bytes(thread, rdx, 0); 51.25 } 51.26 51.27 if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) { 51.28 @@ -3249,12 +3253,12 @@ 51.29 __ decrement(rdx, sizeof(oopDesc)); 51.30 __ jcc(Assembler::zero, initialize_header); 51.31 51.32 - // Initialize topmost object field, divide rdx by 8, check if odd and 51.33 - // test if zero. 51.34 + // Initialize topmost object field, divide rdx by 8, check if odd and 51.35 + // test if zero. 51.36 __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code) 51.37 __ shrl(rdx, LogBytesPerLong); // divide by 2*oopSize and set carry flag if odd 51.38 51.39 - // rdx must have been multiple of 8 51.40 + // rdx must have been multiple of 8 51.41 #ifdef ASSERT 51.42 // make sure rdx was multiple of 8 51.43 Label L;
52.1 --- a/src/cpu/x86/vm/templateTable_x86_64.cpp Wed Jan 12 18:33:25 2011 -0800 52.2 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp Thu Jan 13 07:28:47 2011 -0800 52.3 @@ -3254,6 +3254,8 @@ 52.4 52.5 // if someone beat us on the allocation, try again, otherwise continue 52.6 __ jcc(Assembler::notEqual, retry); 52.7 + 52.8 + __ incr_allocated_bytes(r15_thread, rdx, 0); 52.9 } 52.10 52.11 if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) {
53.1 --- a/src/os/solaris/dtrace/hotspot.d Wed Jan 12 18:33:25 2011 -0800 53.2 +++ b/src/os/solaris/dtrace/hotspot.d Thu Jan 13 07:28:47 2011 -0800 53.3 @@ -1,5 +1,5 @@ 53.4 /* 53.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 53.6 + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 53.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 53.8 * 53.9 * This code is free software; you can redistribute it and/or modify it
54.1 --- a/src/os/solaris/vm/os_solaris.cpp Wed Jan 12 18:33:25 2011 -0800 54.2 +++ b/src/os/solaris/vm/os_solaris.cpp Thu Jan 13 07:28:47 2011 -0800 54.3 @@ -1,5 +1,5 @@ 54.4 /* 54.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 54.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 54.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 54.8 * 54.9 * This code is free software; you can redistribute it and/or modify it 54.10 @@ -283,7 +283,7 @@ 54.11 is_error_reported(), 54.12 "sp must be inside of selected thread stack"); 54.13 54.14 - thread->_self_raw_id = raw_id; // mark for quick retrieval 54.15 + thread->set_self_raw_id(raw_id); // mark for quick retrieval 54.16 _get_thread_cache[ index ] = thread; 54.17 } 54.18 return thread; 54.19 @@ -5197,7 +5197,7 @@ 54.20 int o_delete = (oflag & O_DELETE); 54.21 oflag = oflag & ~O_DELETE; 54.22 54.23 - fd = ::open(path, oflag, mode); 54.24 + fd = ::open64(path, oflag, mode); 54.25 if (fd == -1) return -1; 54.26 54.27 //If the open succeeded, the file might still be a directory
55.1 --- a/src/os/solaris/vm/thread_solaris.inline.hpp Wed Jan 12 18:33:25 2011 -0800 55.2 +++ b/src/os/solaris/vm/thread_solaris.inline.hpp Thu Jan 13 07:28:47 2011 -0800 55.3 @@ -1,5 +1,5 @@ 55.4 /* 55.5 - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 55.6 + * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 55.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 55.8 * 55.9 * This code is free software; you can redistribute it and/or modify it 55.10 @@ -53,10 +53,10 @@ 55.11 55.12 uintptr_t raw = pd_raw_thread_id(); 55.13 int ix = pd_cache_index(raw); 55.14 - Thread *Candidate = ThreadLocalStorage::_get_thread_cache[ix]; 55.15 - if (Candidate->_self_raw_id == raw) { 55.16 + Thread* candidate = ThreadLocalStorage::_get_thread_cache[ix]; 55.17 + if (candidate->self_raw_id() == raw) { 55.18 // hit 55.19 - return Candidate; 55.20 + return candidate; 55.21 } else { 55.22 return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix); 55.23 }
56.1 --- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Wed Jan 12 18:33:25 2011 -0800 56.2 +++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Thu Jan 13 07:28:47 2011 -0800 56.3 @@ -585,6 +585,13 @@ 56.4 sigaddset(&newset, sig); 56.5 sigprocmask(SIG_UNBLOCK, &newset, NULL); 56.6 56.7 + // Determine which sort of error to throw. Out of swap may signal 56.8 + // on the thread stack, which could get a mapping error when touched. 56.9 + address addr = (address) info->si_addr; 56.10 + if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) { 56.11 + vm_exit_out_of_memory(0, "Out of swap space to map in thread stack."); 56.12 + } 56.13 + 56.14 VMError err(t, sig, pc, info, ucVoid); 56.15 err.report_and_die(); 56.16
57.1 --- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Wed Jan 12 18:33:25 2011 -0800 57.2 +++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Thu Jan 13 07:28:47 2011 -0800 57.3 @@ -742,6 +742,13 @@ 57.4 sigaddset(&newset, sig); 57.5 sigprocmask(SIG_UNBLOCK, &newset, NULL); 57.6 57.7 + // Determine which sort of error to throw. Out of swap may signal 57.8 + // on the thread stack, which could get a mapping error when touched. 57.9 + address addr = (address) info->si_addr; 57.10 + if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) { 57.11 + vm_exit_out_of_memory(0, "Out of swap space to map in thread stack."); 57.12 + } 57.13 + 57.14 VMError err(t, sig, pc, info, ucVoid); 57.15 err.report_and_die(); 57.16
58.1 --- a/src/os_cpu/solaris_x86/vm/solaris_x86_32.s Wed Jan 12 18:33:25 2011 -0800 58.2 +++ b/src/os_cpu/solaris_x86/vm/solaris_x86_32.s Thu Jan 13 07:28:47 2011 -0800 58.3 @@ -1,5 +1,5 @@ 58.4 // 58.5 -// Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved. 58.6 +// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 58.7 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 58.8 // 58.9 // This code is free software; you can redistribute it and/or modify it
59.1 --- a/src/os_cpu/solaris_x86/vm/solaris_x86_64.il Wed Jan 12 18:33:25 2011 -0800 59.2 +++ b/src/os_cpu/solaris_x86/vm/solaris_x86_64.il Thu Jan 13 07:28:47 2011 -0800 59.3 @@ -1,5 +1,5 @@ 59.4 // 59.5 -// Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. 59.6 +// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 59.7 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 59.8 // 59.9 // This code is free software; you can redistribute it and/or modify it
60.1 --- a/src/share/vm/c1/c1_Compilation.cpp Wed Jan 12 18:33:25 2011 -0800 60.2 +++ b/src/share/vm/c1/c1_Compilation.cpp Thu Jan 13 07:28:47 2011 -0800 60.3 @@ -245,7 +245,7 @@ 60.4 } 60.5 60.6 60.7 -void Compilation::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) { 60.8 +bool Compilation::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) { 60.9 // Preinitialize the consts section to some large size: 60.10 int locs_buffer_size = 20 * (relocInfo::length_limit + sizeof(relocInfo)); 60.11 char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size); 60.12 @@ -253,15 +253,20 @@ 60.13 locs_buffer_size / sizeof(relocInfo)); 60.14 code->initialize_consts_size(Compilation::desired_max_constant_size()); 60.15 // Call stubs + two deopt handlers (regular and MH) + exception handler 60.16 - code->initialize_stubs_size((call_stub_estimate * LIR_Assembler::call_stub_size) + 60.17 - LIR_Assembler::exception_handler_size + 60.18 - 2 * LIR_Assembler::deopt_handler_size); 60.19 + int stub_size = (call_stub_estimate * LIR_Assembler::call_stub_size) + 60.20 + LIR_Assembler::exception_handler_size + 60.21 + (2 * LIR_Assembler::deopt_handler_size); 60.22 + if (stub_size >= code->insts_capacity()) return false; 60.23 + code->initialize_stubs_size(stub_size); 60.24 + return true; 60.25 } 60.26 60.27 60.28 int Compilation::emit_code_body() { 60.29 // emit code 60.30 - setup_code_buffer(code(), allocator()->num_calls()); 60.31 + if (!setup_code_buffer(code(), allocator()->num_calls())) { 60.32 + BAILOUT_("size requested greater than avail code buffer size", 0); 60.33 + } 60.34 code()->initialize_oop_recorder(env()->oop_recorder()); 60.35 60.36 _masm = new C1_MacroAssembler(code());
61.1 --- a/src/share/vm/c1/c1_Compilation.hpp Wed Jan 12 18:33:25 2011 -0800 61.2 +++ b/src/share/vm/c1/c1_Compilation.hpp Thu Jan 13 07:28:47 2011 -0800 61.3 @@ -192,7 +192,7 @@ 61.4 return desired_max_code_buffer_size() / 10; 61.5 } 61.6 61.7 - static void setup_code_buffer(CodeBuffer* cb, int call_stub_estimate); 61.8 + static bool setup_code_buffer(CodeBuffer* cb, int call_stub_estimate); 61.9 61.10 // timers 61.11 static void print_timers();
62.1 --- a/src/share/vm/gc_interface/collectedHeap.inline.hpp Wed Jan 12 18:33:25 2011 -0800 62.2 +++ b/src/share/vm/gc_interface/collectedHeap.inline.hpp Thu Jan 13 07:28:47 2011 -0800 62.3 @@ -1,5 +1,5 @@ 62.4 /* 62.5 - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 62.6 + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 62.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 62.8 * 62.9 * This code is free software; you can redistribute it and/or modify it 62.10 @@ -153,6 +153,7 @@ 62.11 check_for_non_bad_heap_word_value(result, size)); 62.12 assert(!HAS_PENDING_EXCEPTION, 62.13 "Unexpected exception, will result in uninitialized storage"); 62.14 + THREAD->incr_allocated_bytes(size * HeapWordSize); 62.15 return result; 62.16 } 62.17
63.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.cpp Wed Jan 12 18:33:25 2011 -0800 63.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp Thu Jan 13 07:28:47 2011 -0800 63.3 @@ -1,5 +1,5 @@ 63.4 /* 63.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 63.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 63.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 63.8 * 63.9 * This code is free software; you can redistribute it and/or modify it 63.10 @@ -114,6 +114,11 @@ 63.11 void ThreadLocalAllocBuffer::make_parsable(bool retire) { 63.12 if (end() != NULL) { 63.13 invariants(); 63.14 + 63.15 + if (retire) { 63.16 + myThread()->incr_allocated_bytes(used_bytes()); 63.17 + } 63.18 + 63.19 CollectedHeap::fill_with_object(top(), hard_end(), retire); 63.20 63.21 if (retire || ZeroTLAB) { // "Reset" the TLAB
64.1 --- a/src/share/vm/memory/threadLocalAllocBuffer.hpp Wed Jan 12 18:33:25 2011 -0800 64.2 +++ b/src/share/vm/memory/threadLocalAllocBuffer.hpp Thu Jan 13 07:28:47 2011 -0800 64.3 @@ -1,5 +1,5 @@ 64.4 /* 64.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 64.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 64.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 64.8 * 64.9 * This code is free software; you can redistribute it and/or modify it 64.10 @@ -112,6 +112,8 @@ 64.11 HeapWord* top() const { return _top; } 64.12 HeapWord* pf_top() const { return _pf_top; } 64.13 size_t desired_size() const { return _desired_size; } 64.14 + size_t used() const { return pointer_delta(top(), start()); } 64.15 + size_t used_bytes() const { return pointer_delta(top(), start(), 1); } 64.16 size_t free() const { return pointer_delta(end(), top()); } 64.17 // Don't discard tlab if remaining space is larger than this. 64.18 size_t refill_waste_limit() const { return _refill_waste_limit; }
65.1 --- a/src/share/vm/opto/macro.cpp Wed Jan 12 18:33:25 2011 -0800 65.2 +++ b/src/share/vm/opto/macro.cpp Thu Jan 13 07:28:47 2011 -0800 65.3 @@ -1,5 +1,5 @@ 65.4 /* 65.5 - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 65.6 + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 65.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 65.8 * 65.9 * This code is free software; you can redistribute it and/or modify it 65.10 @@ -1158,7 +1158,7 @@ 65.11 // Note: We set the control input on "eden_end" and "old_eden_top" when using 65.12 // a TLAB to work around a bug where these values were being moved across 65.13 // a safepoint. These are not oops, so they cannot be include in the oop 65.14 - // map, but the can be changed by a GC. The proper way to fix this would 65.15 + // map, but they can be changed by a GC. The proper way to fix this would 65.16 // be to set the raw memory state when generating a SafepointNode. However 65.17 // this will require extensive changes to the loop optimization in order to 65.18 // prevent a degradation of the optimization. 65.19 @@ -1167,24 +1167,24 @@ 65.20 65.21 // allocate the Region and Phi nodes for the result 65.22 result_region = new (C, 3) RegionNode(3); 65.23 - result_phi_rawmem = new (C, 3) PhiNode( result_region, Type::MEMORY, TypeRawPtr::BOTTOM ); 65.24 - result_phi_rawoop = new (C, 3) PhiNode( result_region, TypeRawPtr::BOTTOM ); 65.25 - result_phi_i_o = new (C, 3) PhiNode( result_region, Type::ABIO ); // I/O is used for Prefetch 65.26 + result_phi_rawmem = new (C, 3) PhiNode(result_region, Type::MEMORY, TypeRawPtr::BOTTOM); 65.27 + result_phi_rawoop = new (C, 3) PhiNode(result_region, TypeRawPtr::BOTTOM); 65.28 + result_phi_i_o = new (C, 3) PhiNode(result_region, Type::ABIO); // I/O is used for Prefetch 65.29 65.30 // We need a Region for the loop-back contended case. 65.31 enum { fall_in_path = 1, contended_loopback_path = 2 }; 65.32 Node *contended_region; 65.33 Node *contended_phi_rawmem; 65.34 - if( UseTLAB ) { 65.35 + if (UseTLAB) { 65.36 contended_region = toobig_false; 65.37 contended_phi_rawmem = mem; 65.38 } else { 65.39 contended_region = new (C, 3) RegionNode(3); 65.40 - contended_phi_rawmem = new (C, 3) PhiNode( contended_region, Type::MEMORY, TypeRawPtr::BOTTOM); 65.41 + contended_phi_rawmem = new (C, 3) PhiNode(contended_region, Type::MEMORY, TypeRawPtr::BOTTOM); 65.42 // Now handle the passing-too-big test. We fall into the contended 65.43 // loop-back merge point. 65.44 - contended_region ->init_req( fall_in_path, toobig_false ); 65.45 - contended_phi_rawmem->init_req( fall_in_path, mem ); 65.46 + contended_region ->init_req(fall_in_path, toobig_false); 65.47 + contended_phi_rawmem->init_req(fall_in_path, mem); 65.48 transform_later(contended_region); 65.49 transform_later(contended_phi_rawmem); 65.50 } 65.51 @@ -1192,78 +1192,101 @@ 65.52 // Load(-locked) the heap top. 65.53 // See note above concerning the control input when using a TLAB 65.54 Node *old_eden_top = UseTLAB 65.55 - ? new (C, 3) LoadPNode ( ctrl, contended_phi_rawmem, eden_top_adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM ) 65.56 - : new (C, 3) LoadPLockedNode( contended_region, contended_phi_rawmem, eden_top_adr ); 65.57 + ? new (C, 3) LoadPNode (ctrl, contended_phi_rawmem, eden_top_adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM) 65.58 + : new (C, 3) LoadPLockedNode(contended_region, contended_phi_rawmem, eden_top_adr); 65.59 65.60 transform_later(old_eden_top); 65.61 // Add to heap top to get a new heap top 65.62 - Node *new_eden_top = new (C, 4) AddPNode( top(), old_eden_top, size_in_bytes ); 65.63 + Node *new_eden_top = new (C, 4) AddPNode(top(), old_eden_top, size_in_bytes); 65.64 transform_later(new_eden_top); 65.65 // Check for needing a GC; compare against heap end 65.66 - Node *needgc_cmp = new (C, 3) CmpPNode( new_eden_top, eden_end ); 65.67 + Node *needgc_cmp = new (C, 3) CmpPNode(new_eden_top, eden_end); 65.68 transform_later(needgc_cmp); 65.69 - Node *needgc_bol = new (C, 2) BoolNode( needgc_cmp, BoolTest::ge ); 65.70 + Node *needgc_bol = new (C, 2) BoolNode(needgc_cmp, BoolTest::ge); 65.71 transform_later(needgc_bol); 65.72 - IfNode *needgc_iff = new (C, 2) IfNode(contended_region, needgc_bol, PROB_UNLIKELY_MAG(4), COUNT_UNKNOWN ); 65.73 + IfNode *needgc_iff = new (C, 2) IfNode(contended_region, needgc_bol, PROB_UNLIKELY_MAG(4), COUNT_UNKNOWN); 65.74 transform_later(needgc_iff); 65.75 65.76 // Plug the failing-heap-space-need-gc test into the slow-path region 65.77 - Node *needgc_true = new (C, 1) IfTrueNode( needgc_iff ); 65.78 + Node *needgc_true = new (C, 1) IfTrueNode(needgc_iff); 65.79 transform_later(needgc_true); 65.80 - if( initial_slow_test ) { 65.81 - slow_region ->init_req( need_gc_path, needgc_true ); 65.82 + if (initial_slow_test) { 65.83 + slow_region->init_req(need_gc_path, needgc_true); 65.84 // This completes all paths into the slow merge point 65.85 transform_later(slow_region); 65.86 } else { // No initial slow path needed! 65.87 // Just fall from the need-GC path straight into the VM call. 65.88 - slow_region = needgc_true; 65.89 + slow_region = needgc_true; 65.90 } 65.91 // No need for a GC. Setup for the Store-Conditional 65.92 - Node *needgc_false = new (C, 1) IfFalseNode( needgc_iff ); 65.93 + Node *needgc_false = new (C, 1) IfFalseNode(needgc_iff); 65.94 transform_later(needgc_false); 65.95 65.96 // Grab regular I/O before optional prefetch may change it. 65.97 // Slow-path does no I/O so just set it to the original I/O. 65.98 - result_phi_i_o->init_req( slow_result_path, i_o ); 65.99 + result_phi_i_o->init_req(slow_result_path, i_o); 65.100 65.101 i_o = prefetch_allocation(i_o, needgc_false, contended_phi_rawmem, 65.102 old_eden_top, new_eden_top, length); 65.103 65.104 + // Name successful fast-path variables 65.105 + Node* fast_oop = old_eden_top; 65.106 + Node* fast_oop_ctrl; 65.107 + Node* fast_oop_rawmem; 65.108 + 65.109 // Store (-conditional) the modified eden top back down. 65.110 // StorePConditional produces flags for a test PLUS a modified raw 65.111 // memory state. 65.112 - Node *store_eden_top; 65.113 - Node *fast_oop_ctrl; 65.114 - if( UseTLAB ) { 65.115 - store_eden_top = new (C, 4) StorePNode( needgc_false, contended_phi_rawmem, eden_top_adr, TypeRawPtr::BOTTOM, new_eden_top ); 65.116 + if (UseTLAB) { 65.117 + Node* store_eden_top = 65.118 + new (C, 4) StorePNode(needgc_false, contended_phi_rawmem, eden_top_adr, 65.119 + TypeRawPtr::BOTTOM, new_eden_top); 65.120 transform_later(store_eden_top); 65.121 fast_oop_ctrl = needgc_false; // No contention, so this is the fast path 65.122 + fast_oop_rawmem = store_eden_top; 65.123 } else { 65.124 - store_eden_top = new (C, 5) StorePConditionalNode( needgc_false, contended_phi_rawmem, eden_top_adr, new_eden_top, old_eden_top ); 65.125 + Node* store_eden_top = 65.126 + new (C, 5) StorePConditionalNode(needgc_false, contended_phi_rawmem, eden_top_adr, 65.127 + new_eden_top, fast_oop/*old_eden_top*/); 65.128 transform_later(store_eden_top); 65.129 - Node *contention_check = new (C, 2) BoolNode( store_eden_top, BoolTest::ne ); 65.130 + Node *contention_check = new (C, 2) BoolNode(store_eden_top, BoolTest::ne); 65.131 transform_later(contention_check); 65.132 store_eden_top = new (C, 1) SCMemProjNode(store_eden_top); 65.133 transform_later(store_eden_top); 65.134 65.135 // If not using TLABs, check to see if there was contention. 65.136 - IfNode *contention_iff = new (C, 2) IfNode ( needgc_false, contention_check, PROB_MIN, COUNT_UNKNOWN ); 65.137 + IfNode *contention_iff = new (C, 2) IfNode (needgc_false, contention_check, PROB_MIN, COUNT_UNKNOWN); 65.138 transform_later(contention_iff); 65.139 - Node *contention_true = new (C, 1) IfTrueNode( contention_iff ); 65.140 + Node *contention_true = new (C, 1) IfTrueNode(contention_iff); 65.141 transform_later(contention_true); 65.142 // If contention, loopback and try again. 65.143 - contended_region->init_req( contended_loopback_path, contention_true ); 65.144 - contended_phi_rawmem->init_req( contended_loopback_path, store_eden_top ); 65.145 + contended_region->init_req(contended_loopback_path, contention_true); 65.146 + contended_phi_rawmem->init_req(contended_loopback_path, store_eden_top); 65.147 65.148 // Fast-path succeeded with no contention! 65.149 - Node *contention_false = new (C, 1) IfFalseNode( contention_iff ); 65.150 + Node *contention_false = new (C, 1) IfFalseNode(contention_iff); 65.151 transform_later(contention_false); 65.152 fast_oop_ctrl = contention_false; 65.153 + 65.154 + // Bump total allocated bytes for this thread 65.155 + Node* thread = new (C, 1) ThreadLocalNode(); 65.156 + transform_later(thread); 65.157 + Node* alloc_bytes_adr = basic_plus_adr(top()/*not oop*/, thread, 65.158 + in_bytes(JavaThread::allocated_bytes_offset())); 65.159 + Node* alloc_bytes = make_load(fast_oop_ctrl, store_eden_top, alloc_bytes_adr, 65.160 + 0, TypeLong::LONG, T_LONG); 65.161 +#ifdef _LP64 65.162 + Node* alloc_size = size_in_bytes; 65.163 +#else 65.164 + Node* alloc_size = new (C, 2) ConvI2LNode(size_in_bytes); 65.165 + transform_later(alloc_size); 65.166 +#endif 65.167 + Node* new_alloc_bytes = new (C, 3) AddLNode(alloc_bytes, alloc_size); 65.168 + transform_later(new_alloc_bytes); 65.169 + fast_oop_rawmem = make_store(fast_oop_ctrl, store_eden_top, alloc_bytes_adr, 65.170 + 0, new_alloc_bytes, T_LONG); 65.171 } 65.172 65.173 - // Rename successful fast-path variables to make meaning more obvious 65.174 - Node* fast_oop = old_eden_top; 65.175 - Node* fast_oop_rawmem = store_eden_top; 65.176 fast_oop_rawmem = initialize_object(alloc, 65.177 fast_oop_ctrl, fast_oop_rawmem, fast_oop, 65.178 klass_node, length, size_in_bytes); 65.179 @@ -1282,11 +1305,11 @@ 65.180 65.181 call->init_req(TypeFunc::Parms+0, thread); 65.182 call->init_req(TypeFunc::Parms+1, fast_oop); 65.183 - call->init_req( TypeFunc::Control, fast_oop_ctrl ); 65.184 - call->init_req( TypeFunc::I_O , top() ) ; // does no i/o 65.185 - call->init_req( TypeFunc::Memory , fast_oop_rawmem ); 65.186 - call->init_req( TypeFunc::ReturnAdr, alloc->in(TypeFunc::ReturnAdr) ); 65.187 - call->init_req( TypeFunc::FramePtr, alloc->in(TypeFunc::FramePtr) ); 65.188 + call->init_req(TypeFunc::Control, fast_oop_ctrl); 65.189 + call->init_req(TypeFunc::I_O , top()); // does no i/o 65.190 + call->init_req(TypeFunc::Memory , fast_oop_rawmem); 65.191 + call->init_req(TypeFunc::ReturnAdr, alloc->in(TypeFunc::ReturnAdr)); 65.192 + call->init_req(TypeFunc::FramePtr, alloc->in(TypeFunc::FramePtr)); 65.193 transform_later(call); 65.194 fast_oop_ctrl = new (C, 1) ProjNode(call,TypeFunc::Control); 65.195 transform_later(fast_oop_ctrl); 65.196 @@ -1295,10 +1318,10 @@ 65.197 } 65.198 65.199 // Plug in the successful fast-path into the result merge point 65.200 - result_region ->init_req( fast_result_path, fast_oop_ctrl ); 65.201 - result_phi_rawoop->init_req( fast_result_path, fast_oop ); 65.202 - result_phi_i_o ->init_req( fast_result_path, i_o ); 65.203 - result_phi_rawmem->init_req( fast_result_path, fast_oop_rawmem ); 65.204 + result_region ->init_req(fast_result_path, fast_oop_ctrl); 65.205 + result_phi_rawoop->init_req(fast_result_path, fast_oop); 65.206 + result_phi_i_o ->init_req(fast_result_path, i_o); 65.207 + result_phi_rawmem->init_req(fast_result_path, fast_oop_rawmem); 65.208 } else { 65.209 slow_region = ctrl; 65.210 }
66.1 --- a/src/share/vm/prims/jvmti.xml Wed Jan 12 18:33:25 2011 -0800 66.2 +++ b/src/share/vm/prims/jvmti.xml Thu Jan 13 07:28:47 2011 -0800 66.3 @@ -1,7 +1,7 @@ 66.4 <?xml version="1.0" encoding="ISO-8859-1"?> 66.5 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?> 66.6 <!-- 66.7 - Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 66.8 + Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 66.9 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 66.10 66.11 This code is free software; you can redistribute it and/or modify it 66.12 @@ -10697,7 +10697,7 @@ 66.13 <internallink id="mUTF">modified UTF-8</internallink> string. 66.14 </description> 66.15 </param> 66.16 - <param id="value"> 66.17 + <param id="value_ptr"> 66.18 <inbuf> 66.19 <char/> 66.20 <nullok>
67.1 --- a/src/share/vm/prims/jvmtiEnv.cpp Wed Jan 12 18:33:25 2011 -0800 67.2 +++ b/src/share/vm/prims/jvmtiEnv.cpp Thu Jan 13 07:28:47 2011 -0800 67.3 @@ -1,5 +1,5 @@ 67.4 /* 67.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 67.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 67.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 67.8 * 67.9 * This code is free software; you can redistribute it and/or modify it 67.10 @@ -1802,7 +1802,7 @@ 67.11 // depth - pre-checked as non-negative 67.12 // value - pre-checked for NULL 67.13 jvmtiError 67.14 -JvmtiEnv::GetLocalInstance(JavaThread* java_thread, jint depth, jobject* value){ 67.15 +JvmtiEnv::GetLocalInstance(JavaThread* java_thread, jint depth, jobject* value_ptr){ 67.16 JavaThread* current_thread = JavaThread::current(); 67.17 // rm object is created to clean up the javaVFrame created in 67.18 // doit_prologue(), but after doit() is finished with it. 67.19 @@ -1814,7 +1814,7 @@ 67.20 if (err != JVMTI_ERROR_NONE) { 67.21 return err; 67.22 } else { 67.23 - *value = op.value().l; 67.24 + *value_ptr = op.value().l; 67.25 return JVMTI_ERROR_NONE; 67.26 } 67.27 } /* end GetLocalInstance */ 67.28 @@ -3440,12 +3440,12 @@ 67.29 // property - pre-checked for NULL 67.30 // value - NULL is a valid value, must be checked 67.31 jvmtiError 67.32 -JvmtiEnv::SetSystemProperty(const char* property, const char* value) { 67.33 +JvmtiEnv::SetSystemProperty(const char* property, const char* value_ptr) { 67.34 jvmtiError err =JVMTI_ERROR_NOT_AVAILABLE; 67.35 67.36 for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) { 67.37 if (strcmp(property, p->key()) == 0) { 67.38 - if (p->set_value((char *)value)) { 67.39 + if (p->set_value((char *)value_ptr)) { 67.40 err = JVMTI_ERROR_NONE; 67.41 } 67.42 }
68.1 --- a/src/share/vm/runtime/arguments.cpp Wed Jan 12 18:33:25 2011 -0800 68.2 +++ b/src/share/vm/runtime/arguments.cpp Thu Jan 13 07:28:47 2011 -0800 68.3 @@ -2297,14 +2297,15 @@ 68.4 } else if (match_option(option, "-Xoss", &tail)) { 68.5 // HotSpot does not have separate native and Java stacks, ignore silently for compatibility 68.6 // -Xmaxjitcodesize 68.7 - } else if (match_option(option, "-Xmaxjitcodesize", &tail)) { 68.8 + } else if (match_option(option, "-Xmaxjitcodesize", &tail) || 68.9 + match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) { 68.10 julong long_ReservedCodeCacheSize = 0; 68.11 ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 68.12 (size_t)InitialCodeCacheSize); 68.13 if (errcode != arg_in_range) { 68.14 jio_fprintf(defaultStream::error_stream(), 68.15 - "Invalid maximum code cache size: %s\n", 68.16 - option->optionString); 68.17 + "Invalid maximum code cache size: %s. Should be greater than InitialCodeCacheSize=%dK\n", 68.18 + option->optionString, InitialCodeCacheSize/K); 68.19 describe_range_error(errcode); 68.20 return JNI_EINVAL; 68.21 }
69.1 --- a/src/share/vm/runtime/java.cpp Wed Jan 12 18:33:25 2011 -0800 69.2 +++ b/src/share/vm/runtime/java.cpp Thu Jan 13 07:28:47 2011 -0800 69.3 @@ -515,8 +515,8 @@ 69.4 } 69.5 69.6 void vm_exit(int code) { 69.7 - Thread* thread = ThreadLocalStorage::thread_index() == -1 ? NULL 69.8 - : ThreadLocalStorage::get_thread_slow(); 69.9 + Thread* thread = ThreadLocalStorage::is_initialized() ? 69.10 + ThreadLocalStorage::get_thread_slow() : NULL; 69.11 if (thread == NULL) { 69.12 // we have serious problems -- just exit 69.13 vm_direct_exit(code); 69.14 @@ -553,8 +553,9 @@ 69.15 // Calling 'exit_globals()' will disable thread-local-storage and cause all 69.16 // kinds of assertions to trigger in debug mode. 69.17 if (is_init_completed()) { 69.18 - Thread* thread = Thread::current(); 69.19 - if (thread->is_Java_thread()) { 69.20 + Thread* thread = ThreadLocalStorage::is_initialized() ? 69.21 + ThreadLocalStorage::get_thread_slow() : NULL; 69.22 + if (thread != NULL && thread->is_Java_thread()) { 69.23 // We are leaving the VM, set state to native (in case any OS exit 69.24 // handlers call back to the VM) 69.25 JavaThread* jt = (JavaThread*)thread;
70.1 --- a/src/share/vm/runtime/thread.cpp Wed Jan 12 18:33:25 2011 -0800 70.2 +++ b/src/share/vm/runtime/thread.cpp Thu Jan 13 07:28:47 2011 -0800 70.3 @@ -1,5 +1,5 @@ 70.4 /* 70.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 70.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 70.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 70.8 * 70.9 * This code is free software; you can redistribute it and/or modify it 70.10 @@ -177,20 +177,19 @@ 70.11 70.12 70.13 Thread::Thread() { 70.14 - // stack 70.15 - _stack_base = NULL; 70.16 - _stack_size = 0; 70.17 - _self_raw_id = 0; 70.18 - _lgrp_id = -1; 70.19 - _osthread = NULL; 70.20 + // stack and get_thread 70.21 + set_stack_base(NULL); 70.22 + set_stack_size(0); 70.23 + set_self_raw_id(0); 70.24 + set_lgrp_id(-1); 70.25 70.26 // allocated data structures 70.27 + set_osthread(NULL); 70.28 set_resource_area(new ResourceArea()); 70.29 set_handle_area(new HandleArea(NULL)); 70.30 set_active_handles(NULL); 70.31 set_free_handle_block(NULL); 70.32 set_last_handle_mark(NULL); 70.33 - set_osthread(NULL); 70.34 70.35 // This initial value ==> never claimed. 70.36 _oops_do_parity = 0; 70.37 @@ -205,6 +204,7 @@ 70.38 NOT_PRODUCT(_skip_gcalot = false;) 70.39 CHECK_UNHANDLED_OOPS_ONLY(_gc_locked_out_count = 0;) 70.40 _jvmti_env_iteration_count = 0; 70.41 + set_allocated_bytes(0); 70.42 _vm_operation_started_count = 0; 70.43 _vm_operation_completed_count = 0; 70.44 _current_pending_monitor = NULL; 70.45 @@ -3231,7 +3231,7 @@ 70.46 warning("java.lang.ArithmeticException has not been initialized"); 70.47 warning("java.lang.StackOverflowError has not been initialized"); 70.48 } 70.49 - } 70.50 + } 70.51 70.52 // See : bugid 4211085. 70.53 // Background : the static initializer of java.lang.Compiler tries to read
71.1 --- a/src/share/vm/runtime/thread.hpp Wed Jan 12 18:33:25 2011 -0800 71.2 +++ b/src/share/vm/runtime/thread.hpp Thu Jan 13 07:28:47 2011 -0800 71.3 @@ -1,5 +1,5 @@ 71.4 /* 71.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 71.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 71.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 71.8 * 71.9 * This code is free software; you can redistribute it and/or modify it 71.10 @@ -60,7 +60,7 @@ 71.11 class JvmtiGetLoadedClassesClosure; 71.12 class ThreadStatistics; 71.13 class ConcurrentLocksDump; 71.14 -class ParkEvent ; 71.15 +class ParkEvent; 71.16 class Parker; 71.17 71.18 class ciEnv; 71.19 @@ -170,7 +170,7 @@ 71.20 // 71.21 71.22 // suspend/resume lock: used for self-suspend 71.23 - Monitor* _SR_lock; 71.24 + Monitor* _SR_lock; 71.25 71.26 protected: 71.27 enum SuspendFlags { 71.28 @@ -194,7 +194,7 @@ 71.29 public: 71.30 void enter_signal_handler() { _num_nested_signal++; } 71.31 void leave_signal_handler() { _num_nested_signal--; } 71.32 - bool is_inside_signal_handler() const { return _num_nested_signal > 0; } 71.33 + bool is_inside_signal_handler() const { return _num_nested_signal > 0; } 71.34 71.35 private: 71.36 // Debug tracing 71.37 @@ -215,7 +215,7 @@ 71.38 71.39 public: 71.40 void set_last_handle_mark(HandleMark* mark) { _last_handle_mark = mark; } 71.41 - HandleMark* last_handle_mark() const { return _last_handle_mark; } 71.42 + HandleMark* last_handle_mark() const { return _last_handle_mark; } 71.43 private: 71.44 71.45 // debug support for checking if code does allow safepoints or not 71.46 @@ -227,11 +227,11 @@ 71.47 // 71.48 // The two classes No_Safepoint_Verifier and No_Allocation_Verifier are used to set these counters. 71.49 // 71.50 - NOT_PRODUCT(int _allow_safepoint_count;) // If 0, thread allow a safepoint to happen 71.51 - debug_only (int _allow_allocation_count;) // If 0, the thread is allowed to allocate oops. 71.52 + NOT_PRODUCT(int _allow_safepoint_count;) // If 0, thread allow a safepoint to happen 71.53 + debug_only (int _allow_allocation_count;) // If 0, the thread is allowed to allocate oops. 71.54 71.55 // Used by SkipGCALot class. 71.56 - NOT_PRODUCT(bool _skip_gcalot;) // Should we elide gc-a-lot? 71.57 + NOT_PRODUCT(bool _skip_gcalot;) // Should we elide gc-a-lot? 71.58 71.59 // Record when GC is locked out via the GC_locker mechanism 71.60 CHECK_UNHANDLED_OOPS_ONLY(int _gc_locked_out_count;) 71.61 @@ -242,24 +242,26 @@ 71.62 friend class ThreadLocalStorage; 71.63 friend class GC_locker; 71.64 71.65 - ThreadLocalAllocBuffer _tlab; // Thread-local eden 71.66 + ThreadLocalAllocBuffer _tlab; // Thread-local eden 71.67 + jlong _allocated_bytes; // Cumulative number of bytes allocated on 71.68 + // the Java heap 71.69 71.70 - int _vm_operation_started_count; // VM_Operation support 71.71 - int _vm_operation_completed_count; // VM_Operation support 71.72 + int _vm_operation_started_count; // VM_Operation support 71.73 + int _vm_operation_completed_count; // VM_Operation support 71.74 71.75 - ObjectMonitor* _current_pending_monitor; // ObjectMonitor this thread 71.76 - // is waiting to lock 71.77 - bool _current_pending_monitor_is_from_java; // locking is from Java code 71.78 + ObjectMonitor* _current_pending_monitor; // ObjectMonitor this thread 71.79 + // is waiting to lock 71.80 + bool _current_pending_monitor_is_from_java; // locking is from Java code 71.81 71.82 // ObjectMonitor on which this thread called Object.wait() 71.83 ObjectMonitor* _current_waiting_monitor; 71.84 71.85 // Private thread-local objectmonitor list - a simple cache organized as a SLL. 71.86 public: 71.87 - ObjectMonitor * omFreeList ; 71.88 - int omFreeCount ; // length of omFreeList 71.89 - int omFreeProvision ; // reload chunk size 71.90 - ObjectMonitor * omInUseList; // SLL to track monitors in circulation 71.91 + ObjectMonitor* omFreeList; 71.92 + int omFreeCount; // length of omFreeList 71.93 + int omFreeProvision; // reload chunk size 71.94 + ObjectMonitor* omInUseList; // SLL to track monitors in circulation 71.95 int omInUseCount; // length of omInUseList 71.96 71.97 public: 71.98 @@ -280,7 +282,6 @@ 71.99 // Testers 71.100 virtual bool is_VM_thread() const { return false; } 71.101 virtual bool is_Java_thread() const { return false; } 71.102 - // Remove this ifdef when C1 is ported to the compiler interface. 71.103 virtual bool is_Compiler_thread() const { return false; } 71.104 virtual bool is_hidden_from_external_view() const { return false; } 71.105 virtual bool is_jvmti_agent_thread() const { return false; } 71.106 @@ -344,15 +345,15 @@ 71.107 // Support for Unhandled Oop detection 71.108 #ifdef CHECK_UNHANDLED_OOPS 71.109 private: 71.110 - UnhandledOops *_unhandled_oops; 71.111 + UnhandledOops* _unhandled_oops; 71.112 public: 71.113 - UnhandledOops* unhandled_oops() { return _unhandled_oops; } 71.114 + UnhandledOops* unhandled_oops() { return _unhandled_oops; } 71.115 // Mark oop safe for gc. It may be stack allocated but won't move. 71.116 - void allow_unhandled_oop(oop *op) { 71.117 + void allow_unhandled_oop(oop *op) { 71.118 if (CheckUnhandledOops) unhandled_oops()->allow_unhandled_oop(op); 71.119 } 71.120 // Clear oops at safepoint so crashes point to unhandled oop violator 71.121 - void clear_unhandled_oops() { 71.122 + void clear_unhandled_oops() { 71.123 if (CheckUnhandledOops) unhandled_oops()->clear_unhandled_oops(); 71.124 } 71.125 bool is_gc_locked_out() { return _gc_locked_out_count > 0; } 71.126 @@ -392,6 +393,22 @@ 71.127 } 71.128 } 71.129 71.130 + jlong allocated_bytes() { return _allocated_bytes; } 71.131 + void set_allocated_bytes(jlong value) { _allocated_bytes = value; } 71.132 + void incr_allocated_bytes(jlong size) { _allocated_bytes += size; } 71.133 + jlong cooked_allocated_bytes() { 71.134 + jlong allocated_bytes = OrderAccess::load_acquire(&_allocated_bytes); 71.135 + if (UseTLAB) { 71.136 + size_t used_bytes = tlab().used_bytes(); 71.137 + if ((ssize_t)used_bytes > 0) { 71.138 + // More-or-less valid tlab. The load_acquire above should ensure 71.139 + // that the result of the add is <= the instantaneous value 71.140 + return allocated_bytes + used_bytes; 71.141 + } 71.142 + } 71.143 + return allocated_bytes; 71.144 + } 71.145 + 71.146 // VM operation support 71.147 int vm_operation_ticket() { return ++_vm_operation_started_count; } 71.148 int vm_operation_completed_count() { return _vm_operation_completed_count; } 71.149 @@ -489,8 +506,11 @@ 71.150 return (_stack_base >= adr && adr >= (_stack_base - _stack_size)); 71.151 } 71.152 71.153 - int lgrp_id() const { return _lgrp_id; } 71.154 - void set_lgrp_id(int value) { _lgrp_id = value; } 71.155 + uintptr_t self_raw_id() { return _self_raw_id; } 71.156 + void set_self_raw_id(uintptr_t value) { _self_raw_id = value; } 71.157 + 71.158 + int lgrp_id() const { return _lgrp_id; } 71.159 + void set_lgrp_id(int value) { _lgrp_id = value; } 71.160 71.161 // Printing 71.162 void print_on(outputStream* st) const; 71.163 @@ -502,7 +522,7 @@ 71.164 #ifdef ASSERT 71.165 private: 71.166 // Deadlock detection support for Mutex locks. List of locks own by thread. 71.167 - Monitor *_owned_locks; 71.168 + Monitor* _owned_locks; 71.169 // Mutex::set_owner_implementation is the only place where _owned_locks is modified, 71.170 // thus the friendship 71.171 friend class Mutex; 71.172 @@ -511,7 +531,7 @@ 71.173 public: 71.174 void print_owned_locks_on(outputStream* st) const; 71.175 void print_owned_locks() const { print_owned_locks_on(tty); } 71.176 - Monitor * owned_locks() const { return _owned_locks; } 71.177 + Monitor* owned_locks() const { return _owned_locks; } 71.178 bool owns_locks() const { return owned_locks() != NULL; } 71.179 bool owns_locks_but_compiled_lock() const; 71.180 71.181 @@ -538,7 +558,7 @@ 71.182 static ByteSize stack_size_offset() { return byte_offset_of(Thread, _stack_size ); } 71.183 71.184 #define TLAB_FIELD_OFFSET(name) \ 71.185 - static ByteSize tlab_##name##_offset() { return byte_offset_of(Thread, _tlab) + ThreadLocalAllocBuffer::name##_offset(); } 71.186 + static ByteSize tlab_##name##_offset() { return byte_offset_of(Thread, _tlab) + ThreadLocalAllocBuffer::name##_offset(); } 71.187 71.188 TLAB_FIELD_OFFSET(start) 71.189 TLAB_FIELD_OFFSET(end) 71.190 @@ -552,6 +572,8 @@ 71.191 71.192 #undef TLAB_FIELD_OFFSET 71.193 71.194 + static ByteSize allocated_bytes_offset() { return byte_offset_of(Thread, _allocated_bytes ); } 71.195 + 71.196 public: 71.197 volatile intptr_t _Stalled ; 71.198 volatile int _TypeTag ;
72.1 --- a/src/share/vm/services/jmm.h Wed Jan 12 18:33:25 2011 -0800 72.2 +++ b/src/share/vm/services/jmm.h Thu Jan 13 07:28:47 2011 -0800 72.3 @@ -1,5 +1,5 @@ 72.4 /* 72.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 72.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 72.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 72.8 * 72.9 * This code is free software; you can redistribute it and/or modify it 72.10 @@ -60,7 +60,8 @@ 72.11 unsigned int isBootClassPathSupported : 1; 72.12 unsigned int isObjectMonitorUsageSupported : 1; 72.13 unsigned int isSynchronizerUsageSupported : 1; 72.14 - unsigned int : 24; 72.15 + unsigned int isThreadAllocatedMemorySupported : 1; 72.16 + unsigned int : 23; 72.17 } jmmOptionalSupport; 72.18 72.19 typedef enum { 72.20 @@ -105,7 +106,8 @@ 72.21 JMM_VERBOSE_GC = 21, 72.22 JMM_VERBOSE_CLASS = 22, 72.23 JMM_THREAD_CONTENTION_MONITORING = 23, 72.24 - JMM_THREAD_CPU_TIME = 24 72.25 + JMM_THREAD_CPU_TIME = 24, 72.26 + JMM_THREAD_ALLOCATED_MEMORY = 25 72.27 } jmmBoolAttribute; 72.28 72.29 72.30 @@ -213,7 +215,10 @@ 72.31 jobject (JNICALL *GetMemoryPoolUsage) (JNIEnv* env, jobject pool); 72.32 jobject (JNICALL *GetPeakMemoryPoolUsage) (JNIEnv* env, jobject pool); 72.33 72.34 - void* reserved4; 72.35 + void (JNICALL *GetThreadAllocatedMemory) 72.36 + (JNIEnv *env, 72.37 + jlongArray ids, 72.38 + jlongArray sizeArray); 72.39 72.40 jobject (JNICALL *GetMemoryUsage) (JNIEnv* env, jboolean heap); 72.41 72.42 @@ -228,6 +233,8 @@ 72.43 jlong* result); 72.44 72.45 jobjectArray (JNICALL *FindCircularBlockedThreads) (JNIEnv *env); 72.46 + 72.47 + // Not used in JDK 6 or JDK 7 72.48 jlong (JNICALL *GetThreadCpuTime) (JNIEnv *env, jlong thread_id); 72.49 72.50 jobjectArray (JNICALL *GetVMGlobalNames) (JNIEnv *env); 72.51 @@ -262,14 +269,22 @@ 72.52 void (JNICALL *GetLastGCStat) (JNIEnv *env, 72.53 jobject mgr, 72.54 jmmGCStat *gc_stat); 72.55 - jlong (JNICALL *GetThreadCpuTimeWithKind) (JNIEnv *env, 72.56 - jlong thread_id, 72.57 - jboolean user_sys_cpu_time); 72.58 - void* reserved5; 72.59 + 72.60 + jlong (JNICALL *GetThreadCpuTimeWithKind) 72.61 + (JNIEnv *env, 72.62 + jlong thread_id, 72.63 + jboolean user_sys_cpu_time); 72.64 + void (JNICALL *GetThreadCpuTimesWithKind) 72.65 + (JNIEnv *env, 72.66 + jlongArray ids, 72.67 + jlongArray timeArray, 72.68 + jboolean user_sys_cpu_time); 72.69 + 72.70 jint (JNICALL *DumpHeap0) (JNIEnv *env, 72.71 jstring outputfile, 72.72 jboolean live); 72.73 - jobjectArray (JNICALL *FindDeadlocks) (JNIEnv *env, jboolean object_monitors_only); 72.74 + jobjectArray (JNICALL *FindDeadlocks) (JNIEnv *env, 72.75 + jboolean object_monitors_only); 72.76 void (JNICALL *SetVMGlobal) (JNIEnv *env, 72.77 jstring flag_name, 72.78 jvalue new_value);
73.1 --- a/src/share/vm/services/management.cpp Wed Jan 12 18:33:25 2011 -0800 73.2 +++ b/src/share/vm/services/management.cpp Thu Jan 13 07:28:47 2011 -0800 73.3 @@ -1,5 +1,5 @@ 73.4 /* 73.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 73.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 73.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 73.8 * 73.9 * This code is free software; you can redistribute it and/or modify it 73.10 @@ -101,12 +101,14 @@ 73.11 _optional_support.isCurrentThreadCpuTimeSupported = 0; 73.12 _optional_support.isOtherThreadCpuTimeSupported = 0; 73.13 } 73.14 + 73.15 _optional_support.isBootClassPathSupported = 1; 73.16 _optional_support.isObjectMonitorUsageSupported = 1; 73.17 #ifndef SERVICES_KERNEL 73.18 // This depends on the heap inspector 73.19 _optional_support.isSynchronizerUsageSupported = 1; 73.20 #endif // SERVICES_KERNEL 73.21 + _optional_support.isThreadAllocatedMemorySupported = 1; 73.22 } 73.23 73.24 void Management::initialize(TRAPS) { 73.25 @@ -386,11 +388,6 @@ 73.26 73.27 static void validate_thread_id_array(typeArrayHandle ids_ah, TRAPS) { 73.28 int num_threads = ids_ah->length(); 73.29 - // should be non-empty array 73.30 - if (num_threads == 0) { 73.31 - THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 73.32 - "Empty array of thread IDs"); 73.33 - } 73.34 73.35 // Validate input thread IDs 73.36 int i = 0; 73.37 @@ -402,11 +399,9 @@ 73.38 "Invalid thread ID entry"); 73.39 } 73.40 } 73.41 - 73.42 } 73.43 73.44 static void validate_thread_info_array(objArrayHandle infoArray_h, TRAPS) { 73.45 - 73.46 // check if the element of infoArray is of type ThreadInfo class 73.47 klassOop threadinfo_klass = Management::java_lang_management_ThreadInfo_klass(CHECK); 73.48 klassOop element_klass = objArrayKlass::cast(infoArray_h->klass())->element_klass(); 73.49 @@ -414,7 +409,6 @@ 73.50 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 73.51 "infoArray element type is not ThreadInfo class"); 73.52 } 73.53 - 73.54 } 73.55 73.56 73.57 @@ -770,6 +764,45 @@ 73.58 return prev; 73.59 JVM_END 73.60 73.61 +// Gets an array containing the amount of memory allocated on the Java 73.62 +// heap for a set of threads (in bytes). Each element of the array is 73.63 +// the amount of memory allocated for the thread ID specified in the 73.64 +// corresponding entry in the given array of thread IDs; or -1 if the 73.65 +// thread does not exist or has terminated. 73.66 +JVM_ENTRY(void, jmm_GetThreadAllocatedMemory(JNIEnv *env, jlongArray ids, 73.67 + jlongArray sizeArray)) 73.68 + // Check if threads is null 73.69 + if (ids == NULL || sizeArray == NULL) { 73.70 + THROW(vmSymbols::java_lang_NullPointerException()); 73.71 + } 73.72 + 73.73 + ResourceMark rm(THREAD); 73.74 + typeArrayOop ta = typeArrayOop(JNIHandles::resolve_non_null(ids)); 73.75 + typeArrayHandle ids_ah(THREAD, ta); 73.76 + 73.77 + typeArrayOop sa = typeArrayOop(JNIHandles::resolve_non_null(sizeArray)); 73.78 + typeArrayHandle sizeArray_h(THREAD, sa); 73.79 + 73.80 + // validate the thread id array 73.81 + validate_thread_id_array(ids_ah, CHECK); 73.82 + 73.83 + // sizeArray must be of the same length as the given array of thread IDs 73.84 + int num_threads = ids_ah->length(); 73.85 + if (num_threads != sizeArray_h->length()) { 73.86 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 73.87 + "The length of the given long array does not match the length of " 73.88 + "the given array of thread IDs"); 73.89 + } 73.90 + 73.91 + MutexLockerEx ml(Threads_lock); 73.92 + for (int i = 0; i < num_threads; i++) { 73.93 + JavaThread* java_thread = find_java_thread_from_id(ids_ah->long_at(i)); 73.94 + if (java_thread != NULL) { 73.95 + sizeArray_h->long_at_put(i, java_thread->cooked_allocated_bytes()); 73.96 + } 73.97 + } 73.98 +JVM_END 73.99 + 73.100 // Returns a java/lang/management/MemoryUsage object representing 73.101 // the memory usage for the heap or non-heap memory. 73.102 JVM_ENTRY(jobject, jmm_GetMemoryUsage(JNIEnv* env, jboolean heap)) 73.103 @@ -834,6 +867,8 @@ 73.104 return ThreadService::is_thread_monitoring_contention(); 73.105 case JMM_THREAD_CPU_TIME: 73.106 return ThreadService::is_thread_cpu_time_enabled(); 73.107 + case JMM_THREAD_ALLOCATED_MEMORY: 73.108 + return ThreadService::is_thread_allocated_memory_enabled(); 73.109 default: 73.110 assert(0, "Unrecognized attribute"); 73.111 return false; 73.112 @@ -851,6 +886,8 @@ 73.113 return ThreadService::set_thread_monitoring_contention(flag != 0); 73.114 case JMM_THREAD_CPU_TIME: 73.115 return ThreadService::set_thread_cpu_time_enabled(flag != 0); 73.116 + case JMM_THREAD_ALLOCATED_MEMORY: 73.117 + return ThreadService::set_thread_allocated_memory_enabled(flag != 0); 73.118 default: 73.119 assert(0, "Unrecognized attribute"); 73.120 return false; 73.121 @@ -1096,6 +1133,7 @@ 73.122 // maxDepth == 0 requests no stack trace. 73.123 // infoArray - array of ThreadInfo objects 73.124 // 73.125 +// QQQ - Why does this method return a value instead of void? 73.126 JVM_ENTRY(jint, jmm_GetThreadInfo(JNIEnv *env, jlongArray ids, jint maxDepth, jobjectArray infoArray)) 73.127 // Check if threads is null 73.128 if (ids == NULL || infoArray == NULL) { 73.129 @@ -1159,7 +1197,6 @@ 73.130 } 73.131 } else { 73.132 // obtain thread dump with the specific list of threads with stack trace 73.133 - 73.134 do_thread_dump(&dump_result, 73.135 ids_ah, 73.136 num_threads, 73.137 @@ -1252,8 +1289,6 @@ 73.138 continue; 73.139 } 73.140 73.141 - 73.142 - 73.143 ThreadStackTrace* stacktrace = ts->get_stack_trace(); 73.144 assert(stacktrace != NULL, "Must have a stack trace dumped"); 73.145 73.146 @@ -1500,6 +1535,49 @@ 73.147 return -1; 73.148 JVM_END 73.149 73.150 +// Gets an array containing the CPU times consumed by a set of threads 73.151 +// (in nanoseconds). Each element of the array is the CPU time for the 73.152 +// thread ID specified in the corresponding entry in the given array 73.153 +// of thread IDs; or -1 if the thread does not exist or has terminated. 73.154 +// If user_sys_cpu_time = true, the sum of user level and system CPU time 73.155 +// for the given thread is returned; otherwise, only user level CPU time 73.156 +// is returned. 73.157 +JVM_ENTRY(void, jmm_GetThreadCpuTimesWithKind(JNIEnv *env, jlongArray ids, 73.158 + jlongArray timeArray, 73.159 + jboolean user_sys_cpu_time)) 73.160 + // Check if threads is null 73.161 + if (ids == NULL || timeArray == NULL) { 73.162 + THROW(vmSymbols::java_lang_NullPointerException()); 73.163 + } 73.164 + 73.165 + ResourceMark rm(THREAD); 73.166 + typeArrayOop ta = typeArrayOop(JNIHandles::resolve_non_null(ids)); 73.167 + typeArrayHandle ids_ah(THREAD, ta); 73.168 + 73.169 + typeArrayOop tia = typeArrayOop(JNIHandles::resolve_non_null(timeArray)); 73.170 + typeArrayHandle timeArray_h(THREAD, tia); 73.171 + 73.172 + // validate the thread id array 73.173 + validate_thread_id_array(ids_ah, CHECK); 73.174 + 73.175 + // timeArray must be of the same length as the given array of thread IDs 73.176 + int num_threads = ids_ah->length(); 73.177 + if (num_threads != timeArray_h->length()) { 73.178 + THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 73.179 + "The length of the given long array does not match the length of " 73.180 + "the given array of thread IDs"); 73.181 + } 73.182 + 73.183 + MutexLockerEx ml(Threads_lock); 73.184 + for (int i = 0; i < num_threads; i++) { 73.185 + JavaThread* java_thread = find_java_thread_from_id(ids_ah->long_at(i)); 73.186 + if (java_thread != NULL) { 73.187 + timeArray_h->long_at_put(i, os::thread_cpu_time((Thread*)java_thread, 73.188 + user_sys_cpu_time != 0)); 73.189 + } 73.190 + } 73.191 +JVM_END 73.192 + 73.193 // Returns a String array of all VM global flag names 73.194 JVM_ENTRY(jobjectArray, jmm_GetVMGlobalNames(JNIEnv *env)) 73.195 // last flag entry is always NULL, so subtract 1 73.196 @@ -2020,7 +2098,7 @@ 73.197 jmm_GetMemoryManagers, 73.198 jmm_GetMemoryPoolUsage, 73.199 jmm_GetPeakMemoryPoolUsage, 73.200 - NULL, 73.201 + jmm_GetThreadAllocatedMemory, 73.202 jmm_GetMemoryUsage, 73.203 jmm_GetLongAttribute, 73.204 jmm_GetBoolAttribute, 73.205 @@ -2038,7 +2116,7 @@ 73.206 jmm_GetGCExtAttributeInfo, 73.207 jmm_GetLastGCStat, 73.208 jmm_GetThreadCpuTimeWithKind, 73.209 - NULL, 73.210 + jmm_GetThreadCpuTimesWithKind, 73.211 jmm_DumpHeap0, 73.212 jmm_FindDeadlockedThreads, 73.213 jmm_SetVMGlobal,
74.1 --- a/src/share/vm/services/threadService.cpp Wed Jan 12 18:33:25 2011 -0800 74.2 +++ b/src/share/vm/services/threadService.cpp Thu Jan 13 07:28:47 2011 -0800 74.3 @@ -1,5 +1,5 @@ 74.4 /* 74.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 74.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 74.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 74.8 * 74.9 * This code is free software; you can redistribute it and/or modify it 74.10 @@ -46,6 +46,7 @@ 74.11 // Default is disabled. 74.12 bool ThreadService::_thread_monitoring_contention_enabled = false; 74.13 bool ThreadService::_thread_cpu_time_enabled = false; 74.14 +bool ThreadService::_thread_allocated_memory_enabled = false; 74.15 74.16 PerfCounter* ThreadService::_total_threads_count = NULL; 74.17 PerfVariable* ThreadService::_live_threads_count = NULL; 74.18 @@ -84,6 +85,8 @@ 74.19 if (os::is_thread_cpu_time_supported()) { 74.20 _thread_cpu_time_enabled = true; 74.21 } 74.22 + 74.23 + _thread_allocated_memory_enabled = true; // Always on, so enable it 74.24 } 74.25 74.26 void ThreadService::reset_peak_thread_count() { 74.27 @@ -181,6 +184,15 @@ 74.28 return prev; 74.29 } 74.30 74.31 +bool ThreadService::set_thread_allocated_memory_enabled(bool flag) { 74.32 + MutexLocker m(Management_lock); 74.33 + 74.34 + bool prev = _thread_allocated_memory_enabled; 74.35 + _thread_allocated_memory_enabled = flag; 74.36 + 74.37 + return prev; 74.38 +} 74.39 + 74.40 // GC support 74.41 void ThreadService::oops_do(OopClosure* f) { 74.42 for (ThreadDumpResult* dump = _threaddump_list; dump != NULL; dump = dump->next()) {
75.1 --- a/src/share/vm/services/threadService.hpp Wed Jan 12 18:33:25 2011 -0800 75.2 +++ b/src/share/vm/services/threadService.hpp Thu Jan 13 07:28:47 2011 -0800 75.3 @@ -1,5 +1,5 @@ 75.4 /* 75.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 75.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 75.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 75.8 * 75.9 * This code is free software; you can redistribute it and/or modify it 75.10 @@ -65,6 +65,7 @@ 75.11 75.12 static bool _thread_monitoring_contention_enabled; 75.13 static bool _thread_cpu_time_enabled; 75.14 + static bool _thread_allocated_memory_enabled; 75.15 75.16 // Need to keep the list of thread dump result that 75.17 // keep references to methodOop since thread dump can be 75.18 @@ -83,6 +84,9 @@ 75.19 static bool set_thread_cpu_time_enabled(bool flag); 75.20 static bool is_thread_cpu_time_enabled() { return _thread_cpu_time_enabled; } 75.21 75.22 + static bool set_thread_allocated_memory_enabled(bool flag); 75.23 + static bool is_thread_allocated_memory_enabled() { return _thread_cpu_time_enabled; } 75.24 + 75.25 static jlong get_total_thread_count() { return _total_threads_count->get_value(); } 75.26 static jlong get_peak_thread_count() { return _peak_threads_count->get_value(); } 75.27 static jlong get_live_thread_count() { return _live_threads_count->get_value() - _exiting_threads_count; }
76.1 --- a/src/share/vm/utilities/debug.cpp Wed Jan 12 18:33:25 2011 -0800 76.2 +++ b/src/share/vm/utilities/debug.cpp Thu Jan 13 07:28:47 2011 -0800 76.3 @@ -226,7 +226,7 @@ 76.4 76.5 void report_vm_out_of_memory(const char* file, int line, size_t size, 76.6 const char* message) { 76.7 - if (Debugging || error_is_suppressed(file, line)) return; 76.8 + if (Debugging) return; 76.9 76.10 // We try to gather additional information for the first out of memory 76.11 // error only; gathering additional data might cause an allocation and a
77.1 --- a/src/share/vm/utilities/vmError.cpp Wed Jan 12 18:33:25 2011 -0800 77.2 +++ b/src/share/vm/utilities/vmError.cpp Thu Jan 13 07:28:47 2011 -0800 77.3 @@ -67,7 +67,7 @@ 77.4 // threads are blocked forever inside report_and_die(). 77.5 77.6 // Constructor for crashes 77.7 -VMError::VMError(Thread* thread, int sig, address pc, void* siginfo, void* context) { 77.8 +VMError::VMError(Thread* thread, unsigned int sig, address pc, void* siginfo, void* context) { 77.9 _thread = thread; 77.10 _id = sig; 77.11 _pc = pc; 77.12 @@ -322,29 +322,51 @@ 77.13 77.14 STEP(10, "(printing fatal error message)") 77.15 77.16 - st->print_cr("#"); 77.17 - st->print_cr("# A fatal error has been detected by the Java Runtime Environment:"); 77.18 + st->print_cr("#"); 77.19 + if (should_report_bug(_id)) { 77.20 + st->print_cr("# A fatal error has been detected by the Java Runtime Environment:"); 77.21 + } else { 77.22 + st->print_cr("# There is insufficient memory for the Java " 77.23 + "Runtime Environment to continue."); 77.24 + } 77.25 77.26 STEP(15, "(printing type of error)") 77.27 77.28 switch(_id) { 77.29 case oom_error: 77.30 - st->print_cr("#"); 77.31 - st->print("# java.lang.OutOfMemoryError: "); 77.32 if (_size) { 77.33 - st->print("requested "); 77.34 - sprintf(buf,SIZE_FORMAT,_size); 77.35 + st->print("# Native memory allocation (malloc) failed to allocate "); 77.36 + jio_snprintf(buf, sizeof(buf), SIZE_FORMAT, _size); 77.37 st->print(buf); 77.38 st->print(" bytes"); 77.39 if (_message != NULL) { 77.40 st->print(" for "); 77.41 st->print(_message); 77.42 } 77.43 - st->print_cr(". Out of swap space?"); 77.44 + st->cr(); 77.45 } else { 77.46 if (_message != NULL) 77.47 + st->print("# "); 77.48 st->print_cr(_message); 77.49 } 77.50 + // In error file give some solutions 77.51 + if (_verbose) { 77.52 + st->print_cr("# Possible reasons:"); 77.53 + st->print_cr("# The system is out of physical RAM or swap space"); 77.54 + st->print_cr("# In 32 bit mode, the process size limit was hit"); 77.55 + st->print_cr("# Possible solutions:"); 77.56 + st->print_cr("# Reduce memory load on the system"); 77.57 + st->print_cr("# Increase physical memory or swap space"); 77.58 + st->print_cr("# Check if swap backing store is full"); 77.59 + st->print_cr("# Use 64 bit Java on a 64 bit OS"); 77.60 + st->print_cr("# Decrease Java heap size (-Xmx/-Xms)"); 77.61 + st->print_cr("# Decrease number of Java threads"); 77.62 + st->print_cr("# Decrease Java thread stack sizes (-Xss)"); 77.63 + st->print_cr("# Set larger code cache with -XX:ReservedCodeCacheSize="); 77.64 + st->print_cr("# This output file may be truncated or incomplete."); 77.65 + } else { 77.66 + return; // that's enough for the screen 77.67 + } 77.68 break; 77.69 case internal_error: 77.70 default: 77.71 @@ -361,7 +383,11 @@ 77.72 st->print(" (0x%x)", _id); // signal number 77.73 st->print(" at pc=" PTR_FORMAT, _pc); 77.74 } else { 77.75 - st->print("Internal Error"); 77.76 + if (should_report_bug(_id)) { 77.77 + st->print("Internal Error"); 77.78 + } else { 77.79 + st->print("Out of Memory Error"); 77.80 + } 77.81 if (_filename != NULL && _lineno > 0) { 77.82 #ifdef PRODUCT 77.83 // In product mode chop off pathname? 77.84 @@ -393,12 +419,14 @@ 77.85 77.86 STEP(40, "(printing error message)") 77.87 77.88 - // error message 77.89 - if (_detail_msg) { 77.90 - st->print_cr("# %s: %s", _message ? _message : "Error", _detail_msg); 77.91 - } else if (_message) { 77.92 - st->print_cr("# Error: %s", _message); 77.93 - } 77.94 + if (should_report_bug(_id)) { // already printed the message. 77.95 + // error message 77.96 + if (_detail_msg) { 77.97 + st->print_cr("# %s: %s", _message ? _message : "Error", _detail_msg); 77.98 + } else if (_message) { 77.99 + st->print_cr("# Error: %s", _message); 77.100 + } 77.101 + } 77.102 77.103 STEP(50, "(printing Java version string)") 77.104 77.105 @@ -428,7 +456,9 @@ 77.106 77.107 STEP(65, "(printing bug submit message)") 77.108 77.109 - if (_verbose) print_bug_submit_message(st, _thread); 77.110 + if (should_report_bug(_id) && _verbose) { 77.111 + print_bug_submit_message(st, _thread); 77.112 + } 77.113 77.114 STEP(70, "(printing thread)" ) 77.115 77.116 @@ -906,7 +936,7 @@ 77.117 OnError = NULL; 77.118 } 77.119 77.120 - static bool skip_bug_url = false; 77.121 + static bool skip_bug_url = !should_report_bug(first_error->_id); 77.122 if (!skip_bug_url) { 77.123 skip_bug_url = true; 77.124 77.125 @@ -919,7 +949,8 @@ 77.126 static bool skip_os_abort = false; 77.127 if (!skip_os_abort) { 77.128 skip_os_abort = true; 77.129 - os::abort(); 77.130 + bool dump_core = should_report_bug(first_error->_id); 77.131 + os::abort(dump_core); 77.132 } 77.133 77.134 // if os::abort() doesn't abort, try os::die();
78.1 --- a/src/share/vm/utilities/vmError.hpp Wed Jan 12 18:33:25 2011 -0800 78.2 +++ b/src/share/vm/utilities/vmError.hpp Thu Jan 13 07:28:47 2011 -0800 78.3 @@ -87,10 +87,12 @@ 78.4 // accessor 78.5 const char* message() const { return _message; } 78.6 const char* detail_msg() const { return _detail_msg; } 78.7 + bool should_report_bug(unsigned int id) { return id != oom_error; } 78.8 78.9 public: 78.10 // Constructor for crashes 78.11 - VMError(Thread* thread, int sig, address pc, void* siginfo, void* context); 78.12 + VMError(Thread* thread, unsigned int sig, address pc, void* siginfo, 78.13 + void* context); 78.14 // Constructor for VM internal errors 78.15 VMError(Thread* thread, const char* filename, int lineno, 78.16 const char* message, const char * detail_msg);
79.1 --- a/test/Makefile Wed Jan 12 18:33:25 2011 -0800 79.2 +++ b/test/Makefile Thu Jan 13 07:28:47 2011 -0800 79.3 @@ -1,5 +1,5 @@ 79.4 # 79.5 -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. 79.6 +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. 79.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 79.8 # 79.9 # This code is free software; you can redistribute it and/or modify it
80.1 --- a/test/compiler/6431242/Test.java Wed Jan 12 18:33:25 2011 -0800 80.2 +++ b/test/compiler/6431242/Test.java Thu Jan 13 07:28:47 2011 -0800 80.3 @@ -1,5 +1,5 @@ 80.4 /* 80.5 - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. 80.6 + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 80.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 80.8 * 80.9 * This code is free software; you can redistribute it and/or modify it
81.1 --- a/test/compiler/6857159/Test6857159.java Wed Jan 12 18:33:25 2011 -0800 81.2 +++ b/test/compiler/6857159/Test6857159.java Thu Jan 13 07:28:47 2011 -0800 81.3 @@ -1,5 +1,5 @@ 81.4 /* 81.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 81.6 + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 81.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 81.8 * 81.9 * This code is free software; you can redistribute it and/or modify it
82.1 --- a/test/compiler/6877254/Test.java Wed Jan 12 18:33:25 2011 -0800 82.2 +++ b/test/compiler/6877254/Test.java Thu Jan 13 07:28:47 2011 -0800 82.3 @@ -1,5 +1,5 @@ 82.4 /* 82.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 82.6 + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 82.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 82.8 * 82.9 * This code is free software; you can redistribute it and/or modify it
83.1 --- a/test/compiler/6895383/Test.java Wed Jan 12 18:33:25 2011 -0800 83.2 +++ b/test/compiler/6895383/Test.java Thu Jan 13 07:28:47 2011 -0800 83.3 @@ -1,5 +1,5 @@ 83.4 /* 83.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 83.6 + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 83.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 83.8 * 83.9 * This code is free software; you can redistribute it and/or modify it
84.1 --- a/test/compiler/6896727/Test.java Wed Jan 12 18:33:25 2011 -0800 84.2 +++ b/test/compiler/6896727/Test.java Thu Jan 13 07:28:47 2011 -0800 84.3 @@ -1,5 +1,5 @@ 84.4 /* 84.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 84.6 + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 84.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 84.8 * 84.9 * This code is free software; you can redistribute it and/or modify it