This commit is contained in:
Jesper Wilhelmsson 2021-12-21 21:58:05 +00:00
commit 803cb8a768
80 changed files with 975 additions and 387 deletions

View File

@ -768,4 +768,13 @@ public class TableDemo extends DemoModule {
footerTextField.setDragEnabled(dragEnabled);
}
@Override
public ImageIcon createImageIcon(String filename, String description) {
ImageIcon imageIcon = super.createImageIcon(filename, description);
AccessibleContext context = imageIcon.getAccessibleContext();
if (context!= null) {
context.setAccessibleName(description);
}
return imageIcon;
}
}

View File

@ -55,9 +55,6 @@
// No support for generic vector operands.
static const bool supports_generic_vector_operands = false;
// No support for 48 extra htbl entries in aes-gcm intrinsic
static const int htbl_entries = 0;
static constexpr bool isSimpleConstant64(jlong value) {
// Will one (StoreL ConL) be cheaper than two (StoreI ConI)?.
// Probably always true, even if a temp register is required.

View File

@ -3094,8 +3094,7 @@ class StubGenerator: public StubCodeGenerator {
// key = c_rarg4
// state = c_rarg5 - GHASH.state
// subkeyHtbl = c_rarg6 - powers of H
// subkeyHtbl_48_entries = c_rarg7 (not used)
// counter = [sp, #0] pointer to 16 bytes of CTR
// counter = c_rarg7 - 16 bytes of CTR
// return - number of processed bytes
address generate_galoisCounterMode_AESCrypt() {
address ghash_polynomial = __ pc();
@ -3121,10 +3120,7 @@ class StubGenerator: public StubCodeGenerator {
const Register subkeyHtbl = c_rarg6;
// Pointer to CTR is passed on the stack before the (fp, lr) pair.
const Address counter_mem(sp, 2 * wordSize);
const Register counter = c_rarg7;
__ ldr(counter, counter_mem);
const Register keylen = r10;
// Save state before entering routine

View File

@ -56,9 +56,6 @@
// No support for generic vector operands.
static const bool supports_generic_vector_operands = false;
// No support for 48 extra htbl entries in aes-gcm intrinsic
static const int htbl_entries = -1;
static constexpr bool isSimpleConstant64(jlong value) {
// Will one (StoreL ConL) be cheaper than two (StoreI ConI)?.
return false;

View File

@ -57,9 +57,6 @@
// No support for generic vector operands.
static const bool supports_generic_vector_operands = false;
// No support for 48 extra htbl entries in aes-gcm intrinsic
static const int htbl_entries = -1;
static constexpr bool isSimpleConstant64(jlong value) {
// Probably always true, even if a temp register is required.
return true;

View File

@ -57,9 +57,6 @@
// No support for generic vector operands.
static const bool supports_generic_vector_operands = false;
// No support for 48 extra htbl entries in aes-gcm intrinsic
static const int htbl_entries = -1;
static constexpr bool isSimpleConstant64(jlong value) {
// Probably always true, even if a temp register is required.
return true;

View File

@ -148,8 +148,6 @@
static const bool int_in_long = false;
#endif
// Number of htbl entries for aes-gcm intrinsic
static const int htbl_entries = 96;
// Does the CPU supports vector variable shift instructions?
static bool supports_vector_variable_shifts(void) {

View File

@ -4414,9 +4414,8 @@ class StubGenerator: public StubCodeGenerator {
const Register state = c_rarg5;
const Address subkeyH_mem(rbp, 2 * wordSize);
const Register subkeyHtbl = r11;
const Address avx512_subkeyH_mem(rbp, 3 * wordSize);
const Register avx512_subkeyHtbl = r13;
const Address counter_mem(rbp, 4 * wordSize);
const Address counter_mem(rbp, 3 * wordSize);
const Register counter = r12;
#else
const Address key_mem(rbp, 6 * wordSize);
@ -4425,9 +4424,8 @@ class StubGenerator: public StubCodeGenerator {
const Register state = r13;
const Address subkeyH_mem(rbp, 8 * wordSize);
const Register subkeyHtbl = r14;
const Address avx512_subkeyH_mem(rbp, 9 * wordSize);
const Register avx512_subkeyHtbl = r12;
const Address counter_mem(rbp, 10 * wordSize);
const Address counter_mem(rbp, 9 * wordSize);
const Register counter = rsi;
#endif
__ enter();
@ -4444,11 +4442,20 @@ class StubGenerator: public StubCodeGenerator {
__ movptr(state, state_mem);
#endif
__ movptr(subkeyHtbl, subkeyH_mem);
__ movptr(avx512_subkeyHtbl, avx512_subkeyH_mem);
__ movptr(counter, counter_mem);
// Save rbp and rsp
__ push(rbp);
__ movq(rbp, rsp);
// Align stack
__ andq(rsp, -64);
__ subptr(rsp, 96 * longSize); // Create space on the stack for htbl entries
__ movptr(avx512_subkeyHtbl, rsp);
__ aesgcm_encrypt(in, len, ct, out, key, state, subkeyHtbl, avx512_subkeyHtbl, counter);
__ movq(rsp, rbp);
__ pop(rbp);
// Restore state before leaving routine
#ifdef _WIN64
__ pop(rsi);

View File

@ -4580,7 +4580,8 @@ instruct insertF(vec dst, regF val, immU8 idx) %{
assert(Matcher::vector_element_basic_type(this) == T_FLOAT, "sanity");
assert($idx$$constant < (int)Matcher::vector_length(this), "out of bounds");
__ insertps($dst$$XMMRegister, $val$$XMMRegister, $idx$$constant);
uint x_idx = $idx$$constant & right_n_bits(2);
__ insertps($dst$$XMMRegister, $val$$XMMRegister, x_idx << 4);
%}
ins_pipe( pipe_slow );
%}
@ -4600,13 +4601,13 @@ instruct vinsertF(vec dst, vec src, regF val, immU8 idx, vec vtmp) %{
uint y_idx = ($idx$$constant >> 2) & 1;
int vlen_enc = Assembler::AVX_256bit;
__ vextracti128($vtmp$$XMMRegister, $src$$XMMRegister, y_idx);
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx);
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx << 4);
__ vinserti128($dst$$XMMRegister, $src$$XMMRegister, $vtmp$$XMMRegister, y_idx);
} else {
assert(vlen == 16, "sanity");
uint y_idx = ($idx$$constant >> 2) & 3;
__ vextracti32x4($vtmp$$XMMRegister, $src$$XMMRegister, y_idx);
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx);
__ vinsertps($vtmp$$XMMRegister, $vtmp$$XMMRegister, $val$$XMMRegister, x_idx << 4);
__ vinserti32x4($dst$$XMMRegister, $src$$XMMRegister, $vtmp$$XMMRegister, y_idx);
}
%}

View File

@ -801,6 +801,11 @@ bool BlockBegin::try_merge(ValueStack* new_state) {
existing_state->invalidate_local(index);
TRACE_PHI(tty->print_cr("invalidating local %d because of type mismatch", index));
}
if (existing_value != new_state->local_at(index) && existing_value->as_Phi() == NULL) {
TRACE_PHI(tty->print_cr("required phi for local %d is missing, irreducible loop?", index));
return false; // BAILOUT in caller
}
}
#ifdef ASSERT

View File

@ -227,7 +227,7 @@ ShenandoahCodeBlobAndDisarmClosure::ShenandoahCodeBlobAndDisarmClosure(OopClosur
void ShenandoahCodeBlobAndDisarmClosure::do_code_blob(CodeBlob* cb) {
nmethod* const nm = cb->as_nmethod_or_null();
if (nm != NULL && nm->oops_do_try_claim()) {
if (nm != NULL) {
assert(!ShenandoahNMethod::gc_data(nm)->is_unregistered(), "Should not be here");
CodeBlobToOopClosure::do_code_blob(cb);
_bs->disarm(nm);

View File

@ -79,7 +79,6 @@ ShenandoahThreadRoots::~ShenandoahThreadRoots() {
}
ShenandoahCodeCacheRoots::ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase) : _phase(phase) {
nmethod::oops_do_marking_prologue();
}
void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id) {
@ -87,10 +86,6 @@ void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint work
_coderoots_iterator.possibly_parallel_blobs_do(blob_cl);
}
ShenandoahCodeCacheRoots::~ShenandoahCodeCacheRoots() {
nmethod::oops_do_marking_epilogue();
}
ShenandoahRootProcessor::ShenandoahRootProcessor(ShenandoahPhaseTimings::Phase phase) :
_heap(ShenandoahHeap::heap()),
_phase(phase),
@ -227,29 +222,52 @@ void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) {
}
ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner(uint n_workers) :
ShenandoahRootProcessor(ShenandoahPhaseTimings::heap_iteration_roots),
_thread_roots(ShenandoahPhaseTimings::heap_iteration_roots, false /*is par*/),
_vm_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_cld_roots(ShenandoahPhaseTimings::heap_iteration_roots, n_workers, true /*heap iteration*/),
_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_code_roots(ShenandoahPhaseTimings::heap_iteration_roots) {
}
ShenandoahRootProcessor(ShenandoahPhaseTimings::heap_iteration_roots),
_thread_roots(ShenandoahPhaseTimings::heap_iteration_roots, false /*is par*/),
_vm_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_cld_roots(ShenandoahPhaseTimings::heap_iteration_roots, n_workers, true /*heap iteration*/),
_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots),
_code_roots(ShenandoahPhaseTimings::heap_iteration_roots) {
}
void ShenandoahHeapIterationRootScanner::roots_do(OopClosure* oops) {
// Must use _claim_other to avoid interfering with concurrent CLDG iteration
CLDToOopClosure clds(oops, ClassLoaderData::_claim_other);
MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations);
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
AlwaysTrueClosure always_true;
class ShenandoahMarkCodeBlobClosure : public CodeBlobClosure {
private:
OopClosure* const _oops;
BarrierSetNMethod* const _bs_nm;
ResourceMark rm;
public:
ShenandoahMarkCodeBlobClosure(OopClosure* oops) :
_oops(oops),
_bs_nm(BarrierSet::barrier_set()->barrier_set_nmethod()) {}
// Process light-weight/limited parallel roots then
_vm_roots.oops_do(oops, 0);
_weak_roots.oops_do<OopClosure>(oops, 0);
_cld_roots.cld_do(&clds, 0);
virtual void do_code_blob(CodeBlob* cb) {
nmethod* const nm = cb->as_nmethod_or_null();
if (nm != nullptr) {
if (_bs_nm != nullptr) {
// Make sure it only sees to-space objects
_bs_nm->nmethod_entry_barrier(nm);
}
ShenandoahNMethod* const snm = ShenandoahNMethod::gc_data(nm);
assert(snm != nullptr, "Sanity");
snm->oops_do(_oops, false /*fix_relocations*/);
}
}
};
// Process heavy-weight/fully parallel roots the last
_code_roots.code_blobs_do(&code, 0);
_thread_roots.threads_do(&tc_cl, 0);
}
void ShenandoahHeapIterationRootScanner::roots_do(OopClosure* oops) {
// Must use _claim_other to avoid interfering with concurrent CLDG iteration
CLDToOopClosure clds(oops, ClassLoaderData::_claim_other);
ShenandoahMarkCodeBlobClosure code(oops);
ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
ResourceMark rm;
// Process light-weight/limited parallel roots then
_vm_roots.oops_do(oops, 0);
_weak_roots.oops_do<OopClosure>(oops, 0);
_cld_roots.cld_do(&clds, 0);
// Process heavy-weight/fully parallel roots the last
_code_roots.code_blobs_do(&code, 0);
_thread_roots.threads_do(&tc_cl, 0);
}

View File

@ -102,7 +102,6 @@ private:
ShenandoahCodeRootsIterator _coderoots_iterator;
public:
ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase);
~ShenandoahCodeCacheRoots();
void code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id);
};

View File

@ -207,7 +207,7 @@ int64_t JfrChunkWriter::write_chunk_header_checkpoint(bool flushpoint) {
const u4 checkpoint_size = current_offset() - event_size_offset;
write_padded_at_offset<u4>(checkpoint_size, event_size_offset);
set_last_checkpoint_offset(event_size_offset);
const size_t sz_written = size_written();
const int64_t sz_written = size_written();
write_be_at_offset(sz_written, chunk_size_offset);
return sz_written;
}

View File

@ -416,6 +416,11 @@ class LateInlineMHCallGenerator : public LateInlineCallGenerator {
};
bool LateInlineMHCallGenerator::do_late_inline_check(Compile* C, JVMState* jvms) {
// When inlining a virtual call, the null check at the call and the call itself can throw. These 2 paths have different
// expression stacks which causes late inlining to break. The MH invoker is not expected to be called from a method wih
// exception handlers. When there is no exception handler, GraphKit::builtin_throw() pops the stack which solves the issue
// of late inlining with exceptions.
assert(!jvms->method()->has_exception_handlers(), "no exception handler expected");
// Even if inlining is not allowed, a virtual call can be strength-reduced to a direct call.
bool allow_inline = C->inlining_incrementally();
bool input_not_const = true;

View File

@ -1656,6 +1656,7 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
init_req( KlassNode , klass_node);
init_req( InitialTest , initial_test);
init_req( ALength , topnode);
init_req( ValidLengthTest , topnode);
C->add_macro_node(this);
}
@ -1682,54 +1683,6 @@ Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, N
return mark_node;
}
//=============================================================================
Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if (remove_dead_region(phase, can_reshape)) return this;
// Don't bother trying to transform a dead node
if (in(0) && in(0)->is_top()) return NULL;
const Type* type = phase->type(Ideal_length());
if (type->isa_int() && type->is_int()->_hi < 0) {
if (can_reshape) {
PhaseIterGVN *igvn = phase->is_IterGVN();
// Unreachable fall through path (negative array length),
// the allocation can only throw so disconnect it.
Node* proj = proj_out_or_null(TypeFunc::Control);
Node* catchproj = NULL;
if (proj != NULL) {
for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
Node *cn = proj->fast_out(i);
if (cn->is_Catch()) {
catchproj = cn->as_Multi()->proj_out_or_null(CatchProjNode::fall_through_index);
break;
}
}
}
if (catchproj != NULL && catchproj->outcnt() > 0 &&
(catchproj->outcnt() > 1 ||
catchproj->unique_out()->Opcode() != Op_Halt)) {
assert(catchproj->is_CatchProj(), "must be a CatchProjNode");
Node* nproj = catchproj->clone();
igvn->register_new_node_with_optimizer(nproj);
Node *frame = new ParmNode( phase->C->start(), TypeFunc::FramePtr );
frame = phase->transform(frame);
// Halt & Catch Fire
Node* halt = new HaltNode(nproj, frame, "unexpected negative array length");
phase->C->root()->add_req(halt);
phase->transform(halt);
igvn->replace_node(catchproj, phase->C->top());
return this;
}
} else {
// Can't correct it during regular GVN so register for IGVN
phase->C->record_for_igvn(this);
}
}
return NULL;
}
// Retrieve the length from the AllocateArrayNode. Narrow the type with a
// CastII, if appropriate. If we are not allowed to create new nodes, and
// a CastII is appropriate, return NULL.

