Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Jun 18, 2021
2 parents be54b14 + a051e73 commit 7f7e99b
Show file tree
Hide file tree
Showing 26 changed files with 461 additions and 437 deletions.
45 changes: 44 additions & 1 deletion src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
Expand Down Expand Up @@ -27,6 +27,7 @@
#include "asm/assembler.inline.hpp"
#include "opto/c2_MacroAssembler.hpp"
#include "opto/intrinsicnode.hpp"
#include "opto/subnode.hpp"
#include "runtime/stubRoutines.hpp"

#ifdef PRODUCT
Expand Down Expand Up @@ -832,3 +833,45 @@ void C2_MacroAssembler::string_compare(Register str1, Register str2,

BLOCK_COMMENT("} string_compare");
}

void C2_MacroAssembler::neon_compare(FloatRegister dst, BasicType bt, FloatRegister src1,
FloatRegister src2, int cond, bool isQ) {
SIMD_Arrangement size = esize2arrangement(type2aelembytes(bt), isQ);
if (bt == T_FLOAT || bt == T_DOUBLE) {
switch (cond) {
case BoolTest::eq: fcmeq(dst, size, src1, src2); break;
case BoolTest::ne: {
fcmeq(dst, size, src1, src2);
notr(dst, T16B, dst);
break;
}
case BoolTest::ge: fcmge(dst, size, src1, src2); break;
case BoolTest::gt: fcmgt(dst, size, src1, src2); break;
case BoolTest::le: fcmge(dst, size, src2, src1); break;
case BoolTest::lt: fcmgt(dst, size, src2, src1); break;
default:
assert(false, "unsupported");
ShouldNotReachHere();
}
} else {
switch (cond) {
case BoolTest::eq: cmeq(dst, size, src1, src2); break;
case BoolTest::ne: {
cmeq(dst, size, src1, src2);
notr(dst, T16B, dst);
break;
}
case BoolTest::ge: cmge(dst, size, src1, src2); break;
case BoolTest::gt: cmgt(dst, size, src1, src2); break;
case BoolTest::le: cmge(dst, size, src2, src1); break;
case BoolTest::lt: cmgt(dst, size, src2, src1); break;
case BoolTest::uge: cmhs(dst, size, src1, src2); break;
case BoolTest::ugt: cmhi(dst, size, src1, src2); break;
case BoolTest::ult: cmhi(dst, size, src2, src1); break;
case BoolTest::ule: cmhs(dst, size, src2, src1); break;
default:
assert(false, "unsupported");
ShouldNotReachHere();
}
}
}
6 changes: 5 additions & 1 deletion src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
Expand Down Expand Up @@ -49,4 +49,8 @@
Register ch, Register result,
Register tmp1, Register tmp2, Register tmp3);

// SIMD&FP comparison
void neon_compare(FloatRegister dst, BasicType bt, FloatRegister src1,
FloatRegister src2, int cond, bool isQ);

#endif // CPU_AARCH64_C2_MACROASSEMBLER_AARCH64_HPP
43 changes: 0 additions & 43 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5339,49 +5339,6 @@ void MacroAssembler::safepoint_isb() {
#endif
}

