Thu, 26 Jun 2014 08:29:41 -0700
Merge
.hgtags | file | annotate | diff | comparison | revisions | |
make/hotspot_version | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Wed Jun 18 13:30:11 2014 -0700 1.2 +++ b/.hgtags Thu Jun 26 08:29:41 2014 -0700 1.3 @@ -438,6 +438,7 @@ 1.4 17a75e692af397532e2b296b24f6b9b6c239c633 jdk8u5-b11 1.5 9b289963cb9a14636fbe8faaa2dd6d3678464a7b jdk8u5-b12 1.6 8a67179106085689906732013a282efeeb9bd5f4 jdk8u5-b13 1.7 +5c7ef8e396835b82c0460b73f23cac86ba34846f jdk8u5-b31 1.8 f0d759a6a2309a1c149d530b29db24eda885f267 jdk8u11-b01 1.9 3c079aebb516765784dd8097887daadda5a76ac1 jdk8u11-b02 1.10 0037e964ce486c009984171f004259263628079f jdk8u11-b03 1.11 @@ -488,6 +489,8 @@ 1.12 11159d7ec80462a422e39c9b3a39ae932923622d jdk8u20-b18 1.13 3e1cec358ab95ef985f821219104141b9ffda83f hs25.20-b19 1.14 b15553cde967dfd7781a4a5c669e4cb7db734317 jdk8u20-b19 1.15 +4f18dea0312d601d0515976bc0c643ea7acc829d hs25.20-b20 1.16 +9e4d27da4ac04c6e19291087f7c68a5c5803c7ca jdk8u20-b20 1.17 a4d44dfb7d30eea54bc172e4429a655454ae0bbf jdk8u25-b00 1.18 9a2152fbd929b0d8b2f5c326a5526214ae71731a jdk8u25-b01 1.19 d3d5604ea0dea3812e87ba76ac199d0a8be6f49f jdk8u25-b02
2.1 --- a/agent/src/os/linux/libproc.h Wed Jun 18 13:30:11 2014 -0700 2.2 +++ b/agent/src/os/linux/libproc.h Thu Jun 26 08:29:41 2014 -0700 2.3 @@ -34,7 +34,7 @@ 2.4 #include "libproc_md.h" 2.5 #endif 2.6 2.7 -#include <linux/ptrace.h> 2.8 +#include <sys/ptrace.h> 2.9 2.10 /************************************************************************************ 2.11
3.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Jun 18 13:30:11 2014 -0700 3.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Jun 26 08:29:41 2014 -0700 3.3 @@ -432,14 +432,6 @@ 3.4 return hr; 3.5 } 3.6 3.7 -void G1CollectedHeap::stop_conc_gc_threads() { 3.8 - _cg1r->stop(); 3.9 - _cmThread->stop(); 3.10 - if (G1StringDedup::is_enabled()) { 3.11 - G1StringDedup::stop(); 3.12 - } 3.13 -} 3.14 - 3.15 #ifdef ASSERT 3.16 // A region is added to the collection set as it is retired 3.17 // so an address p can point to a region which will be in the 3.18 @@ -2186,20 +2178,14 @@ 3.19 } 3.20 3.21 void G1CollectedHeap::stop() { 3.22 -#if 0 3.23 - // Stopping concurrent worker threads is currently disabled until 3.24 - // some bugs in concurrent mark has been resolve. Without fixing 3.25 - // those bugs first we risk haning during VM exit when trying to 3.26 - // stop these threads. 3.27 - 3.28 - // Abort any ongoing concurrent root region scanning and stop all 3.29 - // concurrent threads. We do this to make sure these threads do 3.30 - // not continue to execute and access resources (e.g. gclog_or_tty) 3.31 + // Stop all concurrent threads. We do this to make sure these threads 3.32 + // do not continue to execute and access resources (e.g. gclog_or_tty) 3.33 // that are destroyed during shutdown. 3.34 - _cm->root_regions()->abort(); 3.35 - _cm->root_regions()->wait_until_scan_finished(); 3.36 - stop_conc_gc_threads(); 3.37 -#endif 3.38 + _cg1r->stop(); 3.39 + _cmThread->stop(); 3.40 + if (G1StringDedup::is_enabled()) { 3.41 + G1StringDedup::stop(); 3.42 + } 3.43 } 3.44 3.45 size_t G1CollectedHeap::conservative_max_heap_alignment() {
4.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Jun 18 13:30:11 2014 -0700 4.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Thu Jun 26 08:29:41 2014 -0700 4.3 @@ -1699,8 +1699,6 @@ 4.4 void print_all_rsets() PRODUCT_RETURN; 4.5 4.6 public: 4.7 - void stop_conc_gc_threads(); 4.8 - 4.9 size_t pending_card_num(); 4.10 size_t cards_scanned(); 4.11
5.1 --- a/src/share/vm/opto/graphKit.cpp Wed Jun 18 13:30:11 2014 -0700 5.2 +++ b/src/share/vm/opto/graphKit.cpp Thu Jun 26 08:29:41 2014 -0700 5.3 @@ -2458,7 +2458,7 @@ 5.4 5.5 //------------------------------make_slow_call_ex------------------------------ 5.6 // Make the exception handler hookups for the slow call 5.7 -void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj) { 5.8 +void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj, bool deoptimize) { 5.9 if (stopped()) return; 5.10 5.11 // Make a catch node with just two handlers: fall-through and catch-all 5.12 @@ -2472,11 +2472,17 @@ 5.13 set_i_o(i_o); 5.14 5.15 if (excp != top()) { 5.16 - // Create an exception state also. 5.17 - // Use an exact type if the caller has specified a specific exception. 5.18 - const Type* ex_type = TypeOopPtr::make_from_klass_unique(ex_klass)->cast_to_ptr_type(TypePtr::NotNull); 5.19 - Node* ex_oop = new (C) CreateExNode(ex_type, control(), i_o); 5.20 - add_exception_state(make_exception_state(_gvn.transform(ex_oop))); 5.21 + if (deoptimize) { 5.22 + // Deoptimize if an exception is caught. Don't construct exception state in this case. 5.23 + uncommon_trap(Deoptimization::Reason_unhandled, 5.24 + Deoptimization::Action_none); 5.25 + } else { 5.26 + // Create an exception state also. 5.27 + // Use an exact type if the caller has specified a specific exception. 5.28 + const Type* ex_type = TypeOopPtr::make_from_klass_unique(ex_klass)->cast_to_ptr_type(TypePtr::NotNull); 5.29 + Node* ex_oop = new (C) CreateExNode(ex_type, control(), i_o); 5.30 + add_exception_state(make_exception_state(_gvn.transform(ex_oop))); 5.31 + } 5.32 } 5.33 } 5.34 5.35 @@ -3290,7 +3296,8 @@ 5.36 5.37 //---------------------------set_output_for_allocation------------------------- 5.38 Node* GraphKit::set_output_for_allocation(AllocateNode* alloc, 5.39 - const TypeOopPtr* oop_type) { 5.40 + const TypeOopPtr* oop_type, 5.41 + bool deoptimize_on_exception) { 5.42 int rawidx = Compile::AliasIdxRaw; 5.43 alloc->set_req( TypeFunc::FramePtr, frameptr() ); 5.44 add_safepoint_edges(alloc); 5.45 @@ -3298,7 +3305,7 @@ 5.46 set_control( _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Control) ) ); 5.47 // create memory projection for i_o 5.48 set_memory ( _gvn.transform( new (C) ProjNode(allocx, TypeFunc::Memory, true) ), rawidx ); 5.49 - make_slow_call_ex(allocx, env()->Throwable_klass(), true); 5.50 + make_slow_call_ex(allocx, env()->Throwable_klass(), true, deoptimize_on_exception); 5.51 5.52 // create a memory projection as for the normal control path 5.53 Node* malloc = _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Memory)); 5.54 @@ -3376,9 +3383,11 @@ 5.55 // The optional arguments are for specialized use by intrinsics: 5.56 // - If 'extra_slow_test' if not null is an extra condition for the slow-path. 5.57 // - If 'return_size_val', report the the total object size to the caller. 5.58 +// - deoptimize_on_exception controls how Java exceptions are handled (rethrow vs deoptimize) 5.59 Node* GraphKit::new_instance(Node* klass_node, 5.60 Node* extra_slow_test, 5.61 - Node* *return_size_val) { 5.62 + Node* *return_size_val, 5.63 + bool deoptimize_on_exception) { 5.64 // Compute size in doublewords 5.65 // The size is always an integral number of doublewords, represented 5.66 // as a positive bytewise size stored in the klass's layout_helper. 5.67 @@ -3447,7 +3456,7 @@ 5.68 size, klass_node, 5.69 initial_slow_test); 5.70 5.71 - return set_output_for_allocation(alloc, oop_type); 5.72 + return set_output_for_allocation(alloc, oop_type, deoptimize_on_exception); 5.73 } 5.74 5.75 //-------------------------------new_array------------------------------------- 5.76 @@ -3457,7 +3466,8 @@ 5.77 Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) 5.78 Node* length, // number of array elements 5.79 int nargs, // number of arguments to push back for uncommon trap 5.80 - Node* *return_size_val) { 5.81 + Node* *return_size_val, 5.82 + bool deoptimize_on_exception) { 5.83 jint layout_con = Klass::_lh_neutral_value; 5.84 Node* layout_val = get_layout_helper(klass_node, layout_con); 5.85 int layout_is_con = (layout_val == NULL); 5.86 @@ -3600,7 +3610,7 @@ 5.87 ary_type = ary_type->is_aryptr()->cast_to_size(length_type); 5.88 } 5.89 5.90 - Node* javaoop = set_output_for_allocation(alloc, ary_type); 5.91 + Node* javaoop = set_output_for_allocation(alloc, ary_type, deoptimize_on_exception); 5.92 5.93 // Cast length on remaining path to be as narrow as possible 5.94 if (map()->find_edge(length) >= 0) {
6.1 --- a/src/share/vm/opto/graphKit.hpp Wed Jun 18 13:30:11 2014 -0700 6.2 +++ b/src/share/vm/opto/graphKit.hpp Thu Jun 26 08:29:41 2014 -0700 6.3 @@ -802,7 +802,7 @@ 6.4 6.5 // merge in all memory slices from new_mem, along the given path 6.6 void merge_memory(Node* new_mem, Node* region, int new_path); 6.7 - void make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj); 6.8 + void make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj, bool deoptimize = false); 6.9 6.10 // Helper functions to build synchronizations 6.11 int next_monitor(); 6.12 @@ -844,13 +844,16 @@ 6.13 6.14 // implementation of object creation 6.15 Node* set_output_for_allocation(AllocateNode* alloc, 6.16 - const TypeOopPtr* oop_type); 6.17 + const TypeOopPtr* oop_type, 6.18 + bool deoptimize_on_exception=false); 6.19 Node* get_layout_helper(Node* klass_node, jint& constant_value); 6.20 Node* new_instance(Node* klass_node, 6.21 Node* slow_test = NULL, 6.22 - Node* *return_size_val = NULL); 6.23 + Node* *return_size_val = NULL, 6.24 + bool deoptimize_on_exception = false); 6.25 Node* new_array(Node* klass_node, Node* count_val, int nargs, 6.26 - Node* *return_size_val = NULL); 6.27 + Node* *return_size_val = NULL, 6.28 + bool deoptimize_on_exception = false); 6.29 6.30 // java.lang.String helpers 6.31 Node* load_String_offset(Node* ctrl, Node* str);
7.1 --- a/src/share/vm/opto/library_call.cpp Wed Jun 18 13:30:11 2014 -0700 7.2 +++ b/src/share/vm/opto/library_call.cpp Thu Jun 26 08:29:41 2014 -0700 7.3 @@ -4576,7 +4576,10 @@ 7.4 // It's an instance, and it passed the slow-path tests. 7.5 PreserveJVMState pjvms(this); 7.6 Node* obj_size = NULL; 7.7 - Node* alloc_obj = new_instance(obj_klass, NULL, &obj_size); 7.8 + // Need to deoptimize on exception from allocation since Object.clone intrinsic 7.9 + // is reexecuted if deoptimization occurs and there could be problems when merging 7.10 + // exception state between multiple Object.clone versions (reexecute=true vs reexecute=false). 7.11 + Node* alloc_obj = new_instance(obj_klass, NULL, &obj_size, /*deoptimize_on_exception=*/true); 7.12 7.13 copy_to_clone(obj, alloc_obj, obj_size, false, !use_ReduceInitialCardMarks()); 7.14
8.1 --- a/src/share/vm/runtime/java.cpp Wed Jun 18 13:30:11 2014 -0700 8.2 +++ b/src/share/vm/runtime/java.cpp Thu Jun 26 08:29:41 2014 -0700 8.3 @@ -497,9 +497,6 @@ 8.4 os::infinite_sleep(); 8.5 } 8.6 8.7 - // Stop any ongoing concurrent GC work 8.8 - Universe::heap()->stop(); 8.9 - 8.10 // Terminate watcher thread - must before disenrolling any periodic task 8.11 if (PeriodicTask::num_tasks() > 0) 8.12 WatcherThread::stop(); 8.13 @@ -514,10 +511,8 @@ 8.14 StatSampler::disengage(); 8.15 StatSampler::destroy(); 8.16 8.17 - // We do not need to explicitly stop concurrent GC threads because the 8.18 - // JVM will be taken down at a safepoint when such threads are inactive -- 8.19 - // except for some concurrent G1 threads, see (comment in) 8.20 - // Threads::destroy_vm(). 8.21 + // Stop concurrent GC threads 8.22 + Universe::heap()->stop(); 8.23 8.24 // Print GC/heap related information. 8.25 if (PrintGCDetails) {
9.1 --- a/src/share/vm/runtime/thread.cpp Wed Jun 18 13:30:11 2014 -0700 9.2 +++ b/src/share/vm/runtime/thread.cpp Thu Jun 26 08:29:41 2014 -0700 9.3 @@ -4013,14 +4013,8 @@ 9.4 // GC vm_operations can get caught at the safepoint, and the 9.5 // heap is unparseable if they are caught. Grab the Heap_lock 9.6 // to prevent this. The GC vm_operations will not be able to 9.7 - // queue until after the vm thread is dead. 9.8 - // After this point, we'll never emerge out of the safepoint before 9.9 - // the VM exits, so concurrent GC threads do not need to be explicitly 9.10 - // stopped; they remain inactive until the process exits. 9.11 - // Note: some concurrent G1 threads may be running during a safepoint, 9.12 - // but these will not be accessing the heap, just some G1-specific side 9.13 - // data structures that are not accessed by any other threads but them 9.14 - // after this point in a terminal safepoint. 9.15 + // queue until after the vm thread is dead. After this point, 9.16 + // we'll never emerge out of the safepoint before the VM exits. 9.17 9.18 MutexLocker ml(Heap_lock); 9.19
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/test/compiler/intrinsics/clone/TestObjectClone.java Thu Jun 26 08:29:41 2014 -0700 10.3 @@ -0,0 +1,80 @@ 10.4 +/* 10.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 10.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10.7 + * 10.8 + * This code is free software; you can redistribute it and/or modify it 10.9 + * under the terms of the GNU General Public License version 2 only, as 10.10 + * published by the Free Software Foundation. 10.11 + * 10.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 10.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 10.15 + * version 2 for more details (a copy is included in the LICENSE file that 10.16 + * accompanied this code). 10.17 + * 10.18 + * You should have received a copy of the GNU General Public License version 10.19 + * 2 along with this work; if not, write to the Free Software Foundation, 10.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 10.21 + * 10.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 10.23 + * or visit www.oracle.com if you need additional information or have any 10.24 + * questions. 10.25 + * 10.26 + */ 10.27 + 10.28 +/* 10.29 + * @test 10.30 + * @bug 8033626 10.31 + * @summary assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place 10.32 + * @library /testlibrary 10.33 + * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileOnly=TestObjectClone::f TestObjectClone 10.34 + */ 10.35 +import com.oracle.java.testlibrary.Asserts; 10.36 + 10.37 +public class TestObjectClone implements Cloneable { 10.38 + static class A extends TestObjectClone {} 10.39 + static class B extends TestObjectClone { 10.40 + public B clone() { 10.41 + return (B)TestObjectClone.b; 10.42 + } 10.43 + } 10.44 + static class C extends TestObjectClone { 10.45 + public C clone() { 10.46 + return (C)TestObjectClone.c; 10.47 + } 10.48 + } 10.49 + static class D extends TestObjectClone { 10.50 + public D clone() { 10.51 + return (D)TestObjectClone.d; 10.52 + } 10.53 + } 10.54 + static TestObjectClone a = new A(), b = new B(), c = new C(), d = new D(); 10.55 + 10.56 + public static Object f(TestObjectClone o) throws CloneNotSupportedException { 10.57 + // Polymorphic call site: >90% Object::clone / <10% other methods 10.58 + return o.clone(); 10.59 + } 10.60 + 10.61 + public static void main(String[] args) throws Exception { 10.62 + TestObjectClone[] params1 = {a, a, a, a, a, a, a, a, a, a, a, 10.63 + a, a, a, a, a, a, a, a, a, a, a, 10.64 + a, a, a, a, a, a, a, a, a, a, a, 10.65 + b, c, d}; 10.66 + 10.67 + for (int i = 0; i < 15000; i++) { 10.68 + f(params1[i % params1.length]); 10.69 + } 10.70 + 10.71 + Asserts.assertTrue(f(a) != a); 10.72 + Asserts.assertTrue(f(b) == b); 10.73 + Asserts.assertTrue(f(c) == c); 10.74 + Asserts.assertTrue(f(d) == d); 10.75 + 10.76 + try { 10.77 + f(null); 10.78 + throw new AssertionError(""); 10.79 + } catch (NullPointerException e) { /* expected */ } 10.80 + 10.81 + System.out.println("TEST PASSED"); 10.82 + } 10.83 +}