View File

@ -913,6 +913,7 @@ public:
KlassNode, // type (maybe dynamic) of the obj.
InitialTest, // slow-path test (may be constant)
ALength, // array length (or TOP if none)
ValidLengthTest,
ParmLimit
};
@ -922,6 +923,7 @@ public:
fields[KlassNode] = TypeInstPtr::NOTNULL;
fields[InitialTest] = TypeInt::BOOL;
fields[ALength] = t; // length (can be a bad length)
fields[ValidLengthTest] = TypeInt::BOOL;
const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
@ -1016,18 +1018,16 @@ public:
//
class AllocateArrayNode : public AllocateNode {
public:
AllocateArrayNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
Node* size, Node* klass_node, Node* initial_test,
Node* count_val
)
AllocateArrayNode(Compile* C, const TypeFunc* atype, Node* ctrl, Node* mem, Node* abio, Node* size, Node* klass_node,
Node* initial_test, Node* count_val, Node* valid_length_test)
: AllocateNode(C, atype, ctrl, mem, abio, size, klass_node,
initial_test)
{
init_class_id(Class_AllocateArray);
set_req(AllocateNode::ALength, count_val);
set_req(AllocateNode::ValidLengthTest, valid_length_test);
}
virtual int Opcode() const;
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
// Dig the length operand out of a array allocation site.
Node* Ideal_length() {

View File

@ -2687,6 +2687,20 @@ const Type* CatchNode::Value(PhaseGVN* phase) const {
// Rethrows always throw exceptions, never return
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
f[CatchProjNode::fall_through_index] = Type::TOP;
} else if (call->is_AllocateArray()) {
Node* klass_node = call->in(AllocateNode::KlassNode);
Node *length = call->in(AllocateNode::ALength);
const Type* length_type = phase->type(length);
const Type* klass_type = phase->type(klass_node);
if (length_type == Type::TOP || klass_type == Type::TOP) {
f[CatchProjNode::fall_through_index] = Type::TOP;
} else {
Node* valid_length_test = call->in(AllocateNode::ValidLengthTest);
const Type* valid_length_test_t = phase->type(valid_length_test);
if (valid_length_test_t->isa_int() && valid_length_test_t->is_int()->is_con(0)) {
f[CatchProjNode::fall_through_index] = Type::TOP;
}
}
} else if( call->req() > TypeFunc::Parms ) {
const Type *arg0 = phase->type( call->in(TypeFunc::Parms) );
// Check for null receiver to virtual or interface calls

View File

@ -3758,7 +3758,7 @@ bool Compile::final_graph_reshaping() {
// 'fall-thru' path, so expected kids is 1 less.
if (n->is_PCTable() && n->in(0) && n->in(0)->in(0)) {
if (n->in(0)->in(0)->is_Call()) {
CallNode *call = n->in(0)->in(0)->as_Call();
CallNode* call = n->in(0)->in(0)->as_Call();
if (call->entry_point() == OptoRuntime::rethrow_stub()) {
required_outcnt--; // Rethrow always has 1 less kid
} else if (call->req() > TypeFunc::Parms &&
@ -3767,22 +3767,25 @@ bool Compile::final_graph_reshaping() {
// detected that the virtual call will always result in a null
// pointer exception. The fall-through projection of this CatchNode
// will not be populated.
Node *arg0 = call->in(TypeFunc::Parms);
Node* arg0 = call->in(TypeFunc::Parms);
if (arg0->is_Type() &&
arg0->as_Type()->type()->higher_equal(TypePtr::NULL_PTR)) {
required_outcnt--;
}
} else if (call->entry_point() == OptoRuntime::new_array_Java() &&
call->req() > TypeFunc::Parms+1 &&
call->is_CallStaticJava()) {
} else if (call->entry_point() == OptoRuntime::new_array_Java() ||
call->entry_point() == OptoRuntime::new_array_nozero_Java()) {
// Check for negative array length. In such case, the optimizer has
// detected that the allocation attempt will always result in an
// exception. There is no fall-through projection of this CatchNode .
Node *arg1 = call->in(TypeFunc::Parms+1);
if (arg1->is_Type() &&
arg1->as_Type()->type()->join(TypeInt::POS)->empty()) {
assert(call->is_CallStaticJava(), "static call expected");
assert(call->len() > call->req() && call->in(call->req()) != NULL, "no precendent edge");
Node* valid_length_test = call->in(call->req());
call->rm_prec(call->req());
if (valid_length_test->find_int_con(1) == 0) {
required_outcnt--;
}
assert(n->outcnt() == required_outcnt, "malformed control flow");
continue;
}
}
}
@ -3791,6 +3794,13 @@ bool Compile::final_graph_reshaping() {
record_method_not_compilable("malformed control flow");
return true; // Not all targets reachable!
}
} else if (n->is_PCTable() && n->in(0) && n->in(0)->in(0) && n->in(0)->in(0)->is_Call()) {
CallNode* call = n->in(0)->in(0)->as_Call();
if (call->entry_point() == OptoRuntime::new_array_Java() ||
call->entry_point() == OptoRuntime::new_array_nozero_Java()) {
assert(call->len() > call->req() && call->in(call->req()) != NULL, "precedent edge expected");
call->rm_prec(call->req());
}
}
// Check that I actually visited all kids. Unreached kids
// must be infinite loops.

View File

@ -613,6 +613,13 @@ void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) {
const TypeOopPtr* val_type = TypeOopPtr::make_from_klass(env()->String_klass());
Node *store = access_store_at(ex_node, adr, adr_typ, null(), val_type, T_OBJECT, IN_HEAP);
if (!method()->has_exception_handlers()) {
// We don't need to preserve the stack if there's no handler as the entire frame is going to be popped anyway.
// This prevents issues with exception handling and late inlining.
set_sp(0);
clean_stack(0);
}
add_exception_state(make_exception_state(ex_node));
return;
}
@ -2487,8 +2494,7 @@ Node* GraphKit::make_runtime_call(int flags,
Node* parm0, Node* parm1,
Node* parm2, Node* parm3,
Node* parm4, Node* parm5,
Node* parm6, Node* parm7,
Node* parm8) {
Node* parm6, Node* parm7) {
assert(call_addr != NULL, "must not call NULL targets");
// Slow-path call
@ -2535,8 +2541,7 @@ Node* GraphKit::make_runtime_call(int flags,
if (parm5 != NULL) { call->init_req(TypeFunc::Parms+5, parm5);
if (parm6 != NULL) { call->init_req(TypeFunc::Parms+6, parm6);
if (parm7 != NULL) { call->init_req(TypeFunc::Parms+7, parm7);
if (parm8 != NULL) { call->init_req(TypeFunc::Parms+8, parm8);
/* close each nested if ===> */ } } } } } } } } }
/* close each nested if ===> */ } } } } } } } }
assert(call->in(call->req()-1) != NULL, "must initialize all parms");
if (!is_leaf) {
@ -2737,7 +2742,9 @@ void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool sep
// Make a catch node with just two handlers: fall-through and catch-all
Node* i_o = _gvn.transform( new ProjNode(call, TypeFunc::I_O, separate_io_proj) );
Node* catc = _gvn.transform( new CatchNode(control(), i_o, 2) );
Node* norm = _gvn.transform( new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci) );
Node* norm = new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci);
_gvn.set_type_bottom(norm);
C->record_for_igvn(norm);
Node* excp = _gvn.transform( new CatchProjNode(catc, CatchProjNode::catch_all_index, CatchProjNode::no_handler_bci) );
{ PreserveJVMState pjvms(this);
@ -3978,20 +3985,28 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn);
}
const TypeOopPtr* ary_type = _gvn.type(klass_node)->is_klassptr()->as_instance_type();
Node* valid_length_test = C->top();
if (ary_type->klass()->is_array_klass()) {
BasicType bt = ary_type->klass()->as_array_klass()->element_type()->basic_type();
jint max = TypeAryPtr::max_array_length(bt);
Node* valid_length_cmp = _gvn.transform(new CmpUNode(length, intcon(max)));
valid_length_test = _gvn.transform(new BoolNode(valid_length_cmp, BoolTest::le));
}
// Create the AllocateArrayNode and its result projections
AllocateArrayNode* alloc
= new AllocateArrayNode(C, AllocateArrayNode::alloc_type(TypeInt::INT),
control(), mem, i_o(),
size, klass_node,
initial_slow_test,
length);
length, valid_length_test);
// Cast to correct type. Note that the klass_node may be constant or not,
// and in the latter case the actual array type will be inexact also.
// (This happens via a non-constant argument to inline_native_newArray.)
// In any case, the value of klass_node provides the desired array type.
const TypeInt* length_type = _gvn.find_int_type(length);
const TypeOopPtr* ary_type = _gvn.type(klass_node)->is_klassptr()->as_instance_type();
if (ary_type->isa_aryptr() && length_type != NULL) {
// Try to get a better type than POS for the size
ary_type = ary_type->is_aryptr()->cast_to_size(length_type);

View File

@ -802,8 +802,7 @@ class GraphKit : public Phase {
Node* parm0 = NULL, Node* parm1 = NULL,
Node* parm2 = NULL, Node* parm3 = NULL,
Node* parm4 = NULL, Node* parm5 = NULL,
Node* parm6 = NULL, Node* parm7 = NULL,
Node* parm8 = NULL);
Node* parm6 = NULL, Node* parm7 = NULL);
Node* sign_extend_byte(Node* in);
Node* sign_extend_short(Node* in);