void MacroAssembler::neon_compare(FloatRegister dst, BasicType bt, FloatRegister src1,
FloatRegister src2, int cond, bool isQ) {
SIMD_Arrangement size = esize2arrangement(type2aelembytes(bt), isQ);
if (bt == T_FLOAT || bt == T_DOUBLE) {
switch (cond) {
case BoolTest::eq: fcmeq(dst, size, src1, src2); break;
case BoolTest::ne: {
fcmeq(dst, size, src1, src2);
notr(dst, T16B, dst);
break;
}
case BoolTest::ge: fcmge(dst, size, src1, src2); break;
case BoolTest::gt: fcmgt(dst, size, src1, src2); break;
case BoolTest::le: fcmge(dst, size, src2, src1); break;
case BoolTest::lt: fcmgt(dst, size, src2, src1); break;
default:
assert(false, "unsupported");
ShouldNotReachHere();
}
} else {
switch (cond) {
case BoolTest::eq: cmeq(dst, size, src1, src2); break;
case BoolTest::ne: {
cmeq(dst, size, src1, src2);
notr(dst, T16B, dst);
break;
}
case BoolTest::ge: cmge(dst, size, src1, src2); break;
case BoolTest::gt: cmgt(dst, size, src1, src2); break;
case BoolTest::le: cmge(dst, size, src2, src1); break;
case BoolTest::lt: cmgt(dst, size, src2, src1); break;
case BoolTest::uge: cmhs(dst, size, src1, src2); break;
case BoolTest::ugt: cmhi(dst, size, src1, src2); break;
case BoolTest::ult: cmhi(dst, size, src2, src1); break;
case BoolTest::ule: cmhs(dst, size, src2, src1); break;
default:
assert(false, "unsupported");
ShouldNotReachHere();
}
}
}


