Skip to content

Commit a3b1c6b

Browse files
committed
Merge
2 parents 9df200f + 04ad668 commit a3b1c6b

File tree

17 files changed

+173
-158
lines changed

17 files changed

+173
-158
lines changed

make/modules/java.rmi/Launcher.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ include LauncherCommon.gmk
2727

2828
$(eval $(call SetupBuildLauncher, rmiregistry, \
2929
MAIN_CLASS := sun.rmi.registry.RegistryImpl, \
30+
JAVA_ARGS := -Djava.security.manager=allow, \
3031
))

src/hotspot/cpu/x86/x86.ad

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,16 @@ const bool Matcher::match_rule_supported(int opcode) {
16011601
return false;
16021602
}
16031603
break;
1604+
case Op_SqrtF:
1605+
if (UseSSE < 1) {
1606+
return false;
1607+
}
1608+
break;
1609+
case Op_SqrtD:
1610+
if (UseSSE < 2) {
1611+
return false;
1612+
}
1613+
break;
16041614
}
16051615
return true; // Match rules are supported by default.
16061616
}

src/hotspot/share/code/codeCache.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ void CodeCache::nmethods_do(void f(nmethod* nm)) {
678678

679679
void CodeCache::metadata_do(MetadataClosure* f) {
680680
assert_locked_or_safepoint(CodeCache_lock);
681-
NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading);
681+
NMethodIterator iter(NMethodIterator::only_alive);
682682
while(iter.next()) {
683683
iter.method()->metadata_do(f);
684684
}
@@ -1032,7 +1032,7 @@ CompiledMethod* CodeCache::find_compiled(void* start) {
10321032
}
10331033

10341034
#if INCLUDE_JVMTI
1035-
// RedefineClasses support for unloading nmethods that are dependent on "old" methods.
1035+
// RedefineClasses support for saving nmethods that are dependent on "old" methods.
10361036
// We don't really expect this table to grow very large. If it does, it can become a hashtable.
10371037
static GrowableArray<CompiledMethod*>* old_compiled_method_table = NULL;
10381038

@@ -1085,7 +1085,7 @@ int CodeCache::mark_dependents_for_evol_deoptimization() {
10851085
reset_old_method_table();
10861086

10871087
int number_of_marked_CodeBlobs = 0;
1088-
CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading);
1088+
CompiledMethodIterator iter(CompiledMethodIterator::only_alive);
10891089
while(iter.next()) {
10901090
CompiledMethod* nm = iter.method();
10911091
// Walk all alive nmethods to check for old Methods.
@@ -1105,7 +1105,7 @@ int CodeCache::mark_dependents_for_evol_deoptimization() {
11051105

11061106
void CodeCache::mark_all_nmethods_for_evol_deoptimization() {
11071107
assert(SafepointSynchronize::is_at_safepoint(), "Can only do this at a safepoint!");
1108-
CompiledMethodIterator iter(CompiledMethodIterator::only_alive_and_not_unloading);
1108+
CompiledMethodIterator iter(CompiledMethodIterator::only_alive);
11091109
while(iter.next()) {
11101110
CompiledMethod* nm = iter.method();
11111111
if (!nm->method()->is_method_handle_intrinsic()) {

src/hotspot/share/jfr/recorder/repository/jfrChunk.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ static jlong nanos_now() {
4747
const jlong now = seconds * 1000000000 + nanos;
4848
if (now > last) {
4949
last = now;
50+
} else {
51+
++last;
5052
}
5153
return last;
5254
}

src/hotspot/share/opto/callnode.cpp

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,6 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
16561656
init_req( KlassNode , klass_node);
16571657
init_req( InitialTest , initial_test);
16581658
init_req( ALength , topnode);
1659-
init_req( ValidLengthTest , topnode);
16601659
C->add_macro_node(this);
16611660
}
16621661

@@ -1683,6 +1682,54 @@ Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, N
16831682
return mark_node;
16841683
}
16851684

1685+
//=============================================================================
1686+
Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1687+
if (remove_dead_region(phase, can_reshape)) return this;
1688+
// Don't bother trying to transform a dead node
1689+
if (in(0) && in(0)->is_top()) return NULL;
1690+
1691+
const Type* type = phase->type(Ideal_length());
1692+
if (type->isa_int() && type->is_int()->_hi < 0) {
1693+
if (can_reshape) {
1694+
PhaseIterGVN *igvn = phase->is_IterGVN();
1695+
// Unreachable fall through path (negative array length),
1696+
// the allocation can only throw so disconnect it.
1697+
Node* proj = proj_out_or_null(TypeFunc::Control);
1698+
Node* catchproj = NULL;
1699+
if (proj != NULL) {
1700+
for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
1701+
Node *cn = proj->fast_out(i);
1702+
if (cn->is_Catch()) {
1703+
catchproj = cn->as_Multi()->proj_out_or_null(CatchProjNode::fall_through_index);
1704+
break;
1705+
}
1706+
}
1707+
}
1708+
if (catchproj != NULL && catchproj->outcnt() > 0 &&
1709+
(catchproj->outcnt() > 1 ||
1710+
catchproj->unique_out()->Opcode() != Op_Halt)) {
1711+
assert(catchproj->is_CatchProj(), "must be a CatchProjNode");
1712+
Node* nproj = catchproj->clone();
1713+
igvn->register_new_node_with_optimizer(nproj);
1714+
1715+
Node *frame = new ParmNode( phase->C->start(), TypeFunc::FramePtr );
1716+
frame = phase->transform(frame);
1717+
// Halt & Catch Fire
1718+
Node* halt = new HaltNode(nproj, frame, "unexpected negative array length");
1719+
phase->C->root()->add_req(halt);
1720+
phase->transform(halt);
1721+
1722+
igvn->replace_node(catchproj, phase->C->top());
1723+
return this;
1724+
}
1725+
} else {
1726+
// Can't correct it during regular GVN so register for IGVN
1727+
phase->C->record_for_igvn(this);
1728+
}
1729+
}
1730+
return NULL;
1731+
}
1732+
16861733
// Retrieve the length from the AllocateArrayNode. Narrow the type with a
16871734
// CastII, if appropriate. If we are not allowed to create new nodes, and
16881735
// a CastII is appropriate, return NULL.

src/hotspot/share/opto/callnode.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,6 @@ class AllocateNode : public CallNode {
913913
KlassNode, // type (maybe dynamic) of the obj.
914914
InitialTest, // slow-path test (may be constant)
915915
ALength, // array length (or TOP if none)
916-
ValidLengthTest,
917916
ParmLimit
918917
};
919918

@@ -923,7 +922,6 @@ class AllocateNode : public CallNode {
923922
fields[KlassNode] = TypeInstPtr::NOTNULL;
924923
fields[InitialTest] = TypeInt::BOOL;
925924
fields[ALength] = t; // length (can be a bad length)
926-
fields[ValidLengthTest] = TypeInt::BOOL;
927925

928926
const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
929927

@@ -1018,16 +1016,18 @@ class AllocateNode : public CallNode {
10181016
//
10191017
class AllocateArrayNode : public AllocateNode {
10201018
public:
1021-
AllocateArrayNode(Compile* C, const TypeFunc* atype, Node* ctrl, Node* mem, Node* abio, Node* size, Node* klass_node,
1022-
Node* initial_test, Node* count_val, Node* valid_length_test)
1019+
AllocateArrayNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
1020+
Node* size, Node* klass_node, Node* initial_test,
1021+
Node* count_val
1022+
)
10231023
: AllocateNode(C, atype, ctrl, mem, abio, size, klass_node,
10241024
initial_test)
10251025
{
10261026
init_class_id(Class_AllocateArray);
10271027
set_req(AllocateNode::ALength, count_val);
1028-
set_req(AllocateNode::ValidLengthTest, valid_length_test);
10291028
}
10301029
virtual int Opcode() const;
1030+
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
10311031

10321032
// Dig the length operand out of a array allocation site.
10331033
Node* Ideal_length() {

src/hotspot/share/opto/cfgnode.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,20 +2687,6 @@ const Type* CatchNode::Value(PhaseGVN* phase) const {
26872687
// Rethrows always throw exceptions, never return
26882688
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
26892689
f[CatchProjNode::fall_through_index] = Type::TOP;
2690-
} else if (call->is_AllocateArray()) {
2691-
Node* klass_node = call->in(AllocateNode::KlassNode);
2692-
Node *length = call->in(AllocateNode::ALength);
2693-
const Type* length_type = phase->type(length);
2694-
const Type* klass_type = phase->type(klass_node);
2695-
if (length_type == Type::TOP || klass_type == Type::TOP) {
2696-
f[CatchProjNode::fall_through_index] = Type::TOP;
2697-
} else {
2698-
Node* valid_length_test = call->in(AllocateNode::ValidLengthTest);
2699-
const Type* valid_length_test_t = phase->type(valid_length_test);
2700-
if (valid_length_test_t->isa_int() && valid_length_test_t->is_int()->is_con(0)) {
2701-
f[CatchProjNode::fall_through_index] = Type::TOP;
2702-
}
2703-
}
27042690
} else if( call->req() > TypeFunc::Parms ) {
27052691
const Type *arg0 = phase->type( call->in(TypeFunc::Parms) );
27062692
// Check for null receiver to virtual or interface calls

src/hotspot/share/opto/compile.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3758,7 +3758,7 @@ bool Compile::final_graph_reshaping() {
37583758
// 'fall-thru' path, so expected kids is 1 less.
37593759
if (n->is_PCTable() && n->in(0) && n->in(0)->in(0)) {
37603760
if (n->in(0)->in(0)->is_Call()) {
3761-
CallNode* call = n->in(0)->in(0)->as_Call();
3761+
CallNode *call = n->in(0)->in(0)->as_Call();
37623762
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
37633763
required_outcnt--; // Rethrow always has 1 less kid
37643764
} else if (call->req() > TypeFunc::Parms &&
@@ -3767,25 +3767,22 @@ bool Compile::final_graph_reshaping() {
37673767
// detected that the virtual call will always result in a null
37683768
// pointer exception. The fall-through projection of this CatchNode
37693769
// will not be populated.
3770-
Node* arg0 = call->in(TypeFunc::Parms);
3770+
Node *arg0 = call->in(TypeFunc::Parms);
37713771
if (arg0->is_Type() &&
37723772
arg0->as_Type()->type()->higher_equal(TypePtr::NULL_PTR)) {
37733773
required_outcnt--;
37743774
}
3775-
} else if (call->entry_point() == OptoRuntime::new_array_Java() ||
3776-
call->entry_point() == OptoRuntime::new_array_nozero_Java()) {
3775+
} else if (call->entry_point() == OptoRuntime::new_array_Java() &&
3776+
call->req() > TypeFunc::Parms+1 &&
3777+
call->is_CallStaticJava()) {
37773778
// Check for negative array length. In such case, the optimizer has
37783779
// detected that the allocation attempt will always result in an
37793780
// exception. There is no fall-through projection of this CatchNode .
3780-
assert(call->is_CallStaticJava(), "static call expected");
3781-
assert(call->len() > call->req() && call->in(call->req()) != NULL, "no precendent edge");
3782-
Node* valid_length_test = call->in(call->req());
3783-
call->rm_prec(call->req());
3784-
if (valid_length_test->find_int_con(1) == 0) {
3781+
Node *arg1 = call->in(TypeFunc::Parms+1);
3782+
if (arg1->is_Type() &&
3783+
arg1->as_Type()->type()->join(TypeInt::POS)->empty()) {
37853784
required_outcnt--;
37863785
}
3787-
assert(n->outcnt() == required_outcnt, "malformed control flow");
3788-
continue;
37893786
}
37903787
}
37913788
}
@@ -3794,13 +3791,6 @@ bool Compile::final_graph_reshaping() {
37943791
record_method_not_compilable("malformed control flow");
37953792
return true; // Not all targets reachable!
37963793
}
3797-
} else if (n->is_PCTable() && n->in(0) && n->in(0)->in(0) && n->in(0)->in(0)->is_Call()) {
3798-
CallNode* call = n->in(0)->in(0)->as_Call();
3799-
if (call->entry_point() == OptoRuntime::new_array_Java() ||
3800-
call->entry_point() == OptoRuntime::new_array_nozero_Java()) {
3801-
assert(call->len() > call->req() && call->in(call->req()) != NULL, "precedent edge expected");
3802-
call->rm_prec(call->req());
3803-
}
38043794
}
38053795
// Check that I actually visited all kids. Unreached kids
38063796
// must be infinite loops.

src/hotspot/share/opto/graphKit.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,9 +2742,7 @@ void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool sep
27422742
// Make a catch node with just two handlers: fall-through and catch-all
27432743
Node* i_o = _gvn.transform( new ProjNode(call, TypeFunc::I_O, separate_io_proj) );
27442744
Node* catc = _gvn.transform( new CatchNode(control(), i_o, 2) );
2745-
Node* norm = new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci);
2746-
_gvn.set_type_bottom(norm);
2747-
C->record_for_igvn(norm);
2745+
Node* norm = _gvn.transform( new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci) );
27482746
Node* excp = _gvn.transform( new CatchProjNode(catc, CatchProjNode::catch_all_index, CatchProjNode::no_handler_bci) );
27492747

27502748
{ PreserveJVMState pjvms(this);
@@ -3985,28 +3983,20 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
39853983
initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn);
39863984
}
39873985

3988-
const TypeOopPtr* ary_type = _gvn.type(klass_node)->is_klassptr()->as_instance_type();
3989-
Node* valid_length_test = C->top();
3990-
if (ary_type->klass()->is_array_klass()) {
3991-
BasicType bt = ary_type->klass()->as_array_klass()->element_type()->basic_type();
3992-
jint max = TypeAryPtr::max_array_length(bt);
3993-
Node* valid_length_cmp = _gvn.transform(new CmpUNode(length, intcon(max)));
3994-
valid_length_test = _gvn.transform(new BoolNode(valid_length_cmp, BoolTest::le));
3995-
}
3996-
39973986
// Create the AllocateArrayNode and its result projections
39983987
AllocateArrayNode* alloc
39993988
= new AllocateArrayNode(C, AllocateArrayNode::alloc_type(TypeInt::INT),
40003989
control(), mem, i_o(),
40013990
size, klass_node,
40023991
initial_slow_test,
4003-
length, valid_length_test);
3992+
length);
40043993

40053994
// Cast to correct type. Note that the klass_node may be constant or not,
40063995
// and in the latter case the actual array type will be inexact also.
40073996
// (This happens via a non-constant argument to inline_native_newArray.)
40083997
// In any case, the value of klass_node provides the desired array type.
40093998
const TypeInt* length_type = _gvn.find_int_type(length);
3999+
const TypeOopPtr* ary_type = _gvn.type(klass_node)->is_klassptr()->as_instance_type();
40104000
if (ary_type->isa_aryptr() && length_type != NULL) {
40114001
// Try to get a better type than POS for the size
40124002
ary_type = ary_type->is_aryptr()->cast_to_size(length_type);

src/hotspot/share/opto/macro.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,7 @@ void PhaseMacroExpand::expand_allocate_common(
12081208
AllocateNode* alloc, // allocation node to be expanded
12091209
Node* length, // array length for an array allocation
12101210
const TypeFunc* slow_call_type, // Type of slow call
1211-
address slow_call_address, // Address of slow call
1212-
Node* valid_length_test // whether length is valid or not
1211+
address slow_call_address // Address of slow call
12131212
)
12141213
{
12151214
Node* ctrl = alloc->in(TypeFunc::Control);
@@ -1394,9 +1393,6 @@ void PhaseMacroExpand::expand_allocate_common(
13941393
// Copy debug information and adjust JVMState information, then replace
13951394
// allocate node with the call
13961395
call->copy_call_debug_info(&_igvn, alloc);
1397-
if (valid_length_test != NULL) {
1398-
call->add_prec(valid_length_test);
1399-
}
14001396
if (expand_fast_path) {
14011397
call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON.
14021398
} else {
@@ -1879,12 +1875,11 @@ Node* PhaseMacroExpand::prefetch_allocation(Node* i_o, Node*& needgc_false,
18791875
void PhaseMacroExpand::expand_allocate(AllocateNode *alloc) {
18801876
expand_allocate_common(alloc, NULL,
18811877
OptoRuntime::new_instance_Type(),
1882-
OptoRuntime::new_instance_Java(), NULL);
1878+
OptoRuntime::new_instance_Java());
18831879
}
18841880

18851881
void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
18861882
Node* length = alloc->in(AllocateNode::ALength);
1887-
Node* valid_length_test = alloc->in(AllocateNode::ValidLengthTest);
18881883
InitializeNode* init = alloc->initialization();
18891884
Node* klass_node = alloc->in(AllocateNode::KlassNode);
18901885
ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass();
@@ -1899,7 +1894,7 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
18991894
}
19001895
expand_allocate_common(alloc, length,
19011896
OptoRuntime::new_array_Type(),
1902-
slow_call_address, valid_length_test);
1897+
slow_call_address);
19031898
}
19041899

19051900
//-------------------mark_eliminated_box----------------------------------

0 commit comments

Comments
 (0)