View File

@ -6795,7 +6795,7 @@ bool LibraryCallKit::inline_galoisCounterMode_AESCrypt() {
Node* state = load_field_from_object(ghash_object, "state", "[J");
if (embeddedCipherObj == NULL || counter == NULL || subkeyHtbl == NULL || state == NULL) {
return false;
return false;
}
// cast it to what we know it will be at runtime
const TypeInstPtr* tinst = _gvn.type(gctr_object)->isa_instptr();
@ -6811,38 +6811,22 @@ bool LibraryCallKit::inline_galoisCounterMode_AESCrypt() {
// we need to get the start of the aescrypt_object's expanded key array
Node* k_start = get_key_start_from_aescrypt_object(aescrypt_object);
if (k_start == NULL) return false;
// similarly, get the start address of the r vector
Node* cnt_start = array_element_address(counter, intcon(0), T_BYTE);
Node* state_start = array_element_address(state, intcon(0), T_LONG);
Node* subkeyHtbl_start = array_element_address(subkeyHtbl, intcon(0), T_LONG);
ciKlass* klass = ciTypeArrayKlass::make(T_LONG);
Node* klass_node = makecon(TypeKlassPtr::make(klass));
// Does this target support this intrinsic?
if (Matcher::htbl_entries == -1) return false;
Node* subkeyHtbl_48_entries_start;
if (Matcher::htbl_entries != 0) {
// new array to hold 48 computed htbl entries
Node* subkeyHtbl_48_entries = new_array(klass_node, intcon(Matcher::htbl_entries), 0);
if (subkeyHtbl_48_entries == NULL) return false;
subkeyHtbl_48_entries_start = array_element_address(subkeyHtbl_48_entries, intcon(0), T_LONG);
} else {
// This target doesn't need the extra-large Htbl.
subkeyHtbl_48_entries_start = ConvL2X(intcon(0));
}
// Call the stub, passing params
Node* gcmCrypt = make_runtime_call(RC_LEAF|RC_NO_FP,
OptoRuntime::galoisCounterMode_aescrypt_Type(),
stubAddr, stubName, TypePtr::BOTTOM,
in_start, len, ct_start, out_start, k_start, state_start, subkeyHtbl_start, subkeyHtbl_48_entries_start, cnt_start);
in_start, len, ct_start, out_start, k_start, state_start, subkeyHtbl_start, cnt_start);
// return cipher length (int)
Node* retvalue = _gvn.transform(new ProjNode(gcmCrypt, TypeFunc::Parms));
set_result(retvalue);
return true;
}

