Merge
This commit is contained in:
commit
9ff01f7b2f
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -723,8 +723,7 @@ void ConnectionGraph::add_to_congraph_unsafe_access(Node* n, uint opcode, Unique
|
|||||||
if (adr_type->isa_oopptr()
|
if (adr_type->isa_oopptr()
|
||||||
|| ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
|
|| ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
|
||||||
&& adr_type == TypeRawPtr::NOTNULL
|
&& adr_type == TypeRawPtr::NOTNULL
|
||||||
&& adr->in(AddPNode::Address)->is_Proj()
|
&& is_captured_store_address(adr))) {
|
||||||
&& adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
|
|
||||||
delayed_worklist->push(n); // Process it later.
|
delayed_worklist->push(n); // Process it later.
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
assert (adr->is_AddP(), "expecting an AddP");
|
assert (adr->is_AddP(), "expecting an AddP");
|
||||||
@ -771,8 +770,7 @@ bool ConnectionGraph::add_final_edges_unsafe_access(Node* n, uint opcode) {
|
|||||||
if (adr_type->isa_oopptr()
|
if (adr_type->isa_oopptr()
|
||||||
|| ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
|
|| ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
|
||||||
&& adr_type == TypeRawPtr::NOTNULL
|
&& adr_type == TypeRawPtr::NOTNULL
|
||||||
&& adr->in(AddPNode::Address)->is_Proj()
|
&& is_captured_store_address(adr))) {
|
||||||
&& adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
|
|
||||||
// Point Address to Value
|
// Point Address to Value
|
||||||
PointsToNode* adr_ptn = ptnode_adr(adr->_idx);
|
PointsToNode* adr_ptn = ptnode_adr(adr->_idx);
|
||||||
assert(adr_ptn != NULL &&
|
assert(adr_ptn != NULL &&
|
||||||
@ -1584,8 +1582,7 @@ int ConnectionGraph::find_init_values(JavaObjectNode* pta, PointsToNode* init_va
|
|||||||
// Raw pointers are used for initializing stores so skip it
|
// Raw pointers are used for initializing stores so skip it
|
||||||
// since it should be recorded already
|
// since it should be recorded already
|
||||||
Node* base = get_addp_base(field->ideal_node());
|
Node* base = get_addp_base(field->ideal_node());
|
||||||
assert(adr_type->isa_rawptr() && base->is_Proj() &&
|
assert(adr_type->isa_rawptr() && is_captured_store_address(field->ideal_node()), "unexpected pointer type");
|
||||||
(base->in(0) == alloc),"unexpected pointer type");
|
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1916,8 +1913,7 @@ void ConnectionGraph::optimize_ideal_graph(GrowableArray<Node*>& ptr_cmp_worklis
|
|||||||
Node *n = storestore_worklist.pop();
|
Node *n = storestore_worklist.pop();
|
||||||
MemBarStoreStoreNode *storestore = n ->as_MemBarStoreStore();
|
MemBarStoreStoreNode *storestore = n ->as_MemBarStoreStore();
|
||||||
Node *alloc = storestore->in(MemBarNode::Precedent)->in(0);
|
Node *alloc = storestore->in(MemBarNode::Precedent)->in(0);
|
||||||
assert (alloc->is_Allocate(), "storestore should point to AllocateNode");
|
if (alloc->is_Allocate() && not_global_escape(alloc)) {
|
||||||
if (not_global_escape(alloc)) {
|
|
||||||
MemBarNode* mb = MemBarNode::make(C, Op_MemBarCPUOrder, Compile::AliasIdxBot);
|
MemBarNode* mb = MemBarNode::make(C, Op_MemBarCPUOrder, Compile::AliasIdxBot);
|
||||||
mb->init_req(TypeFunc::Memory, storestore->in(TypeFunc::Memory));
|
mb->init_req(TypeFunc::Memory, storestore->in(TypeFunc::Memory));
|
||||||
mb->init_req(TypeFunc::Control, storestore->in(TypeFunc::Control));
|
mb->init_req(TypeFunc::Control, storestore->in(TypeFunc::Control));
|
||||||
@ -2251,11 +2247,29 @@ bool FieldNode::has_base(JavaObjectNode* jobj) const {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool ConnectionGraph::is_captured_store_address(Node* addp) {
|
||||||
|
// Handle simple case first.
|
||||||
|
assert(_igvn->type(addp)->isa_oopptr() == NULL, "should be raw access");
|
||||||
|
if (addp->in(AddPNode::Address)->is_Proj() && addp->in(AddPNode::Address)->in(0)->is_Allocate()) {
|
||||||
|
return true;
|
||||||
|
} else if (addp->in(AddPNode::Address)->is_Phi()) {
|
||||||
|
for (DUIterator_Fast imax, i = addp->fast_outs(imax); i < imax; i++) {
|
||||||
|
Node* addp_use = addp->fast_out(i);
|
||||||
|
if (addp_use->is_Store()) {
|
||||||
|
for (DUIterator_Fast jmax, j = addp_use->fast_outs(jmax); j < jmax; j++) {
|
||||||
|
if (addp_use->fast_out(j)->is_Initialize()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int ConnectionGraph::address_offset(Node* adr, PhaseTransform *phase) {
|
int ConnectionGraph::address_offset(Node* adr, PhaseTransform *phase) {
|
||||||
const Type *adr_type = phase->type(adr);
|
const Type *adr_type = phase->type(adr);
|
||||||
if (adr->is_AddP() && adr_type->isa_oopptr() == NULL &&
|
if (adr->is_AddP() && adr_type->isa_oopptr() == NULL && is_captured_store_address(adr)) {
|
||||||
adr->in(AddPNode::Address)->is_Proj() &&
|
|
||||||
adr->in(AddPNode::Address)->in(0)->is_Allocate()) {
|
|
||||||
// We are computing a raw address for a store captured by an Initialize
|
// We are computing a raw address for a store captured by an Initialize
|
||||||
// compute an appropriate address type. AddP cases #3 and #5 (see below).
|
// compute an appropriate address type. AddP cases #3 and #5 (see below).
|
||||||
int offs = (int)phase->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot);
|
int offs = (int)phase->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot);
|
||||||
@ -2358,7 +2372,7 @@ Node* ConnectionGraph::get_addp_base(Node *addp) {
|
|||||||
assert(opcode == Op_ConP || opcode == Op_ThreadLocal ||
|
assert(opcode == Op_ConP || opcode == Op_ThreadLocal ||
|
||||||
opcode == Op_CastX2P || uncast_base->is_DecodeNarrowPtr() ||
|
opcode == Op_CastX2P || uncast_base->is_DecodeNarrowPtr() ||
|
||||||
(uncast_base->is_Mem() && (uncast_base->bottom_type()->isa_rawptr() != NULL)) ||
|
(uncast_base->is_Mem() && (uncast_base->bottom_type()->isa_rawptr() != NULL)) ||
|
||||||
(uncast_base->is_Proj() && uncast_base->in(0)->is_Allocate()), "sanity");
|
is_captured_store_address(addp), "sanity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return base;
|
return base;
|
||||||
@ -2974,7 +2988,10 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!n->is_CheckCastPP()) { // not unique CheckCastPP.
|
if (!n->is_CheckCastPP()) { // not unique CheckCastPP.
|
||||||
assert(!alloc->is_Allocate(), "allocation should have unique type");
|
// we could reach here for allocate case if one init is associated with many allocs.
|
||||||
|
if (alloc->is_Allocate()) {
|
||||||
|
alloc->as_Allocate()->_is_scalar_replaceable = false;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -512,6 +512,7 @@ private:
|
|||||||
// offset of a field reference
|
// offset of a field reference
|
||||||
int address_offset(Node* adr, PhaseTransform *phase);
|
int address_offset(Node* adr, PhaseTransform *phase);
|
||||||
|
|
||||||
|
bool is_captured_store_address(Node* addp);
|
||||||
|
|
||||||
// Propagate unique types created for unescaped allocated objects
|
// Propagate unique types created for unescaped allocated objects
|
||||||
// through the graph
|
// through the graph
|
||||||
|
@ -75,13 +75,34 @@ public final class PlatformEventType extends Type {
|
|||||||
this.stackTraceOffset = stackTraceOffset(name, isJDK);
|
this.stackTraceOffset = stackTraceOffset(name, isJDK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isExceptionEvent(String name) {
|
||||||
|
switch (name) {
|
||||||
|
case Type.EVENT_NAME_PREFIX + "JavaErrorThrow" :
|
||||||
|
case Type.EVENT_NAME_PREFIX + "JavaExceptionThrow" :
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isUsingHandler(String name) {
|
||||||
|
switch (name) {
|
||||||
|
case Type.EVENT_NAME_PREFIX + "SocketRead" :
|
||||||
|
case Type.EVENT_NAME_PREFIX + "SocketWrite" :
|
||||||
|
case Type.EVENT_NAME_PREFIX + "FileRead" :
|
||||||
|
case Type.EVENT_NAME_PREFIX + "FileWrite" :
|
||||||
|
case Type.EVENT_NAME_PREFIX + "FileForce" :
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private static int stackTraceOffset(String name, boolean isJDK) {
|
private static int stackTraceOffset(String name, boolean isJDK) {
|
||||||
if (isJDK) {
|
if (isJDK) {
|
||||||
if (name.equals(Type.EVENT_NAME_PREFIX + "JavaExceptionThrow")) {
|
if (isExceptionEvent(name)) {
|
||||||
return 5;
|
return 4;
|
||||||
}
|
}
|
||||||
if (name.equals(Type.EVENT_NAME_PREFIX + "JavaErrorThrow")) {
|
if (isUsingHandler(name)) {
|
||||||
return 5;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 4;
|
return 4;
|
||||||
|
@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8242895
|
||||||
|
* @summary full loop unroll before EA creates phis between allocs projs and init
|
||||||
|
* @run main/othervm -Xbatch -XX:CompileCommand=dontinline,*DataA.m1 compiler.escapeAnalysis.TestIdealAllocShape
|
||||||
|
*/
|
||||||
|
|
||||||
|
package compiler.escapeAnalysis;
|
||||||
|
|
||||||
|
public class TestIdealAllocShape {
|
||||||
|
static volatile DataA f1;
|
||||||
|
|
||||||
|
static class DataA {
|
||||||
|
DataA f1;
|
||||||
|
DataA(DataA p1) {
|
||||||
|
this.f1 = p1;
|
||||||
|
}
|
||||||
|
public void m1() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataA test1() {
|
||||||
|
DataA l1 = new DataA(null);
|
||||||
|
for (int i=0; i<2; i++) {
|
||||||
|
try {
|
||||||
|
return new DataA(l1); // l1 is a GlobalEscape. // control break.
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataA test2() {
|
||||||
|
DataA l1 = new DataA(null);
|
||||||
|
for (int i=0; i<2; i++) {
|
||||||
|
try {
|
||||||
|
f1 = new DataA(l1); // l1 is a GlobalEscape.
|
||||||
|
break; // control break.
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
synchronized(l1) { // elided sync
|
||||||
|
l1.m1();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String argv[]) {
|
||||||
|
|
||||||
|
for (int i=0; i<20000; i++) {
|
||||||
|
TestIdealAllocShape.test1();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<20000; i++) {
|
||||||
|
TestIdealAllocShape.test2();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -570,6 +570,7 @@ java/foreign/TestMismatch.java 8249684 macosx-all
|
|||||||
java/lang/StringCoding/CheckEncodings.sh 7008363 generic-all
|
java/lang/StringCoding/CheckEncodings.sh 7008363 generic-all
|
||||||
java/lang/ProcessHandle/InfoTest.java 8211847 aix-ppc64
|
java/lang/ProcessHandle/InfoTest.java 8211847 aix-ppc64
|
||||||
java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java 8151492 generic-all
|
java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java 8151492 generic-all
|
||||||
|
java/lang/invoke/LFCaching/LFGarbageCollectedTest.java 8078602 generic-all
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
@ -588,6 +589,7 @@ javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-al
|
|||||||
# jdk_io
|
# jdk_io
|
||||||
|
|
||||||
java/io/pathNames/GeneralWin32.java 8180264 windows-all
|
java/io/pathNames/GeneralWin32.java 8180264 windows-all
|
||||||
|
java/io/File/GetXSpace.java 6501010,8249703 windows-all,macosx-all
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @bug 4057701 6286712 6364377
|
* @bug 4057701 6286712 6364377
|
||||||
* @ignore until 6492634 and 6501010 is fixed
|
|
||||||
* @run build GetXSpace
|
* @run build GetXSpace
|
||||||
* @run shell GetXSpace.sh
|
* @run shell GetXSpace.sh
|
||||||
* @summary Basic functionality of File.get-X-Space methods.
|
* @summary Basic functionality of File.get-X-Space methods.
|
||||||
@ -135,7 +134,7 @@ public class GetXSpace {
|
|||||||
ArrayList al = new ArrayList();
|
ArrayList al = new ArrayList();
|
||||||
|
|
||||||
Process p = null;
|
Process p = null;
|
||||||
String cmd = "df -k" + (f == null ? "" : " " + f);
|
String cmd = "df -k -P" + (f == null ? "" : " " + f);
|
||||||
p = Runtime.getRuntime().exec(cmd);
|
p = Runtime.getRuntime().exec(cmd);
|
||||||
BufferedReader in = new BufferedReader
|
BufferedReader in = new BufferedReader
|
||||||
(new InputStreamReader(p.getInputStream()));
|
(new InputStreamReader(p.getInputStream()));
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# set platform-dependent variable
|
# set platform-dependent variable
|
||||||
OS=`uname -s`
|
OS=`uname -s`
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
Linux ) TMP=/tmp ;;
|
Linux | Darwin ) TMP=/tmp ;;
|
||||||
Windows_98 ) return ;;
|
Windows_98 ) return ;;
|
||||||
Windows* ) SID=`sid`; TMP="c:/temp" ;;
|
Windows* ) SID=`sid`; TMP="c:/temp" ;;
|
||||||
* )
|
* )
|
||||||
@ -66,7 +66,7 @@ runTest() {
|
|||||||
runTest
|
runTest
|
||||||
|
|
||||||
# readable file in an unreadable directory
|
# readable file in an unreadable directory
|
||||||
mkdir ${TMP1}
|
mkdir -p ${TMP1}
|
||||||
touch ${TMP1}/foo
|
touch ${TMP1}/foo
|
||||||
deny ${TMP1}
|
deny ${TMP1}
|
||||||
runTest ${TMP1}/foo
|
runTest ${TMP1}/foo
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,7 +26,6 @@
|
|||||||
* @bug 8046703
|
* @bug 8046703
|
||||||
* @key randomness
|
* @key randomness
|
||||||
* @library /lib/testlibrary /java/lang/invoke/common
|
* @library /lib/testlibrary /java/lang/invoke/common
|
||||||
* @ignore 8078602
|
|
||||||
* @summary Test verifies that lambda forms are garbage collected
|
* @summary Test verifies that lambda forms are garbage collected
|
||||||
* @author kshefov
|
* @author kshefov
|
||||||
* @build jdk.test.lib.TimeLimitedRunner
|
* @build jdk.test.lib.TimeLimitedRunner
|
||||||
|
Loading…
x
Reference in New Issue
Block a user