Fri, 09 Aug 2013 15:36:09 -0700
Merge
1.1 --- a/.hgtags Fri Aug 09 09:51:21 2013 -0700 1.2 +++ b/.hgtags Fri Aug 09 15:36:09 2013 -0700 1.3 @@ -365,3 +365,5 @@ 1.4 46487ba40ff225654d0c51787ed3839bafcbd9f3 hs25-b43 1.5 f6921c876db192bba389cec062855a66372da01c jdk8-b101 1.6 530fe88b3b2c710f42810b3580d86a0d83ad6c1c hs25-b44 1.7 +c4697c1c448416108743b59118b4a2498b339d0c jdk8-b102 1.8 +7f55137d6aa81efc6eb0035813709f2cb6a26b8b hs25-b45
2.1 --- a/make/hotspot_version Fri Aug 09 09:51:21 2013 -0700 2.2 +++ b/make/hotspot_version Fri Aug 09 15:36:09 2013 -0700 2.3 @@ -35,7 +35,7 @@ 2.4 2.5 HS_MAJOR_VER=25 2.6 HS_MINOR_VER=0 2.7 -HS_BUILD_NUMBER=45 2.8 +HS_BUILD_NUMBER=46 2.9 2.10 JDK_MAJOR_VER=1 2.11 JDK_MINOR_VER=8
3.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp Fri Aug 09 09:51:21 2013 -0700 3.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp Fri Aug 09 15:36:09 2013 -0700 3.3 @@ -2295,7 +2295,7 @@ 3.4 if (gen_type_check) { 3.5 // We have determined that offset == referent_offset && src != null. 3.6 // if (src->_klass->_reference_type == REF_NONE) -> continue 3.7 - __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), UseCompressedKlassPointers ? T_OBJECT : T_ADDRESS), src_klass); 3.8 + __ move(new LIR_Address(src.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), src_klass); 3.9 LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE); 3.10 LIR_Opr reference_type = new_register(T_INT); 3.11 __ move(reference_type_addr, reference_type);
4.1 --- a/src/share/vm/classfile/classLoader.cpp Fri Aug 09 09:51:21 2013 -0700 4.2 +++ b/src/share/vm/classfile/classLoader.cpp Fri Aug 09 15:36:09 2013 -0700 4.3 @@ -878,7 +878,7 @@ 4.4 4.5 instanceKlassHandle ClassLoader::load_classfile(Symbol* h_name, TRAPS) { 4.6 ResourceMark rm(THREAD); 4.7 - EventMark m("loading class " INTPTR_FORMAT, (address)h_name); 4.8 + EventMark m("loading class %s", h_name->as_C_string()); 4.9 ThreadProfilerMark tpm(ThreadProfilerMark::classLoaderRegion); 4.10 4.11 stringStream st;
5.1 --- a/src/share/vm/runtime/arguments.cpp Fri Aug 09 09:51:21 2013 -0700 5.2 +++ b/src/share/vm/runtime/arguments.cpp Fri Aug 09 15:36:09 2013 -0700 5.3 @@ -60,6 +60,28 @@ 5.4 #define DEFAULT_VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/crash.jsp" 5.5 #define DEFAULT_JAVA_LAUNCHER "generic" 5.6 5.7 +// Disable options not supported in this release, with a warning if they 5.8 +// were explicitly requested on the command-line 5.9 +#define UNSUPPORTED_OPTION(opt, description) \ 5.10 +do { \ 5.11 + if (opt) { \ 5.12 + if (FLAG_IS_CMDLINE(opt)) { \ 5.13 + warning(description " is disabled in this release."); \ 5.14 + } \ 5.15 + FLAG_SET_DEFAULT(opt, false); \ 5.16 + } \ 5.17 +} while(0) 5.18 + 5.19 +#define UNSUPPORTED_GC_OPTION(gc) \ 5.20 +do { \ 5.21 + if (gc) { \ 5.22 + if (FLAG_IS_CMDLINE(gc)) { \ 5.23 + warning(#gc " is not supported in this VM. Using Serial GC."); \ 5.24 + } \ 5.25 + FLAG_SET_DEFAULT(gc, false); \ 5.26 + } \ 5.27 +} while(0) 5.28 + 5.29 char** Arguments::_jvm_flags_array = NULL; 5.30 int Arguments::_num_jvm_flags = 0; 5.31 char** Arguments::_jvm_args_array = NULL; 5.32 @@ -3128,14 +3150,17 @@ 5.33 FLAG_SET_DEFAULT(UseLargePages, false); 5.34 } 5.35 5.36 - // Tiered compilation is undefined with C1. 5.37 - TieredCompilation = false; 5.38 #else 5.39 if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) { 5.40 FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1); 5.41 } 5.42 #endif 5.43 5.44 +#ifndef TIERED 5.45 + // Tiered compilation is undefined. 5.46 + UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation"); 5.47 +#endif 5.48 + 5.49 // If we are running in a headless jre, force java.awt.headless property 5.50 // to be true unless the property has already been set. 5.51 // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state. 5.52 @@ -3278,29 +3303,6 @@ 5.53 } 5.54 } 5.55 5.56 -// Disable options not supported in this release, with a warning if they 5.57 -// were explicitly requested on the command-line 5.58 -#define UNSUPPORTED_OPTION(opt, description) \ 5.59 -do { \ 5.60 - if (opt) { \ 5.61 - if (FLAG_IS_CMDLINE(opt)) { \ 5.62 - warning(description " is disabled in this release."); \ 5.63 - } \ 5.64 - FLAG_SET_DEFAULT(opt, false); \ 5.65 - } \ 5.66 -} while(0) 5.67 - 5.68 - 5.69 -#define UNSUPPORTED_GC_OPTION(gc) \ 5.70 -do { \ 5.71 - if (gc) { \ 5.72 - if (FLAG_IS_CMDLINE(gc)) { \ 5.73 - warning(#gc " is not supported in this VM. Using Serial GC."); \ 5.74 - } \ 5.75 - FLAG_SET_DEFAULT(gc, false); \ 5.76 - } \ 5.77 -} while(0) 5.78 - 5.79 #if !INCLUDE_ALL_GCS 5.80 static void force_serial_gc() { 5.81 FLAG_SET_DEFAULT(UseSerialGC, true);
6.1 --- a/src/share/vm/utilities/exceptions.cpp Fri Aug 09 09:51:21 2013 -0700 6.2 +++ b/src/share/vm/utilities/exceptions.cpp Fri Aug 09 15:36:09 2013 -0700 6.3 @@ -125,13 +125,13 @@ 6.4 } 6.5 6.6 void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exception, const char* message) { 6.7 + ResourceMark rm; 6.8 assert(h_exception() != NULL, "exception should not be NULL"); 6.9 6.10 // tracing (do this up front - so it works during boot strapping) 6.11 if (TraceExceptions) { 6.12 ttyLocker ttyl; 6.13 - ResourceMark rm; 6.14 - tty->print_cr("Exception <%s>%s%s (" INTPTR_FORMAT " ) \n" 6.15 + tty->print_cr("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" 6.16 "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, 6.17 h_exception->print_value_string(), 6.18 message ? ": " : "", message ? message : "", 6.19 @@ -141,7 +141,9 @@ 6.20 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception, message)); 6.21 6.22 // Check for special boot-strapping/vm-thread handling 6.23 - if (special_exception(thread, file, line, h_exception)) return; 6.24 + if (special_exception(thread, file, line, h_exception)) { 6.25 + return; 6.26 + } 6.27 6.28 assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable"); 6.29 6.30 @@ -149,7 +151,9 @@ 6.31 thread->set_pending_exception(h_exception(), file, line); 6.32 6.33 // vm log 6.34 - Events::log_exception(thread, "Threw " INTPTR_FORMAT " at %s:%d", (address)h_exception(), file, line); 6.35 + Events::log_exception(thread, "Exception <%s%s%s> (" INTPTR_FORMAT ") thrown at [%s, line %d]", 6.36 + h_exception->print_value_string(), message ? ": " : "", message ? message : "", 6.37 + (address)h_exception(), file, line); 6.38 } 6.39 6.40
7.1 --- a/src/share/vm/utilities/taskqueue.hpp Fri Aug 09 09:51:21 2013 -0700 7.2 +++ b/src/share/vm/utilities/taskqueue.hpp Fri Aug 09 15:36:09 2013 -0700 7.3 @@ -395,7 +395,13 @@ 7.4 template<class E, MEMFLAGS F, unsigned int N> 7.5 bool GenericTaskQueue<E, F, N>::pop_global(E& t) { 7.6 Age oldAge = _age.get(); 7.7 - uint localBot = _bottom; 7.8 + // Architectures with weak memory model require a barrier here 7.9 + // to guarantee that bottom is not older than age, 7.10 + // which is crucial for the correctness of the algorithm. 7.11 +#if !(defined SPARC || defined IA32 || defined AMD64) 7.12 + OrderAccess::fence(); 7.13 +#endif 7.14 + uint localBot = OrderAccess::load_acquire((volatile juint*)&_bottom); 7.15 uint n_elems = size(localBot, oldAge.top()); 7.16 if (n_elems == 0) { 7.17 return false; 7.18 @@ -644,7 +650,7 @@ 7.19 template<class E, MEMFLAGS F, unsigned int N> inline bool 7.20 GenericTaskQueue<E, F, N>::push(E t) { 7.21 uint localBot = _bottom; 7.22 - assert((localBot >= 0) && (localBot < N), "_bottom out of range."); 7.23 + assert(localBot < N, "_bottom out of range."); 7.24 idx_t top = _age.top(); 7.25 uint dirty_n_elems = dirty_size(localBot, top); 7.26 assert(dirty_n_elems < N, "n_elems out of range.");
8.1 --- a/test/compiler/codecache/CheckUpperLimit.java Fri Aug 09 09:51:21 2013 -0700 8.2 +++ b/test/compiler/codecache/CheckUpperLimit.java Fri Aug 09 15:36:09 2013 -0700 8.3 @@ -35,10 +35,6 @@ 8.4 ProcessBuilder pb; 8.5 OutputAnalyzer out; 8.6 8.7 - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2048m", "-version"); 8.8 - out = new OutputAnalyzer(pb.start()); 8.9 - out.shouldHaveExitValue(0); 8.10 - 8.11 pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); 8.12 out = new OutputAnalyzer(pb.start()); 8.13 out.shouldContain("Invalid ReservedCodeCacheSize=");
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java Fri Aug 09 15:36:09 2013 -0700 9.3 @@ -0,0 +1,71 @@ 9.4 +/* 9.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.7 + * 9.8 + * This code is free software; you can redistribute it and/or modify it 9.9 + * under the terms of the GNU General Public License version 2 only, as 9.10 + * published by the Free Software Foundation. 9.11 + * 9.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 9.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 9.15 + * version 2 for more details (a copy is included in the LICENSE file that 9.16 + * accompanied this code). 9.17 + * 9.18 + * You should have received a copy of the GNU General Public License version 9.19 + * 2 along with this work; if not, write to the Free Software Foundation, 9.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 9.21 + * 9.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 9.23 + * or visit www.oracle.com if you need additional information or have any 9.24 + * questions. 9.25 + */ 9.26 + 9.27 +/* 9.28 + * @test 9.29 + * @bug 8016474 9.30 + * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8) 9.31 + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier 9.32 + */ 9.33 + 9.34 +import java.lang.reflect.Field; 9.35 + 9.36 +import sun.misc.Unsafe; 9.37 + 9.38 +public class GetUnsafeObjectG1PreBarrier { 9.39 + private static final Unsafe unsafe; 9.40 + private static final int N = 100_000; 9.41 + 9.42 + static { 9.43 + try { 9.44 + Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); 9.45 + theUnsafe.setAccessible(true); 9.46 + unsafe = (Unsafe) theUnsafe.get(null); 9.47 + } catch (NoSuchFieldException | IllegalAccessException e) { 9.48 + throw new IllegalStateException(e); 9.49 + } 9.50 + } 9.51 + 9.52 + public Object a; 9.53 + 9.54 + public static void main(String[] args) throws Throwable { 9.55 + new GetUnsafeObjectG1PreBarrier(); 9.56 + } 9.57 + 9.58 + public GetUnsafeObjectG1PreBarrier() throws Throwable { 9.59 + doit(); 9.60 + } 9.61 + 9.62 + private void doit() throws Throwable { 9.63 + Field field = GetUnsafeObjectG1PreBarrier.class.getField("a"); 9.64 + long fieldOffset = unsafe.objectFieldOffset(field); 9.65 + 9.66 + for (int i = 0; i < N; i++) { 9.67 + readField(this, fieldOffset); 9.68 + } 9.69 + } 9.70 + 9.71 + private void readField(Object o, long fieldOffset) { 9.72 + unsafe.getObject(o, fieldOffset); 9.73 + } 9.74 +}