View File

@ -830,10 +830,6 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) {
return false;
}
// May not have gone thru igvn yet so don't use _igvn.type(phi) (PhaseIdealLoop::is_counted_loop() sets the iv phi's type)
const TypeInteger* phi_t = phi->bottom_type()->is_integer(bt);
assert(phi_t->hi_as_long() >= phi_t->lo_as_long(), "dead phi?");
iters_limit = checked_cast<int>(MIN2((julong)iters_limit, (julong)(phi_t->hi_as_long() - phi_t->lo_as_long())));
IfNode* exit_test = head->loopexit();
BoolTest::mask mask = exit_test->as_BaseCountedLoopEnd()->test_trip();
@ -851,6 +847,11 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) {
}
}
// May not have gone thru igvn yet so don't use _igvn.type(phi) (PhaseIdealLoop::is_counted_loop() sets the iv phi's type)
const TypeInteger* phi_t = phi->bottom_type()->is_integer(bt);
assert(phi_t->hi_as_long() >= phi_t->lo_as_long(), "dead phi?");
iters_limit = checked_cast<int>(MIN2((julong)iters_limit, (julong)(phi_t->hi_as_long() - phi_t->lo_as_long())));
// We need a safepoint to insert empty predicates for the inner loop.
SafePointNode* safepoint;
if (bt == T_INT && head->as_CountedLoop()->is_strip_mined()) {

View File

@ -1208,7 +1208,8 @@ void PhaseMacroExpand::expand_allocate_common(
AllocateNode* alloc, // allocation node to be expanded
Node* length, // array length for an array allocation
const TypeFunc* slow_call_type, // Type of slow call
address slow_call_address // Address of slow call
address slow_call_address, // Address of slow call
Node* valid_length_test // whether length is valid or not
)
{
Node* ctrl = alloc->in(TypeFunc::Control);
@ -1393,6 +1394,9 @@ void PhaseMacroExpand::expand_allocate_common(
// Copy debug information and adjust JVMState information, then replace
// allocate node with the call
call->copy_call_debug_info(&_igvn, alloc);
if (valid_length_test != NULL) {
call->add_prec(valid_length_test);
}
if (expand_fast_path) {
call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON.
} else {
@ -1875,11 +1879,12 @@ Node* PhaseMacroExpand::prefetch_allocation(Node* i_o, Node*& needgc_false,
void PhaseMacroExpand::expand_allocate(AllocateNode *alloc) {
expand_allocate_common(alloc, NULL,
OptoRuntime::new_instance_Type(),
OptoRuntime::new_instance_Java());
OptoRuntime::new_instance_Java(), NULL);
}
void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
Node* length = alloc->in(AllocateNode::ALength);
Node* valid_length_test = alloc->in(AllocateNode::ValidLengthTest);
InitializeNode* init = alloc->initialization();
Node* klass_node = alloc->in(AllocateNode::KlassNode);
ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass();
@ -1894,7 +1899,7 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
}
expand_allocate_common(alloc, length,
OptoRuntime::new_array_Type(),
slow_call_address);
slow_call_address, valid_length_test);
}
//-------------------mark_eliminated_box----------------------------------

View File

@ -92,8 +92,8 @@ private:
void expand_allocate_common(AllocateNode* alloc,
Node* length,
const TypeFunc* slow_call_type,
address slow_call_address);
void yank_initalize_node(InitializeNode* node);
address slow_call_address,
Node* valid_length_test);
void yank_alloc_node(AllocateNode* alloc);
Node *value_from_mem(Node *mem, Node *ctl, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc);
Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc, Node_Stack *value_phis, int level);

View File

@ -958,7 +958,7 @@ const TypeFunc* OptoRuntime::counterMode_aescrypt_Type() {
//for counterMode calls of aescrypt encrypt/decrypt, four pointers and a length, returning int
const TypeFunc* OptoRuntime::galoisCounterMode_aescrypt_Type() {
// create input type (domain)
int num_args = 9;
int num_args = 8;
int argcnt = num_args;
const Type** fields = TypeTuple::fields(argcnt);
int argp = TypeFunc::Parms;
@ -969,7 +969,6 @@ const TypeFunc* OptoRuntime::galoisCounterMode_aescrypt_Type() {
fields[argp++] = TypePtr::NOTNULL; // byte[] key from AESCrypt obj
fields[argp++] = TypePtr::NOTNULL; // long[] state from GHASH obj
fields[argp++] = TypePtr::NOTNULL; // long[] subkeyHtbl from GHASH obj
fields[argp++] = TypePtr::NOTNULL; // long[] avx512_subkeyHtbl newly created
fields[argp++] = TypePtr::NOTNULL; // byte[] counter from GCTR obj
assert(argp == TypeFunc::Parms + argcnt, "correct decoding");

View File

@ -128,8 +128,8 @@ bool PhaseIdealLoop::split_up( Node *n, Node *blk1, Node *blk2 ) {
}
} else {
// We might see an Opaque1 from a loop limit check here
assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1, "unexpected node type");
Node *use_c = use->is_If() ? use->in(0) : get_ctrl(use);
assert(use->is_If() || use->is_CMove() || use->Opcode() == Op_Opaque1 || use->is_AllocateArray(), "unexpected node type");
Node *use_c = (use->is_If() || use->is_AllocateArray()) ? use->in(0) : get_ctrl(use);
if (use_c == blk1 || use_c == blk2) {
assert(use->is_CMove(), "unexpected node type");
continue;
@ -166,14 +166,15 @@ bool PhaseIdealLoop::split_up( Node *n, Node *blk1, Node *blk2 ) {
--j;
} else {
// We might see an Opaque1 from a loop limit check here
assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1, "unexpected node type");
assert(u->in(1) == bol, "");
assert(u->is_If() || u->is_CMove() || u->Opcode() == Op_Opaque1 || u->is_AllocateArray(), "unexpected node type");
assert(u->is_AllocateArray() || u->in(1) == bol, "");
assert(!u->is_AllocateArray() || u->in(AllocateNode::ValidLengthTest) == bol, "wrong input to AllocateArray");
// Get control block of either the CMove or the If input
Node *u_ctrl = u->is_If() ? u->in(0) : get_ctrl(u);
Node *u_ctrl = (u->is_If() || u->is_AllocateArray()) ? u->in(0) : get_ctrl(u);
assert((u_ctrl != blk1 && u_ctrl != blk2) || u->is_CMove(), "won't converge");
Node *x = bol->clone();
register_new_node(x, u_ctrl);
_igvn.replace_input_of(u, 1, x);
_igvn.replace_input_of(u, u->is_AllocateArray() ? AllocateNode::ValidLengthTest : 1, x);
--j;
}
}

View File

@ -63,6 +63,6 @@ void MonitorDeflationThread::monitor_deflation_thread_entry(JavaThread* jt, TRAP
}
}
(void)ObjectSynchronizer::deflate_idle_monitors();
(void)ObjectSynchronizer::deflate_idle_monitors(/* ObjectMonitorsHashtable is not needed here */ nullptr);
}
}

View File