#ifndef PRODUCT
void MacroAssembler::verify_cross_modify_fence_not_required() {
if (VerifyCrossModifyFence) {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,6 @@ class MacroAssembler: public Assembler {
bool acquire, bool release, bool weak,
Register result);

// SIMD&FP comparison
void neon_compare(FloatRegister dst, BasicType bt, FloatRegister src1, FloatRegister src2, int cond, bool isQ);
private:
void compare_eq(Register rn, Register rm, enum operand_size size);

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/universalUpcallHandler_x86_64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
Expand Down Expand Up @@ -585,7 +585,7 @@ address ProgrammableUpcallHandler::generate_optimized_upcall_stub(jobject receiv
const ABIDescriptor abi = ForeignGlobals::parse_abi_descriptor(jabi);
const CallRegs conv = ForeignGlobals::parse_call_regs(jconv);
assert(conv._rets_length <= 1, "no multi reg returns");
CodeBuffer buffer("upcall_stub_linkToNative", /* code_size = */ 1024, /* locs_size = */ 1024);
CodeBuffer buffer("upcall_stub_linkToNative", /* code_size = */ 2048, /* locs_size = */ 1024);

int register_size = sizeof(uintptr_t);
int buffer_alignment = xmm_reg_size;
Expand Down
27 changes: 26 additions & 1 deletion src/hotspot/share/gc/parallel/spaceCounters.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2021, 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
Expand All @@ -26,6 +26,10 @@
#include "gc/parallel/spaceCounters.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/atomic.hpp"
#include "runtime/mutex.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/debug.hpp"
#include "utilities/macros.hpp"

SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,
Expand Down Expand Up @@ -68,3 +72,24 @@ SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,
SpaceCounters::~SpaceCounters() {
FREE_C_HEAP_ARRAY(char, _name_space);
}

static volatile size_t last_used_in_bytes = 0;

void SpaceCounters::update_used() {
size_t new_used = _object_space->used_in_bytes();
Atomic::store(&last_used_in_bytes, new_used);
_used->set_value(new_used);
}

jlong MutableSpaceUsedHelper::take_sample() {
// Sampling may occur during GC, possibly while GC is updating the space.
// The space can be in an inconsistent state during such an update. We
// don't want to block sampling for the duration of a GC. Instead, skip
// sampling in that case, using the last recorded value.
assert(!Heap_lock->owned_by_self(), "precondition");
if (Heap_lock->try_lock()) {
Atomic::store(&last_used_in_bytes, _m->used_in_bytes());
Heap_lock->unlock();
}
return Atomic::load(&last_used_in_bytes);
}
8 changes: 2 additions & 6 deletions src/hotspot/share/gc/parallel/spaceCounters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ class SpaceCounters: public CHeapObj<mtGC> {
_capacity->set_value(_object_space->capacity_in_bytes());
}

inline void update_used() {
_used->set_value(_object_space->used_in_bytes());
}
void update_used();

inline void update_all() {
update_used();
Expand All @@ -77,9 +75,7 @@ class MutableSpaceUsedHelper: public PerfLongSampleHelper {
public:
MutableSpaceUsedHelper(MutableSpace* m) : _m(m) { }

inline jlong take_sample() {
return _m->used_in_bytes();
}
jlong take_sample() override;
};

#endif // SHARE_GC_PARALLEL_SPACECOUNTERS_HPP
17 changes: 15 additions & 2 deletions src/hotspot/share/gc/serial/cSpaceCounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ void CSpaceCounters::update_capacity() {
_capacity->set_value(_space->capacity());
}

static volatile size_t last_used_in_bytes = 0;

void CSpaceCounters::update_used() {
_used->set_value(_space->used());
size_t new_used = _space->used();
Atomic::store(&last_used_in_bytes, new_used);
_used->set_value(new_used);
}

void CSpaceCounters::update_all() {
Expand All @@ -82,5 +86,14 @@ void CSpaceCounters::update_all() {
}

jlong ContiguousSpaceUsedHelper::take_sample(){
return _space->used();
// Sampling may occur during GC, possibly while GC is updating the space.
// The space can be in an inconsistent state during such an update. We
// don't want to block sampling for the duration of a GC. Instead, skip
// sampling in that case, using the last recorded value.
assert(!Heap_lock->owned_by_self(), "precondition");
if (Heap_lock->try_lock()) {
Atomic::store(&last_used_in_bytes, _space->used());
Heap_lock->unlock();
}
return Atomic::load(&last_used_in_bytes);
}
10 changes: 5 additions & 5 deletions src/hotspot/share/gc/serial/cSpaceCounters.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2021, 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
Expand Down Expand Up @@ -54,9 +54,9 @@ class CSpaceCounters: public CHeapObj<mtGC> {

~CSpaceCounters();

virtual void update_capacity();
virtual void update_used();
virtual void update_all();
void update_capacity();
void update_used();
void update_all();

const char* name_space() const { return _name_space; }
};
Expand All @@ -68,7 +68,7 @@ class ContiguousSpaceUsedHelper : public PerfLongSampleHelper {
public:
ContiguousSpaceUsedHelper(ContiguousSpace* space) : _space(space) { }

jlong take_sample();
jlong take_sample() override;
};

#endif // SHARE_GC_SERIAL_CSPACECOUNTERS_HPP
10 changes: 8 additions & 2 deletions src/hotspot/share/opto/arraycopynode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int c

if (!inst_src->klass_is_exact()) {
ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
assert(!ik->is_interface() && !ik->has_subklass(), "inconsistent klass hierarchy");
phase->C->dependencies()->assert_leaf_type(ik);
assert(!ik->is_interface(), "inconsistent klass hierarchy");
if (ik->has_subklass()) {
// Concurrent class loading.
// Fail fast and return NodeSentinel to indicate that the transform failed.
return NodeSentinel;
} else {
phase->C->dependencies()->assert_leaf_type(ik);
}
}

ciInstanceKlass* ik = inst_src->klass()->as_instance_klass();
Expand Down
47 changes: 29 additions & 18 deletions src/hotspot/share/opto/graphKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2946,7 +2946,6 @@ Node* GraphKit::gen_subtype_check(Node* obj_or_subklass, Node* superklass) {
return n;
}

const TypePtr* adr_type = TypeKlassPtr::make(TypePtr::NotNull, C->env()->Object_klass(), Type::OffsetBot);
Node* check = _gvn.transform(new SubTypeCheckNode(C, obj_or_subklass, superklass));
Node* bol = _gvn.transform(new BoolNode(check, BoolTest::eq));
IfNode* iff = create_and_xform_if(control(), bol, PROB_STATIC_FREQUENT, COUNT_UNKNOWN);
Expand All @@ -2958,23 +2957,30 @@ Node* GraphKit::gen_subtype_check(Node* obj_or_subklass, Node* superklass) {
Node* GraphKit::type_check_receiver(Node* receiver, ciKlass* klass,
float prob,
Node* *casted_receiver) {
assert(!klass->is_interface(), "no exact type check on interfaces");

const TypeKlassPtr* tklass = TypeKlassPtr::make(klass);
Node* recv_klass = load_object_klass(receiver);
Node* want_klass = makecon(tklass);
Node* cmp = _gvn.transform( new CmpPNode(recv_klass, want_klass) );
Node* bol = _gvn.transform( new BoolNode(cmp, BoolTest::eq) );
Node* cmp = _gvn.transform(new CmpPNode(recv_klass, want_klass));
Node* bol = _gvn.transform(new BoolNode(cmp, BoolTest::eq));
IfNode* iff = create_and_xform_if(control(), bol, prob, COUNT_UNKNOWN);
set_control( _gvn.transform( new IfTrueNode (iff) ));
Node* fail = _gvn.transform( new IfFalseNode(iff) );

const TypeOopPtr* recv_xtype = tklass->as_instance_type();
assert(recv_xtype->klass_is_exact(), "");

// Subsume downstream occurrences of receiver with a cast to
// recv_xtype, since now we know what the type will be.
Node* cast = new CheckCastPPNode(control(), receiver, recv_xtype);
(*casted_receiver) = _gvn.transform(cast);
// (User must make the replace_in_map call.)
set_control( _gvn.transform(new IfTrueNode (iff)));
Node* fail = _gvn.transform(new IfFalseNode(iff));

if (!stopped()) {
const TypeOopPtr* receiver_type = _gvn.type(receiver)->isa_oopptr();
const TypeOopPtr* recvx_type = tklass->as_instance_type();
assert(recvx_type->klass_is_exact(), "");

if (!receiver_type->higher_equal(recvx_type)) { // ignore redundant casts
// Subsume downstream occurrences of receiver with a cast to
// recv_xtype, since now we know what the type will be.
Node* cast = new CheckCastPPNode(control(), receiver, recvx_type);
(*casted_receiver) = _gvn.transform(cast);
// (User must make the replace_in_map call.)
}
}

return fail;
}
Expand All @@ -2987,10 +2993,15 @@ Node* GraphKit::subtype_check_receiver(Node* receiver, ciKlass* klass,

Node* slow_ctl = gen_subtype_check(receiver, want_klass);

// Cast receiver after successful check
const TypeOopPtr* recv_type = tklass->cast_to_exactness(false)->is_klassptr()->as_instance_type();
Node* cast = new CheckCastPPNode(control(), receiver, recv_type);
(*casted_receiver) = _gvn.transform(cast);
// Ignore interface type information until interface types are properly tracked.
if (!stopped() && !klass->is_interface()) {
const TypeOopPtr* receiver_type = _gvn.type(receiver)->isa_oopptr();
const TypeOopPtr* recv_type = tklass->cast_to_exactness(false)->is_klassptr()->as_instance_type();
if (!receiver_type->higher_equal(recv_type)) { // ignore redundant casts
Node* cast = new CheckCastPPNode(control(), receiver, recv_type);
(*casted_receiver) = _gvn.transform(cast);
}
}

return slow_ctl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ public Void visitStartElement(StartElementTree tree, Void ignore) {
}
}
}
}

// check for self closing tags, such as <a id="name"/>
if (tree.isSelfClosing() && !isSelfClosingAllowed(t)) {
env.messages.error(HTML, tree, "dc.tag.self.closing", treeName);
// check for self closing tags, such as <a id="name"/>
if (tree.isSelfClosing() && !isSelfClosingAllowed(t)) {
env.messages.error(HTML, tree, "dc.tag.self.closing", treeName);
}
}

try {
Expand Down
Loading

0 comments on commit 7f7e99b

Please sign in to comment.