@ -57,6 +57,40 @@
#include "utilities/events.hpp"
#include "utilities/preserveException.hpp"
class CleanupObjectMonitorsHashtable: StackObj {
public:
bool do_entry(void*& key, ObjectMonitorsHashtable::PtrList*& list) {
list->clear(); // clear the LinkListNodes
delete list; // then delete the LinkedList
return true;
}
};
ObjectMonitorsHashtable::~ObjectMonitorsHashtable() {
CleanupObjectMonitorsHashtable cleanup;
_ptrs->unlink(&cleanup); // cleanup the LinkedLists
delete _ptrs; // then delete the hash table
}
void ObjectMonitorsHashtable::add_entry(void* key, ObjectMonitor* om) {
ObjectMonitorsHashtable::PtrList* list = get_entry(key);
if (list == nullptr) {
// Create new list and add it to the hash table:
list = new (ResourceObj::C_HEAP, mtThread) ObjectMonitorsHashtable::PtrList();
add_entry(key, list);
}
list->add(om); // Add the ObjectMonitor to the list.
_om_count++;
}
bool ObjectMonitorsHashtable::has_entry(void* key, ObjectMonitor* om) {
ObjectMonitorsHashtable::PtrList* list = get_entry(key);
if (list == nullptr || list->find(om) == nullptr) {
return false;
}
return true;
}
void MonitorList::add(ObjectMonitor* m) {
ObjectMonitor* head;
do {
@ -992,11 +1026,18 @@ JavaThread* ObjectSynchronizer::get_lock_owner(ThreadsList * t_list, Handle h_ob
// Visitors ...
// Iterate ObjectMonitors where the owner == thread; this does NOT include
// ObjectMonitors where owner is set to a stack lock address in thread.
//
// This version of monitors_iterate() works with the in-use monitor list.
//
void ObjectSynchronizer::monitors_iterate(MonitorClosure* closure, JavaThread* thread) {
MonitorList::Iterator iter = _in_use_list.iterator();
while (iter.has_next()) {
ObjectMonitor* mid = iter.next();
if (mid->owner() != thread) {
// Not owned by the target thread and intentionally skips when owner
// is set to a stack lock address in the target thread.
continue;
}
if (!mid->is_being_async_deflated() && mid->object_peek() != NULL) {
@ -1013,6 +1054,31 @@ void ObjectSynchronizer::monitors_iterate(MonitorClosure* closure, JavaThread* t
}
}
// This version of monitors_iterate() works with the specified linked list.
//
void ObjectSynchronizer::monitors_iterate(MonitorClosure* closure,
ObjectMonitorsHashtable::PtrList* list,
JavaThread* thread) {
typedef LinkedListIterator<ObjectMonitor*> ObjectMonitorIterator;
ObjectMonitorIterator iter(list->head());
while (!iter.is_empty()) {
ObjectMonitor* mid = *iter.next();
// Owner set to a stack lock address in thread should never be seen here:
assert(mid->owner() == thread, "must be");
if (!mid->is_being_async_deflated() && mid->object_peek() != NULL) {
// Only process with closure if the object is set.
// monitors_iterate() is only called at a safepoint or when the
// target thread is suspended or when the target thread is
// operating on itself. The current closures in use today are
// only interested in an owned ObjectMonitor and ownership
// cannot be dropped under the calling contexts so the
// ObjectMonitor cannot be async deflated.
closure->do_monitor(mid);
}
}
}
static bool monitors_used_above_threshold(MonitorList* list) {
if (MonitorUsedDeflationThreshold == 0) { // disabled case is easy
return false;
@ -1338,8 +1404,17 @@ void ObjectSynchronizer::chk_for_block_req(JavaThread* current, const char* op_n
// Walk the in-use list and deflate (at most MonitorDeflationMax) idle
// ObjectMonitors. Returns the number of deflated ObjectMonitors.
//
// If table != nullptr, we gather owned ObjectMonitors indexed by the
// owner in the table. Please note that ObjectMonitors where the owner
// is set to a stack lock address are NOT associated with the JavaThread
// that holds that stack lock. All of the current consumers of
// ObjectMonitorsHashtable info only care about JNI locked monitors and
// those do not have the owner set to a stack lock address.
//
size_t ObjectSynchronizer::deflate_monitor_list(Thread* current, LogStream* ls,
elapsedTimer* timer_p) {
elapsedTimer* timer_p,
ObjectMonitorsHashtable* table) {
MonitorList::Iterator iter = _in_use_list.iterator();
size_t deflated_count = 0;
@ -1350,6 +1425,18 @@ size_t ObjectSynchronizer::deflate_monitor_list(Thread* current, LogStream* ls,
ObjectMonitor* mid = iter.next();
if (mid->deflate_monitor()) {
deflated_count++;
} else if (table != nullptr) {
// The caller is interested in the owned ObjectMonitors. This does
// not include when owner is set to a stack lock address in thread.
// This also does not capture unowned ObjectMonitors that cannot be
// deflated because of a waiter.
void* key = mid->owner();
// Since deflate_idle_monitors() and deflate_monitor_list() can be
// called more than once, we have to make sure the entry has not
// already been added.
if (key != nullptr && !table->has_entry(key, mid)) {
table->add_entry(key, mid);
}
}
if (current->is_Java_thread()) {
@ -1374,8 +1461,8 @@ class HandshakeForDeflation : public HandshakeClosure {
// This function is called by the MonitorDeflationThread to deflate
// ObjectMonitors. It is also called via do_final_audit_and_print_stats()
// by the VMThread.
size_t ObjectSynchronizer::deflate_idle_monitors() {
// and VM_ThreadDump::doit() by the VMThread.
size_t ObjectSynchronizer::deflate_idle_monitors(ObjectMonitorsHashtable* table) {
Thread* current = Thread::current();
if (current->is_Java_thread()) {
// The async deflation request has been processed.
@ -1400,7 +1487,7 @@ size_t ObjectSynchronizer::deflate_idle_monitors() {
}
// Deflate some idle ObjectMonitors.
size_t deflated_count = deflate_monitor_list(current, ls, &timer);
size_t deflated_count = deflate_monitor_list(current, ls, &timer, table);
if (deflated_count > 0 || is_final_audit()) {
// There are ObjectMonitors that have been deflated or this is the
// final audit and all the remaining ObjectMonitors have been
@ -1458,6 +1545,10 @@ size_t ObjectSynchronizer::deflate_idle_monitors() {
}
ls->print_cr("end deflating: in_use_list stats: ceiling=" SIZE_FORMAT ", count=" SIZE_FORMAT ", max=" SIZE_FORMAT,
in_use_list_ceiling(), _in_use_list.count(), _in_use_list.max());
if (table != nullptr) {
ls->print_cr("ObjectMonitorsHashtable: key_count=" SIZE_FORMAT ", om_count=" SIZE_FORMAT,
table->key_count(), table->om_count());
}
}
OM_PERFDATA_OP(MonExtant, set_value(_in_use_list.count()));
@ -1560,7 +1651,7 @@ void ObjectSynchronizer::do_final_audit_and_print_stats() {
// Do a deflation in order to reduce the in-use monitor population
// that is reported by ObjectSynchronizer::log_in_use_monitor_details()
// which is called by ObjectSynchronizer::audit_and_print_stats().
while (ObjectSynchronizer::deflate_idle_monitors() != 0) {
while (ObjectSynchronizer::deflate_idle_monitors(/* ObjectMonitorsHashtable is not needed here */ nullptr) >= (size_t)MonitorDeflationMax) {
; // empty
}
// The other audit_and_print_stats() call is done at the Debug

View File

@ -30,11 +30,69 @@
#include "runtime/basicLock.hpp"
#include "runtime/handles.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/linkedlist.hpp"
#include "utilities/resourceHash.hpp"
class LogStream;
class ObjectMonitor;
class ThreadsList;
// Hash table of void* to a list of ObjectMonitor* owned by the JavaThread.
// The JavaThread's owner key is either a JavaThread* or a stack lock
// address in the JavaThread so we use "void*".
//
class ObjectMonitorsHashtable {
private:
static unsigned int ptr_hash(void* const& s1) {
// 2654435761 = 2^32 * Phi (golden ratio)
return (unsigned int)(((uint32_t)(uintptr_t)s1) * 2654435761u);
}
public:
typedef LinkedListImpl<ObjectMonitor*,
ResourceObj::C_HEAP, mtThread,
AllocFailStrategy::RETURN_NULL> PtrList;
// ResourceHashtable SIZE is specified at compile time so we
// use 1031 which is the first prime after 1024.
typedef ResourceHashtable<void*, PtrList*, 1031, ResourceObj::C_HEAP, mtThread,
&ObjectMonitorsHashtable::ptr_hash> PtrTable;
private:
PtrTable* _ptrs;
size_t _key_count;
size_t _om_count;
public:
// ResourceHashtable is passed to various functions and populated in
// different places so we allocate it using C_HEAP to make it immune
// from any ResourceMarks that happen to be in the code paths.
ObjectMonitorsHashtable() : _ptrs(new (ResourceObj::C_HEAP, mtThread) PtrTable()), _key_count(0), _om_count(0) {}
~ObjectMonitorsHashtable();
void add_entry(void* key, ObjectMonitor* om);
void add_entry(void* key, PtrList* list) {
_ptrs->put(key, list);
_key_count++;
}
PtrList* get_entry(void* key) {
PtrList** listpp = _ptrs->get(key);
return (listpp == nullptr) ? nullptr : *listpp;
}
bool has_entry(void* key) {
PtrList** listpp = _ptrs->get(key);
return listpp != nullptr && *listpp != nullptr;
}
bool has_entry(void* key, ObjectMonitor* om);
size_t key_count() { return _key_count; }
size_t om_count() { return _om_count; }
};
class MonitorList {
friend class VMStructs;
@ -133,21 +191,30 @@ class ObjectSynchronizer : AllStatic {
// JNI detach support
static void release_monitors_owned_by_thread(JavaThread* current);
// Iterate ObjectMonitors where the owner == thread; this does NOT include
// ObjectMonitors where owner is set to a stack lock address in thread:
//
// This version of monitors_iterate() works with the in-use monitor list.
static void monitors_iterate(MonitorClosure* m, JavaThread* thread);
// This version of monitors_iterate() works with the specified linked list.
static void monitors_iterate(MonitorClosure* closure,
ObjectMonitorsHashtable::PtrList* list,
JavaThread* thread);
// Initialize the gInflationLocks
static void initialize();
// GC: we current use aggressive monitor deflation policy
// GC: we currently use aggressive monitor deflation policy
// Basically we try to deflate all monitors that are not busy.
static size_t deflate_idle_monitors();
static size_t deflate_idle_monitors(ObjectMonitorsHashtable* table);
// Deflate idle monitors:
static void chk_for_block_req(JavaThread* current, const char* op_name,
const char* cnt_name, size_t cnt, LogStream* ls,
elapsedTimer* timer_p);
static size_t deflate_monitor_list(Thread* current, LogStream* ls,
elapsedTimer* timer_p);
static size_t deflate_monitor_list(Thread* current, LogStream* ls, elapsedTimer* timer_p,
ObjectMonitorsHashtable* table);
static size_t in_use_list_ceiling();
static void dec_in_use_list_ceiling();
static void inc_in_use_list_ceiling();

View File

@ -279,6 +279,18 @@ void VM_ThreadDump::doit() {
concurrent_locks.dump_at_safepoint();
}
ObjectMonitorsHashtable table;
ObjectMonitorsHashtable* tablep = nullptr;
if (_with_locked_monitors) {
// The caller wants locked monitor information and that's expensive to gather
// when there are a lot of inflated monitors. So we deflate idle monitors and
// gather information about owned monitors at the same time.
tablep = &table;
while (ObjectSynchronizer::deflate_idle_monitors(tablep) >= (size_t)MonitorDeflationMax) {
; /* empty */
}
}
if (_num_threads == 0) {
// Snapshot all live threads
@ -293,7 +305,7 @@ void VM_ThreadDump::doit() {
if (_with_locked_synchronizers) {
tcl = concurrent_locks.thread_concurrent_locks(jt);
}
snapshot_thread(jt, tcl);
snapshot_thread(jt, tcl, tablep);
}
} else {
// Snapshot threads in the given _threads array
@ -328,14 +340,15 @@ void VM_ThreadDump::doit() {
if (_with_locked_synchronizers) {
tcl = concurrent_locks.thread_concurrent_locks(jt);
}
snapshot_thread(jt, tcl);
snapshot_thread(jt, tcl, tablep);
}
}
}
void VM_ThreadDump::snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl) {
void VM_ThreadDump::snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl,
ObjectMonitorsHashtable* table) {
ThreadSnapshot* snapshot = _result->add_thread_snapshot(java_thread);
snapshot->dump_stack_at_safepoint(_max_depth, _with_locked_monitors);
snapshot->dump_stack_at_safepoint(_max_depth, _with_locked_monitors, table);
snapshot->set_concurrent_locks(tcl);
}

View File

@ -207,7 +207,8 @@ class VM_ThreadDump : public VM_Operation {
bool _with_locked_monitors;
bool _with_locked_synchronizers;
void snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl);
void snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl,
ObjectMonitorsHashtable* table);
public:
VM_ThreadDump(ThreadDumpResult* result,

View File

@ -2388,7 +2388,7 @@ void VM_HeapDumper::dump_stack_traces() {
HandleMark hm(current_thread);
ThreadStackTrace* stack_trace = new ThreadStackTrace(thread, false);
stack_trace->dump_stack_at_safepoint(-1);
stack_trace->dump_stack_at_safepoint(-1, /* ObjectMonitorsHashtable is not needed here */ nullptr);
_stack_traces[_num_threads++] = stack_trace;
// write HPROF_FRAME records for this thread's stack trace

View File

@ -659,7 +659,7 @@ ThreadStackTrace::~ThreadStackTrace() {
}
}
void ThreadStackTrace::dump_stack_at_safepoint(int maxDepth) {
void ThreadStackTrace::dump_stack_at_safepoint(int maxDepth, ObjectMonitorsHashtable* table) {
assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped");
if (_thread->has_last_Java_frame()) {
@ -683,9 +683,19 @@ void ThreadStackTrace::dump_stack_at_safepoint(int maxDepth) {
if (_with_locked_monitors) {
// Iterate inflated monitors and find monitors locked by this thread
// not found in the stack
// that are not found in the stack, e.g. JNI locked monitors:
InflatedMonitorsClosure imc(this);
ObjectSynchronizer::monitors_iterate(&imc, _thread);
if (table != nullptr) {
// Get the ObjectMonitors locked by the target thread, if any,
// and does not include any where owner is set to a stack lock
// address in the target thread:
ObjectMonitorsHashtable::PtrList* list = table->get_entry(_thread);
if (list != nullptr) {
ObjectSynchronizer::monitors_iterate(&imc, list, _thread);
}
} else {
ObjectSynchronizer::monitors_iterate(&imc, _thread);
}
}
}
@ -936,9 +946,10 @@ ThreadSnapshot::~ThreadSnapshot() {
delete _concurrent_locks;
}
void ThreadSnapshot::dump_stack_at_safepoint(int max_depth, bool with_locked_monitors) {
void ThreadSnapshot::dump_stack_at_safepoint(int max_depth, bool with_locked_monitors,
ObjectMonitorsHashtable* table) {
_stack_trace = new ThreadStackTrace(_thread, with_locked_monitors);
_stack_trace->dump_stack_at_safepoint(max_depth);
_stack_trace->dump_stack_at_safepoint(max_depth, table);
}

View File

@ -247,7 +247,8 @@ public:
ThreadStackTrace* get_stack_trace() { return _stack_trace; }
ThreadConcurrentLocks* get_concurrent_locks() { return _concurrent_locks; }
void dump_stack_at_safepoint(int max_depth, bool with_locked_monitors);
void dump_stack_at_safepoint(int max_depth, bool with_locked_monitors,
ObjectMonitorsHashtable* table);
void set_concurrent_locks(ThreadConcurrentLocks* l) { _concurrent_locks = l; }
void metadata_do(void f(Metadata*));
};
@ -270,7 +271,7 @@ class ThreadStackTrace : public CHeapObj<mtInternal> {
int get_stack_depth() { return _depth; }
void add_stack_frame(javaVFrame* jvf);
void dump_stack_at_safepoint(int max_depth);
void dump_stack_at_safepoint(int max_depth, ObjectMonitorsHashtable* table);
Handle allocate_fill_stack_trace_element_array(TRAPS);
void metadata_do(void f(Metadata*));
GrowableArray<OopHandle>* jni_locked_monitors() { return _jni_locked_monitors; }

View File

@ -893,7 +893,8 @@ public class ModuleDescriptor
* integer or a string. Tokens are separated by the punctuation characters
* {@code '.'}, {@code '-'}, or {@code '+'}, or by transitions from a
* sequence of digits to a sequence of characters that are neither digits
* nor punctuation characters, or vice versa.
* nor punctuation characters, or vice versa. Consecutive repeated
* punctuation characters are treated as a single punctuation character.
*
* <ul>
*

View File

@ -792,7 +792,7 @@ static jobject sAccessibilityClass = NULL;
(*env)->DeleteLocalRef(env, axComponent);
point.y += size.height;
point.y = [[[[self view] window] screen] frame].size.height - point.y;
point.y = [[[NSScreen screens] objectAtIndex:0] frame].size.height - point.y;
return NSMakeRect(point.x, point.y, size.width, size.height);
}
@ -990,7 +990,7 @@ static jobject sAccessibilityClass = NULL;
point.y += size.height;
// Now make it into Cocoa screen coords.
point.y = [[[[self view] window] screen] frame].size.height - point.y;
point.y = [[[NSScreen screens] objectAtIndex:0] frame].size.height - point.y;
return point;
}
@ -1098,7 +1098,7 @@ static jobject sAccessibilityClass = NULL;
"(Ljava/awt/Container;FF)Ljavax/accessibility/Accessible;", nil);
// Make it into java screen coords
point.y = [[[[self view] window] screen] frame].size.height - point.y;
point.y = [[[NSScreen screens] objectAtIndex:0] frame].size.height - point.y;
jobject jparent = fComponent;

View File

@ -37,4 +37,3 @@ vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java 82456
serviceability/sa/TestJhsdbJstackMixed.java 8248675 linux-aarch64
compiler/codegen/aes/TestAESMain.java 8274323 linux-x64,windows-x64

View File

@ -71,7 +71,7 @@ compiler/whitebox/ClearMethodStateTest.java 8265360 macosx-aarch64
compiler/whitebox/EnqueueMethodForCompilationTest.java 8265360 macosx-aarch64
compiler/whitebox/MakeMethodNotCompilableTest.java 8265360 macosx-aarch64
compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-x64
compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-generic
compiler/codecache/TestStressCodeBuffers.java 8272094 generic-aarch64

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2021, Red Hat, Inc. 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 8278413
* @summary C2 crash when allocating array of size too large
* @library /test/lib /
* @build sun.hotspot.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -ea -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation TestFailedAllocationBadGraph
*/
import sun.hotspot.WhiteBox;
import java.lang.reflect.Method;
import compiler.whitebox.CompilerWhiteBoxTest;
public class TestFailedAllocationBadGraph {
private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
private static long[] array;
private static int field;
private static volatile int barrier;
public static void main(String[] args) throws Exception {
run("test1");
run("test2");
}
private static void run(String method) throws Exception {
Method m = TestFailedAllocationBadGraph.class.getDeclaredMethod(method);
WHITE_BOX.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
if (!WHITE_BOX.isMethodCompiled(m) || WHITE_BOX.getMethodCompilationLevel(m) != CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) {
throw new RuntimeException("should still be compiled");
}
}
private static int test1() {
int length = Integer.MAX_VALUE;
try {
array = new long[length];
} catch (OutOfMemoryError outOfMemoryError) {
barrier = 0x42;
length = field;
}
return length;
}
private static int test2() {
int length = -1;
try {
array = new long[length];
} catch (OutOfMemoryError outOfMemoryError) {
barrier = 0x42;
length = field;
}
return length;
}
}

View File

@ -0,0 +1,76 @@
/*
* Copyright (c) 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
* 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.
*
*/
super public class TestC1PhiPlacementPathology
version 62:0
{
public static volatile Field sideEffect:I;
public Method "<init>":"()V"
stack 1 locals 1
{
aload_0;
invokespecial Method java/lang/Object."<init>":"()V";
return;
}
private static Method effect:"(I)V"
stack 2 locals 1
{
getstatic Field sideEffect:"I";
iload_0;
iadd;
putstatic Field sideEffect:"I";
return;
}
public static Method test:"(I)V"
stack 2 locals 2
{
iconst_0;
istore_1;
iload_0;
iconst_2;
irem;
ifne MODIFY_LOCAL;
iinc 1, 1;
goto LH2;
MODIFY_LOCAL: stack_frame_type append;
locals_map int;
iinc 1, 2;
iinc 0, 1;
goto LH1;
LH1: stack_frame_type same;
iinc 1, 1;
iload_1;
sipush 10000;
if_icmpge EXIT;
LH2: stack_frame_type same;
iinc 1, 1;
goto LH1;
EXIT: stack_frame_type same;
iload_1;
iload_0;
iadd;
invokestatic Method effect:"(I)V";
return;
}
} // end Class TestC1PhiPlacementPathology

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 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
* 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 8277447
* @summary Test a pathological case for phi placement with an irreducible loop of a particular shape.
*
* @compile TestC1PhiPlacementPathology.jasm
* @run main/othervm -Xbatch -XX:CompileCommand=compileonly,TestC1PhiPlacementPathology::test
* -XX:CompilationMode=quick-only -XX:-UseOnStackReplacement TestC1PhiPlacementPathologyMain
*/
public class TestC1PhiPlacementPathologyMain {
public static void main(String[] args) {
for (int i = 0; i < 11000; i++) {
TestC1PhiPlacementPathology.test(0);
}
}
}

View File

@ -0,0 +1,105 @@
/*
* Copyright (c) 2021, Red Hat, Inc. 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 8275638
* @summary GraphKit::combine_exception_states fails with "matching stack sizes" assert
*
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLateMHInlineExceptions::m
* -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline TestLateMHInlineExceptions
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacements -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
* TestLateMHInlineExceptions
*
*/
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
public class TestLateMHInlineExceptions {
public static void main(String[] args) throws Throwable {
TestLateMHInlineExceptions test = new TestLateMHInlineExceptions();
for (int i = 0; i < 20_000; i++) {
test1(test);
try {
test1(null);
} catch (NullPointerException npe) {
}
test2(test);
test2(null);
test3(test);
try {
test3(null);
} catch (NullPointerException npe) {
}
test4(test);
test4(null);
}
}
void m() {
}
static final MethodHandle mh;
static {
MethodHandles.Lookup lookup = MethodHandles.lookup();
try {
mh = lookup.findVirtual(TestLateMHInlineExceptions.class, "m", MethodType.methodType(void.class));
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new RuntimeException("Method handle lookup failed");
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new RuntimeException("Method handle lookup failed");
}
}
private static void test1(TestLateMHInlineExceptions test) throws Throwable {
mh.invokeExact(test);
}
private static void test2(TestLateMHInlineExceptions test) throws Throwable {
try {
mh.invokeExact(test);
} catch (NullPointerException npe) {
}
}
private static void inlined(TestLateMHInlineExceptions test) throws Throwable {
mh.invokeExact(test);
}
private static void test3(TestLateMHInlineExceptions test) throws Throwable {
inlined(test);
}
private static void test4(TestLateMHInlineExceptions test) throws Throwable {
try {
inlined(test);
} catch (NullPointerException npe) {
}
}
}

View File

@ -226,10 +226,10 @@ public class Byte128VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
int i = 0;
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3444,13 +3444,16 @@ public class Byte128VectorTests extends AbstractVectorTest {
byte[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
av.withLane(0, (byte)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (byte)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(byte a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Byte256VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
int i = 0;
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3444,13 +3444,16 @@ public class Byte256VectorTests extends AbstractVectorTest {
byte[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
av.withLane(0, (byte)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (byte)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(byte a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Byte512VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
int i = 0;
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3444,13 +3444,16 @@ public class Byte512VectorTests extends AbstractVectorTest {
byte[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
av.withLane(0, (byte)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (byte)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(byte a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Byte64VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
int i = 0;
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3444,13 +3444,16 @@ public class Byte64VectorTests extends AbstractVectorTest {
byte[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
av.withLane(0, (byte)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (byte)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(byte a) {
return bits(a)==0;

View File

@ -231,10 +231,10 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index) {
int i = 0;
static void assertInsertArraysEquals(byte[] r, byte[] a, byte element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3449,13 +3449,16 @@ public class ByteMaxVectorTests extends AbstractVectorTest {
byte[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ByteVector av = ByteVector.fromArray(SPECIES, a, i);
av.withLane(0, (byte)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (byte)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (byte)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (byte)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(byte a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Double128VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
int i = 0;
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2457,13 +2457,16 @@ public class Double128VectorTests extends AbstractVectorTest {
double[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
av.withLane(0, (double)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (double)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(double a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Double256VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
int i = 0;
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2457,13 +2457,16 @@ public class Double256VectorTests extends AbstractVectorTest {
double[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
av.withLane(0, (double)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (double)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(double a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Double512VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
int i = 0;
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2457,13 +2457,16 @@ public class Double512VectorTests extends AbstractVectorTest {
double[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
av.withLane(0, (double)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (double)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(double a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Double64VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
int i = 0;
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2457,13 +2457,16 @@ public class Double64VectorTests extends AbstractVectorTest {
double[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
av.withLane(0, (double)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (double)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(double a) {
return bits(a)==0;

View File

@ -231,10 +231,10 @@ public class DoubleMaxVectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index) {
int i = 0;
static void assertInsertArraysEquals(double[] r, double[] a, double element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2462,13 +2462,16 @@ public class DoubleMaxVectorTests extends AbstractVectorTest {
double[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
DoubleVector av = DoubleVector.fromArray(SPECIES, a, i);
av.withLane(0, (double)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (double)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (double)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (double)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(double a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Float128VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
int i = 0;
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2467,13 +2467,16 @@ public class Float128VectorTests extends AbstractVectorTest {
float[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
av.withLane(0, (float)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (float)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(float a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Float256VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
int i = 0;
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2467,13 +2467,16 @@ public class Float256VectorTests extends AbstractVectorTest {
float[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
av.withLane(0, (float)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (float)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(float a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Float512VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
int i = 0;
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2467,13 +2467,16 @@ public class Float512VectorTests extends AbstractVectorTest {
float[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
av.withLane(0, (float)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (float)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(float a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Float64VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
int i = 0;
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2467,13 +2467,16 @@ public class Float64VectorTests extends AbstractVectorTest {
float[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
av.withLane(0, (float)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (float)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(float a) {
return bits(a)==0;

View File

@ -231,10 +231,10 @@ public class FloatMaxVectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index) {
int i = 0;
static void assertInsertArraysEquals(float[] r, float[] a, float element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -2472,13 +2472,16 @@ public class FloatMaxVectorTests extends AbstractVectorTest {
float[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
FloatVector av = FloatVector.fromArray(SPECIES, a, i);
av.withLane(0, (float)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (float)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (float)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (float)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(float a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Int128VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
int i = 0;
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3409,13 +3409,16 @@ public class Int128VectorTests extends AbstractVectorTest {
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
av.withLane(0, (int)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (int)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(int a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Int256VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
int i = 0;
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3409,13 +3409,16 @@ public class Int256VectorTests extends AbstractVectorTest {
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
av.withLane(0, (int)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (int)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(int a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Int512VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
int i = 0;
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3409,13 +3409,16 @@ public class Int512VectorTests extends AbstractVectorTest {
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
av.withLane(0, (int)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (int)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(int a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Int64VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
int i = 0;
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3409,13 +3409,16 @@ public class Int64VectorTests extends AbstractVectorTest {
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
av.withLane(0, (int)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (int)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(int a) {
return bits(a)==0;

View File

@ -231,10 +231,10 @@ public class IntMaxVectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index) {
int i = 0;
static void assertInsertArraysEquals(int[] r, int[] a, int element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3414,13 +3414,16 @@ public class IntMaxVectorTests extends AbstractVectorTest {
int[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
IntVector av = IntVector.fromArray(SPECIES, a, i);
av.withLane(0, (int)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (int)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (int)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (int)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(int a) {
return bits(a)==0;

View File

@ -183,10 +183,10 @@ public class Long128VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
int i = 0;
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3431,13 +3431,16 @@ public class Long128VectorTests extends AbstractVectorTest {
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
av.withLane(0, (long)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (long)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(long a) {
return bits(a)==0;

View File

@ -183,10 +183,10 @@ public class Long256VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
int i = 0;
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3431,13 +3431,16 @@ public class Long256VectorTests extends AbstractVectorTest {
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
av.withLane(0, (long)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (long)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(long a) {
return bits(a)==0;

View File

@ -183,10 +183,10 @@ public class Long512VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
int i = 0;
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3431,13 +3431,16 @@ public class Long512VectorTests extends AbstractVectorTest {
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
av.withLane(0, (long)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (long)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(long a) {
return bits(a)==0;

View File

@ -183,10 +183,10 @@ public class Long64VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
int i = 0;
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3431,13 +3431,16 @@ public class Long64VectorTests extends AbstractVectorTest {
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
av.withLane(0, (long)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (long)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(long a) {
return bits(a)==0;

View File

@ -188,10 +188,10 @@ public class LongMaxVectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index) {
int i = 0;
static void assertInsertArraysEquals(long[] r, long[] a, long element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3436,13 +3436,16 @@ public class LongMaxVectorTests extends AbstractVectorTest {
long[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
LongVector av = LongVector.fromArray(SPECIES, a, i);
av.withLane(0, (long)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (long)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (long)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (long)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(long a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Short128VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
int i = 0;
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3434,13 +3434,16 @@ public class Short128VectorTests extends AbstractVectorTest {
short[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
av.withLane(0, (short)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (short)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(short a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Short256VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
int i = 0;
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3434,13 +3434,16 @@ public class Short256VectorTests extends AbstractVectorTest {
short[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
av.withLane(0, (short)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (short)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(short a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Short512VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
int i = 0;
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3434,13 +3434,16 @@ public class Short512VectorTests extends AbstractVectorTest {
short[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
av.withLane(0, (short)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (short)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(short a) {
return bits(a)==0;

View File

@ -226,10 +226,10 @@ public class Short64VectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
int i = 0;
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3434,13 +3434,16 @@ public class Short64VectorTests extends AbstractVectorTest {
short[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
av.withLane(0, (short)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (short)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(short a) {
return bits(a)==0;

View File

@ -231,10 +231,10 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index) {
int i = 0;
static void assertInsertArraysEquals(short[] r, short[] a, short element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {
@ -3439,13 +3439,16 @@ public class ShortMaxVectorTests extends AbstractVectorTest {
short[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
ShortVector av = ShortVector.fromArray(SPECIES, a, i);
av.withLane(0, (short)4).intoArray(r, i);
av.withLane((j++ & (SPECIES.length()-1)), (short)(65535+i)).intoArray(r, i);
}
}
assertInsertArraysEquals(r, a, (short)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, (short)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}
static boolean testIS_DEFAULT(short a) {
return bits(a)==0;

View File

@ -2,9 +2,9 @@
$type$[] r = fr.apply(SPECIES.length());
for (int ic = 0; ic < INVOC_COUNT; ic++) {
for (int i = 0; i < a.length; i += SPECIES.length()) {
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
$abstractvectortype$ av = $abstractvectortype$.fromArray(SPECIES, a, i);
av.withLane(0, ($type$)4).intoArray(r, i);
av.withLane((j++ \& (SPECIES.length()-1)), ($type$)(65535+i)).intoArray(r, i);
}
}

View File

@ -2,5 +2,8 @@
@Test(dataProvider = "$type$UnaryOpProvider")
static void with$vectorteststype$(IntFunction<$type$ []> fa) {
[[KERNEL]]
assertInsertArraysEquals(r, a, ($type$)4, 0);
for (int i = 0, j = 0; i < a.length; i += SPECIES.length()) {
assertInsertArraysEquals(r, a, ($type$)(65535+i), (j++ & (SPECIES.length()-1)), i , i + SPECIES.length());
}
}

View File

@ -257,10 +257,10 @@ public class $vectorteststype$ extends AbstractVectorTest {
}
}
static void assertInsertArraysEquals($type$[] r, $type$[] a, $type$ element, int index) {
int i = 0;
static void assertInsertArraysEquals($type$[] r, $type$[] a, $type$ element, int index, int start, int end) {
int i = start;
try {
for (; i < a.length; i += 1) {
for (; i < end; i += 1) {
if(i%SPECIES.length() == index) {
Assert.assertEquals(r[i], element);
} else {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 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
@ -36,7 +36,7 @@ import jdk.jfr.consumer.EventStream;
* @library /test/lib /test/jdk
* @modules jdk.jfr jdk.attach java.base/jdk.internal.misc
*
* @run main/othervm jdk.jfr.api.consumer.streaming.TestJVMCrash
* @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMCrash
*/
public class TestJVMCrash {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 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
@ -35,7 +35,7 @@ import jdk.jfr.consumer.EventStream;
* @library /test/lib /test/jdk
* @modules jdk.jfr jdk.attach java.base/jdk.internal.misc
*
* @run main/othervm jdk.jfr.api.consumer.streaming.TestJVMExit
* @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMExit
*/
public class TestJVMExit {

View File

@ -76,9 +76,13 @@ public class SigningPackageTest {
private static void verifyAppImageInDMG(JPackageCommand cmd) {
MacHelper.withExplodedDmg(cmd, dmgImage -> {
Path launcherPath = dmgImage.resolve(Path.of("Contents", "MacOS", cmd.name()));
SigningBase.verifyCodesign(launcherPath, true);
SigningBase.verifyCodesign(dmgImage, true);
SigningBase.verifySpctl(dmgImage, "exec");
// We will be called with all folders in DMG since JDK-8263155, but
// we only need to verify app.
if (dmgImage.endsWith(cmd.name() + ".app")) {
SigningBase.verifyCodesign(launcherPath, true);
SigningBase.verifyCodesign(dmgImage, true);
SigningBase.verifySpctl(dmgImage, "exec");
}
});
}

View File

@ -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
@ -51,8 +51,8 @@ public class StreamingUtils {
try {
VirtualMachine vm = VirtualMachine.attach(String.valueOf(process.pid()));
String repo = vm.getSystemProperties().getProperty("jdk.jfr.repository");
vm.detach();
if (repo != null) {
vm.detach();
System.out.println("JFR repository: " + repo);
return Paths.get(repo);
}