Merge
This commit is contained in:
commit
528bc73ca4
@ -269,7 +269,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// when called via a c2i.
|
||||
|
||||
// Pass initial_caller_sp to framemanager.
|
||||
__ mr(R21_tmp1, R1_SP);
|
||||
__ mr(R21_sender_SP, R1_SP);
|
||||
|
||||
// Do a light-weight C-call here, r_new_arg_entry holds the address
|
||||
// of the interpreter entry point (frame manager or native entry)
|
||||
|
@ -532,14 +532,8 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
|
||||
// these parameters the pre-barrier does not generate
|
||||
// the load of the previous value.
|
||||
|
||||
// Restore caller sp for c2i case.
|
||||
#ifdef ASSERT
|
||||
__ ld(R9_ARG7, 0, R1_SP);
|
||||
__ ld(R10_ARG8, 0, R21_sender_SP);
|
||||
__ cmpd(CCR0, R9_ARG7, R10_ARG8);
|
||||
__ asm_assert_eq("backlink", 0x544);
|
||||
#endif // ASSERT
|
||||
__ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
|
||||
__ blr();
|
||||
|
||||
@ -835,8 +829,13 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(Register Rmem_f
|
||||
assert(StubRoutines::throw_StackOverflowError_entry() != NULL, "generated in wrong order");
|
||||
__ load_const_optimized(Rscratch1, (StubRoutines::throw_StackOverflowError_entry()), R0);
|
||||
__ mtctr(Rscratch1);
|
||||
// Restore caller_sp.
|
||||
// Restore caller_sp (c2i adapter may exist, but no shrinking of interpreted caller frame).
|
||||
#ifdef ASSERT
|
||||
Label frame_not_shrunk;
|
||||
__ cmpld(CCR0, R1_SP, R21_sender_SP);
|
||||
__ ble(CCR0, frame_not_shrunk);
|
||||
__ stop("frame shrunk", 0x546);
|
||||
__ bind(frame_not_shrunk);
|
||||
__ ld(Rscratch1, 0, R1_SP);
|
||||
__ ld(R0, 0, R21_sender_SP);
|
||||
__ cmpd(CCR0, R0, Rscratch1);
|
||||
@ -1155,15 +1154,6 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
|
||||
}
|
||||
}
|
||||
|
||||
// Pop c2i arguments (if any) off when we return.
|
||||
#ifdef ASSERT
|
||||
__ ld(R9_ARG7, 0, R1_SP);
|
||||
__ ld(R10_ARG8, 0, R21_sender_SP);
|
||||
__ cmpd(CCR0, R9_ARG7, R10_ARG8);
|
||||
__ asm_assert_eq("backlink", 0x545);
|
||||
#endif // ASSERT
|
||||
__ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
|
||||
|
||||
if (use_instruction) {
|
||||
switch (kind) {
|
||||
case Interpreter::java_lang_math_sqrt: __ fsqrt(F1_RET, F1); break;
|
||||
@ -1188,6 +1178,8 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
|
||||
__ restore_LR_CR(R0);
|
||||
}
|
||||
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
__ blr();
|
||||
|
||||
__ flush();
|
||||
@ -1843,8 +1835,8 @@ address TemplateInterpreterGenerator::generate_CRC32_update_entry() {
|
||||
StubRoutines::ppc64::generate_load_crc_table_addr(_masm, table);
|
||||
__ kernel_crc32_singleByte(crc, data, dataLen, table, tmp, true);
|
||||
|
||||
// Restore caller sp for c2i case and return.
|
||||
__ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
__ blr();
|
||||
|
||||
// Generate a vanilla native entry as the slow path.
|
||||
@ -1931,8 +1923,8 @@ address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractI
|
||||
// code compactness.
|
||||
__ kernel_crc32_1word(crc, data, dataLen, table, t0, t1, t2, t3, tc0, tc1, tc2, tc3, true);
|
||||
|
||||
// Restore caller sp for c2i case and return.
|
||||
__ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
__ blr();
|
||||
|
||||
// Generate a vanilla native entry as the slow path.
|
||||
@ -2019,8 +2011,8 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract
|
||||
// code compactness.
|
||||
__ kernel_crc32_1word(crc, data, dataLen, table, t0, t1, t2, t3, tc0, tc1, tc2, tc3, false);
|
||||
|
||||
// Restore caller sp for c2i case and return.
|
||||
__ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started.
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
__ resize_frame_absolute(R21_sender_SP, R11_scratch1, R0);
|
||||
__ blr();
|
||||
|
||||
BLOCK_COMMENT("} CRC32C_update{Bytes|DirectByteBuffer}");
|
||||
|
@ -46,6 +46,7 @@ class ciEnv : StackObj {
|
||||
|
||||
friend class CompileBroker;
|
||||
friend class Dependencies; // for get_object, during logging
|
||||
friend class PrepareExtraDataClosure;
|
||||
|
||||
private:
|
||||
Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects()
|
||||
@ -188,6 +189,10 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
ciMetadata* cached_metadata(Metadata* o) {
|
||||
return _factory->cached_metadata(o);
|
||||
}
|
||||
|
||||
ciInstance* get_instance(oop o) {
|
||||
if (o == NULL) return NULL;
|
||||
return get_object(o)->as_instance();
|
||||
|
@ -78,10 +78,81 @@ ciMethodData::ciMethodData() : ciMetadata(NULL) {
|
||||
_parameters = NULL;
|
||||
}
|
||||
|
||||
void ciMethodData::load_extra_data() {
|
||||
// Check for entries that reference an unloaded method
|
||||
class PrepareExtraDataClosure : public CleanExtraDataClosure {
|
||||
MethodData* _mdo;
|
||||
uint64_t _safepoint_counter;
|
||||
GrowableArray<Method*> _uncached_methods;
|
||||
|
||||
public:
|
||||
PrepareExtraDataClosure(MethodData* mdo)
|
||||
: _mdo(mdo),
|
||||
_safepoint_counter(SafepointSynchronize::safepoint_counter()),
|
||||
_uncached_methods()
|
||||
{ }
|
||||
|
||||
bool is_live(Method* m) {
|
||||
if (!m->method_holder()->is_loader_alive()) {
|
||||
return false;
|
||||
}
|
||||
if (CURRENT_ENV->cached_metadata(m) == NULL) {
|
||||
// Uncached entries need to be pre-populated.
|
||||
_uncached_methods.append(m);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool has_safepointed() {
|
||||
return SafepointSynchronize::safepoint_counter() != _safepoint_counter;
|
||||
}
|
||||
|
||||
bool finish() {
|
||||
if (_uncached_methods.length() == 0) {
|
||||
// Preparation finished iff all Methods* were already cached.
|
||||
return true;
|
||||
}
|
||||
// Holding locks through safepoints is bad practice.
|
||||
MutexUnlocker mu(_mdo->extra_data_lock());
|
||||
for (int i = 0; i < _uncached_methods.length(); ++i) {
|
||||
if (has_safepointed()) {
|
||||
// The metadata in the growable array might contain stale
|
||||
// entries after a safepoint.
|
||||
return false;
|
||||
}
|
||||
Method* method = _uncached_methods.at(i);
|
||||
// Populating ciEnv caches may cause safepoints due
|
||||
// to taking the Compile_lock with safepoint checks.
|
||||
(void)CURRENT_ENV->get_method(method);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void ciMethodData::prepare_metadata() {
|
||||
MethodData* mdo = get_MethodData();
|
||||
|
||||
for (;;) {
|
||||
ResourceMark rm;
|
||||
PrepareExtraDataClosure cl(mdo);
|
||||
mdo->clean_extra_data(&cl);
|
||||
if (cl.finish()) {
|
||||
// When encountering uncached metadata, the Compile_lock might be
|
||||
// acquired when creating ciMetadata handles, causing safepoints
|
||||
// which requires a new round of preparation to clean out potentially
|
||||
// new unloading metadata.
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ciMethodData::load_extra_data() {
|
||||
MethodData* mdo = get_MethodData();
|
||||
MutexLocker ml(mdo->extra_data_lock());
|
||||
// Deferred metadata cleaning due to concurrent class unloading.
|
||||
prepare_metadata();
|
||||
// After metadata preparation, there is no stale metadata,
|
||||
// and no safepoints can introduce more stale metadata.
|
||||
NoSafepointVerifier no_safepoint;
|
||||
|
||||
// speculative trap entries also hold a pointer to a Method so need to be translated
|
||||
DataLayout* dp_src = mdo->extra_data_base();
|
||||
@ -94,7 +165,7 @@ void ciMethodData::load_extra_data() {
|
||||
// New traps in the MDO may have been added since we copied the
|
||||
// data (concurrent deoptimizations before we acquired
|
||||
// extra_data_lock above) or can be removed (a safepoint may occur
|
||||
// in the translate_from call below) as we translate the copy:
|
||||
// in the prepare_metadata call above) as we translate the copy:
|
||||
// update the copy as we go.
|
||||
int tag = dp_src->tag();
|
||||
if (tag != DataLayout::arg_info_data_tag) {
|
||||
@ -105,11 +176,7 @@ void ciMethodData::load_extra_data() {
|
||||
case DataLayout::speculative_trap_data_tag: {
|
||||
ciSpeculativeTrapData data_dst(dp_dst);
|
||||
SpeculativeTrapData data_src(dp_src);
|
||||
|
||||
{ // During translation a safepoint can happen or VM lock can be taken (e.g., Compile_lock).
|
||||
MutexUnlocker ml(mdo->extra_data_lock());
|
||||
data_dst.translate_from(&data_src);
|
||||
}
|
||||
data_dst.translate_from(&data_src);
|
||||
break;
|
||||
}
|
||||
case DataLayout::bit_data_tag:
|
||||
|
@ -475,6 +475,7 @@ private:
|
||||
return (address) _data;
|
||||
}
|
||||
|
||||
void prepare_metadata();
|
||||
void load_extra_data();
|
||||
ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
|
||||
|
||||
|
@ -265,6 +265,24 @@ int ciObjectFactory::metadata_compare(Metadata* const& key, ciMetadata* const& e
|
||||
else return 0;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciObjectFactory::cached_metadata
|
||||
//
|
||||
// Get the ciMetadata corresponding to some Metadata. If the ciMetadata has
|
||||
// already been created, it is returned. Otherwise, null is returned.
|
||||
ciMetadata* ciObjectFactory::cached_metadata(Metadata* key) {
|
||||
ASSERT_IN_VM;
|
||||
|
||||
bool found = false;
|
||||
int index = _ci_metadata->find_sorted<Metadata*, ciObjectFactory::metadata_compare>(key, found);
|
||||
|
||||
if (!found) {
|
||||
return NULL;
|
||||
}
|
||||
return _ci_metadata->at(index)->as_metadata();
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciObjectFactory::get_metadata
|
||||
//
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
// Get the ciObject corresponding to some oop.
|
||||
ciObject* get(oop key);
|
||||
ciMetadata* get_metadata(Metadata* key);
|
||||
ciMetadata* cached_metadata(Metadata* key);
|
||||
ciSymbol* get_symbol(Symbol* key);
|
||||
|
||||
// Get the ciSymbol corresponding to one of the vmSymbols.
|
||||
|
@ -1159,6 +1159,19 @@ void nmethod::log_state_change() const {
|
||||
}
|
||||
}
|
||||
|
||||
void nmethod::unlink_from_method(bool acquire_lock) {
|
||||
// We need to check if both the _code and _from_compiled_code_entry_point
|
||||
// refer to this nmethod because there is a race in setting these two fields
|
||||
// in Method* as seen in bugid 4947125.
|
||||
// If the vep() points to the zombie nmethod, the memory for the nmethod
|
||||
// could be flushed and the compiler and vtable stubs could still call
|
||||
// through it.
|
||||
if (method() != NULL && (method()->code() == this ||
|
||||
method()->from_compiled_entry() == verified_entry_point())) {
|
||||
method()->clear_code(acquire_lock);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Common functionality for both make_not_entrant and make_zombie
|
||||
*/
|
||||
@ -1246,17 +1259,7 @@ bool nmethod::make_not_entrant_or_zombie(int state) {
|
||||
JVMCI_ONLY(maybe_invalidate_installed_code());
|
||||
|
||||
// Remove nmethod from method.
|
||||
// We need to check if both the _code and _from_compiled_code_entry_point
|
||||
// refer to this nmethod because there is a race in setting these two fields
|
||||
// in Method* as seen in bugid 4947125.
|
||||
// If the vep() points to the zombie nmethod, the memory for the nmethod
|
||||
// could be flushed and the compiler and vtable stubs could still call
|
||||
// through it.
|
||||
if (method() != NULL && (method()->code() == this ||
|
||||
method()->from_compiled_entry() == verified_entry_point())) {
|
||||
HandleMark hm;
|
||||
method()->clear_code(false /* already owns Patching_lock */);
|
||||
}
|
||||
unlink_from_method(false /* already owns Patching_lock */);
|
||||
} // leave critical region under Patching_lock
|
||||
|
||||
#ifdef ASSERT
|
||||
|
@ -377,6 +377,8 @@ class nmethod : public CompiledMethod {
|
||||
|
||||
int comp_level() const { return _comp_level; }
|
||||
|
||||
void unlink_from_method(bool acquire_lock);
|
||||
|
||||
// Support for oops in scopes and relocs:
|
||||
// Note: index 0 is reserved for null.
|
||||
oop oop_at(int index) const;
|
||||
|
@ -42,6 +42,11 @@ bool ZBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) {
|
||||
}
|
||||
|
||||
if (nm->is_unloading()) {
|
||||
// We don't need to take the lock when unlinking nmethods from
|
||||
// the Method, because it is only concurrently unlinked by
|
||||
// the entry barrier, which acquires the per nmethod lock.
|
||||
nm->unlink_from_method(false /* acquire_lock */);
|
||||
|
||||
// We can end up calling nmethods that are unloading
|
||||
// since we clear compiled ICs lazily. Returning false
|
||||
// will re-resovle the call and update the compiled IC.
|
||||
|
@ -611,15 +611,20 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
ZLocker<ZReentrantLock> locker(ZNMethodTable::lock_for_nmethod(nm));
|
||||
|
||||
if (nm->is_unloading()) {
|
||||
// Unlinking of the dependencies must happen before the
|
||||
// handshake separating unlink and purge.
|
||||
nm->flush_dependencies(false /* delete_immediately */);
|
||||
|
||||
// We don't need to take the lock when unlinking nmethods from
|
||||
// the Method, because it is only concurrently unlinked by
|
||||
// the entry barrier, which acquires the per nmethod lock.
|
||||
nm->unlink_from_method(false /* acquire_lock */);
|
||||
return;
|
||||
}
|
||||
|
||||
ZLocker<ZReentrantLock> locker(ZNMethodTable::lock_for_nmethod(nm));
|
||||
|
||||
// Heal oops and disarm
|
||||
ZNMethodOopClosure cl;
|
||||
ZNMethodTable::entry_oops_do(entry, &cl);
|
||||
|
@ -2178,6 +2178,7 @@ void InstanceKlass::clean_method_data() {
|
||||
for (int m = 0; m < methods()->length(); m++) {
|
||||
MethodData* mdo = methods()->at(m)->method_data();
|
||||
if (mdo != NULL) {
|
||||
MutexLockerEx ml(SafepointSynchronize::is_at_safepoint() ? NULL : mdo->extra_data_lock());
|
||||
mdo->clean_method_data(/*always_clean*/false);
|
||||
}
|
||||
}
|
||||
|
@ -1653,11 +1653,6 @@ void MethodData::clean_extra_data_helper(DataLayout* dp, int shift, bool reset)
|
||||
}
|
||||
}
|
||||
|
||||
class CleanExtraDataClosure : public StackObj {
|
||||
public:
|
||||
virtual bool is_live(Method* m) = 0;
|
||||
};
|
||||
|
||||
// Check for entries that reference an unloaded method
|
||||
class CleanExtraDataKlassClosure : public CleanExtraDataClosure {
|
||||
bool _always_clean;
|
||||
|
@ -1943,7 +1943,11 @@ public:
|
||||
// adjusted in the event of a change in control flow.
|
||||
//
|
||||
|
||||
class CleanExtraDataClosure;
|
||||
class CleanExtraDataClosure : public StackObj {
|
||||
public:
|
||||
virtual bool is_live(Method* m) = 0;
|
||||
};
|
||||
|
||||
|
||||
class MethodData : public Metadata {
|
||||
friend class VMStructs;
|
||||
@ -2116,11 +2120,12 @@ private:
|
||||
static bool profile_parameters_jsr292_only();
|
||||
static bool profile_all_parameters();
|
||||
|
||||
void clean_extra_data(CleanExtraDataClosure* cl);
|
||||
void clean_extra_data_helper(DataLayout* dp, int shift, bool reset = false);
|
||||
void verify_extra_data_clean(CleanExtraDataClosure* cl);
|
||||
|
||||
public:
|
||||
void clean_extra_data(CleanExtraDataClosure* cl);
|
||||
|
||||
static int header_size() {
|
||||
return sizeof(MethodData)/wordSize;
|
||||
}
|
||||
|
@ -1727,7 +1727,8 @@ void ConnectionGraph::adjust_scalar_replaceable_state(JavaObjectNode* jobj) {
|
||||
//
|
||||
Node* n = field->ideal_node();
|
||||
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
|
||||
if (n->fast_out(i)->is_LoadStore()) {
|
||||
Node* u = n->fast_out(i);
|
||||
if (u->is_LoadStore() || (u->is_Mem() && u->as_Mem()->is_mismatched_access())) {
|
||||
jobj->set_scalar_replaceable(false);
|
||||
return;
|
||||
}
|
||||
|
@ -3419,8 +3419,8 @@ public final class Class<T> implements java.io.Serializable,
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getName() + "." + name + "(");
|
||||
if (argTypes != null) {
|
||||
Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
|
||||
collect(Collectors.joining(","));
|
||||
sb.append(Stream.of(argTypes).map(c -> {return (c == null) ? "null" : c.getName();}).
|
||||
collect(Collectors.joining(",")));
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2019, 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
|
||||
@ -1864,35 +1864,6 @@ public abstract class VarHandle implements Constable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare this {@linkplain VarHandle} with another object for equality.
|
||||
* Two {@linkplain VarHandle}s are considered equal if they both describe the
|
||||
* same instance field, both describe the same static field, both describe
|
||||
* array elements for arrays with the same component type, or both describe
|
||||
* the same component of an off-heap structure.
|
||||
*
|
||||
* @param o the other object
|
||||
* @return Whether this {@linkplain VarHandle} is equal to the other object
|
||||
*/
|
||||
@Override
|
||||
public final boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
VarHandle that = (VarHandle) o;
|
||||
return accessModeType(AccessMode.GET).equals(that.accessModeType(AccessMode.GET)) &&
|
||||
internalEquals(that);
|
||||
}
|
||||
|
||||
abstract boolean internalEquals(VarHandle vh);
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return 31 * accessModeType(AccessMode.GET).hashCode() + internalHashCode();
|
||||
}
|
||||
|
||||
abstract int internalHashCode();
|
||||
|
||||
/**
|
||||
* Returns a compact textual description of this {@linkplain VarHandle},
|
||||
* including the type of variable described, and a description of its coordinates.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -63,17 +63,6 @@ final class VarHandle$Type$s {
|
||||
return accessMode.at.accessModeType(receiverType, {#if[Object]?fieldType:$type$.class});
|
||||
}
|
||||
|
||||
@Override
|
||||
final boolean internalEquals(VarHandle vh) {
|
||||
FieldInstanceReadOnly that = (FieldInstanceReadOnly) vh;
|
||||
return fieldOffset == that.fieldOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
final int internalHashCode() {
|
||||
return Long.hashCode(fieldOffset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<VarHandleDesc> describeConstable() {
|
||||
var receiverTypeRef = receiverType.describeConstable();
|
||||
@ -349,17 +338,6 @@ final class VarHandle$Type$s {
|
||||
#end[Object]
|
||||
}
|
||||
|
||||
@Override
|
||||
final boolean internalEquals(VarHandle vh) {
|
||||
FieldStaticReadOnly that = (FieldStaticReadOnly) vh;
|
||||
return base == that.base && fieldOffset == that.fieldOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
final int internalHashCode() {
|
||||
return 31 * Long.hashCode(fieldOffset) + base.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<VarHandleDesc> describeConstable() {
|
||||
var fieldTypeRef = {#if[Object]?fieldType:$type$.class}.describeConstable();
|
||||
@ -639,20 +617,6 @@ final class VarHandle$Type$s {
|
||||
#end[Object]
|
||||
}
|
||||
|
||||
@Override
|
||||
final boolean internalEquals(VarHandle vh) {
|
||||
// Equality of access mode types of AccessMode.GET is sufficient for
|
||||
// equality checks
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
final int internalHashCode() {
|
||||
// The hash code of the access mode types of AccessMode.GET is
|
||||
// sufficient for hash code generation
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<VarHandleDesc> describeConstable() {
|
||||
var arrayTypeRef = {#if[Object]?arrayType:$type$[].class}.describeConstable();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -67,17 +67,6 @@ final class VarHandleByteArrayAs$Type$s extends VarHandleByteArrayBase {
|
||||
super(form);
|
||||
this.be = be;
|
||||
}
|
||||
|
||||
@Override
|
||||
final boolean internalEquals(VarHandle vh) {
|
||||
ByteArrayViewVarHandle that = (ByteArrayViewVarHandle) vh;
|
||||
return be == that.be;
|
||||
}
|
||||
|
||||
@Override
|
||||
final int internalHashCode() {
|
||||
return Boolean.hashCode(be);
|
||||
}
|
||||
}
|
||||
|
||||
static final class ArrayHandle extends ByteArrayViewVarHandle {
|
||||
|
@ -31,8 +31,6 @@ import javax.net.ssl.SSLEngineResult.HandshakeStatus;
|
||||
* Ciphertext
|
||||
*/
|
||||
final class Ciphertext {
|
||||
static final Ciphertext CIPHERTEXT_NULL = new Ciphertext();
|
||||
|
||||
final byte contentType;
|
||||
final byte handshakeType;
|
||||
final long recordSN;
|
||||
|
@ -247,6 +247,19 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport {
|
||||
hsStatus = ciphertext.handshakeStatus;
|
||||
} else {
|
||||
hsStatus = getHandshakeStatus();
|
||||
if (ciphertext == null && !conContext.isNegotiated &&
|
||||
conContext.isInboundClosed() &&
|
||||
hsStatus == HandshakeStatus.NEED_WRAP) {
|
||||
// Even the outboud is open, no futher data could be wrapped as:
|
||||
// 1. the outbound is empty
|
||||
// 2. no negotiated connection
|
||||
// 3. the inbound has closed, cannot complete the handshake
|
||||
//
|
||||
// Mark the engine as closed if the handshake status is
|
||||
// NEED_WRAP. Otherwise, it could lead to dead loops in
|
||||
// applications.
|
||||
status = Status.CLOSED;
|
||||
}
|
||||
}
|
||||
|
||||
int deltaSrcs = srcsRemains;
|
||||
@ -279,7 +292,7 @@ final class SSLEngineImpl extends SSLEngine implements SSLTransport {
|
||||
}
|
||||
|
||||
if (ciphertext == null) {
|
||||
return Ciphertext.CIPHERTEXT_NULL;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Is the handshake completed?
|
||||
|
@ -577,13 +577,7 @@ class TransportContext implements ConnectionContext {
|
||||
} else if (!isOutboundClosed()) {
|
||||
// Special case that the inbound was closed, but outbound open.
|
||||
return HandshakeStatus.NEED_WRAP;
|
||||
}
|
||||
} else if (isOutboundClosed() && !isInboundClosed()) {
|
||||
// Special case that the outbound was closed, but inbound open.
|
||||
return HandshakeStatus.NEED_UNWRAP;
|
||||
} else if (!isOutboundClosed() && isInboundClosed()) {
|
||||
// Special case that the inbound was closed, but outbound open.
|
||||
return HandshakeStatus.NEED_WRAP;
|
||||
} // Otherwise, both inbound and outbound are closed.
|
||||
}
|
||||
|
||||
return HandshakeStatus.NOT_HANDSHAKING;
|
||||
|
@ -158,10 +158,14 @@ grant codeBase "jrt:/jdk.internal.vm.compiler" {
|
||||
};
|
||||
|
||||
grant codeBase "jrt:/jdk.internal.vm.compiler.management" {
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.vm.compiler.collections";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.runtime";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.sun.management.spi";
|
||||
permission java.lang.RuntimePermission "sun.management.spi.PlatformMBeanProvider.subclass";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.core.common";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.debug";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.options";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.phases.common.jmx";
|
||||
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.serviceprovider";
|
||||
};
|
||||
|
||||
grant codeBase "jrt:/jdk.jsobject" {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1999, 2019, 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
|
||||
@ -44,7 +44,7 @@ javac.opt.modulepath=\
|
||||
javac.opt.sourcepath=\
|
||||
Specify where to find input source files
|
||||
javac.opt.m=\
|
||||
Compile only the specified module, check timestamps
|
||||
Compile only the specified module(s), check timestamps
|
||||
javac.opt.modulesourcepath=\
|
||||
Specify where to find input source files for multiple modules
|
||||
javac.opt.bootclasspath=\
|
||||
@ -108,7 +108,7 @@ javac.opt.arg.path=\
|
||||
javac.opt.arg.mspath=\
|
||||
<module-source-path>
|
||||
javac.opt.arg.m=\
|
||||
<module-name>
|
||||
<module>(,<module>)*
|
||||
javac.opt.arg.jdk=\
|
||||
<jdk>|none
|
||||
javac.opt.arg.dirs=\
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2009, 2019, 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
|
||||
@ -1759,6 +1759,14 @@ public class AMD64Assembler extends AMD64BaseAssembler {
|
||||
emitOperandHelper(dst, src, 0);
|
||||
}
|
||||
|
||||
public final void cmpb(Register dst, Register src) {
|
||||
CMP.byteRmOp.emit(this, BYTE, dst, src);
|
||||
}
|
||||
|
||||
public final void cmpw(Register dst, Register src) {
|
||||
CMP.rmOp.emit(this, WORD, dst, src);
|
||||
}
|
||||
|
||||
public final void cmpl(Register dst, int imm32) {
|
||||
CMP.getMIOpcode(DWORD, isByte(imm32)).emit(this, DWORD, dst, imm32);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 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
|
||||
@ -125,6 +125,14 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
return kind == JavaKind.Char;
|
||||
}
|
||||
|
||||
private JavaKind getComparisonKind() {
|
||||
return findTwoConsecutive ? (byteMode(kind) ? JavaKind.Char : JavaKind.Int) : kind;
|
||||
}
|
||||
|
||||
private AVXKind.AVXSize getVectorSize() {
|
||||
return AVXKind.getDataSize(vectorKind);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) {
|
||||
Register arrayPtr = asRegister(arrayPtrValue);
|
||||
@ -159,9 +167,6 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
Label retNotFound = new Label();
|
||||
Label end = new Label();
|
||||
|
||||
AVXKind.AVXSize vectorSize = AVXKind.getDataSize(vectorKind);
|
||||
int nVectors = nValues == 1 ? 4 : nValues == 2 ? 2 : 1;
|
||||
|
||||
// load array length
|
||||
// important: this must be the first register manipulation, since arrayLengthValue is
|
||||
// annotated with @Use
|
||||
@ -178,10 +183,10 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
}
|
||||
// fill comparison vector with copies of the search value
|
||||
for (int i = 0; i < nValues; i++) {
|
||||
emitBroadcast(asm, findTwoConsecutive ? (byteMode(kind) ? JavaKind.Char : JavaKind.Int) : kind, vecCmp[i], vecArray[0], vectorSize);
|
||||
emitBroadcast(asm, getComparisonKind(), vecCmp[i], vecArray[0], getVectorSize());
|
||||
}
|
||||
|
||||
emitArrayIndexOfChars(crb, asm, kind, vectorSize, result, slotsRemaining, searchValue, vecCmp, vecArray, cmpResult, retFound, retNotFound, vmPageSize, nValues, nVectors, findTwoConsecutive);
|
||||
emitArrayIndexOfChars(crb, asm, result, slotsRemaining, searchValue, vecCmp, vecArray, cmpResult, retFound, retNotFound);
|
||||
|
||||
// return -1 (no match)
|
||||
asm.bind(retNotFound);
|
||||
@ -197,7 +202,7 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
asm.bind(end);
|
||||
}
|
||||
|
||||
private static void emitArrayIndexOfChars(CompilationResultBuilder crb, AMD64MacroAssembler asm, JavaKind kind, AVXKind.AVXSize vectorSize,
|
||||
private void emitArrayIndexOfChars(CompilationResultBuilder crb, AMD64MacroAssembler asm,
|
||||
Register arrayPtr,
|
||||
Register slotsRemaining,
|
||||
Register[] searchValue,
|
||||
@ -205,11 +210,10 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
Register[] vecArray,
|
||||
Register[] cmpResult,
|
||||
Label retFound,
|
||||
Label retNotFound,
|
||||
int vmPageSize,
|
||||
int nValues,
|
||||
int nVectors,
|
||||
boolean findTwoCharPrefix) {
|
||||
Label retNotFound) {
|
||||
int nVectors = nValues == 1 ? 4 : nValues == 2 ? 2 : 1;
|
||||
AVXKind.AVXSize vectorSize = getVectorSize();
|
||||
|
||||
Label bulkVectorLoop = new Label();
|
||||
Label singleVectorLoop = new Label();
|
||||
Label[] vectorFound = {
|
||||
@ -229,7 +233,7 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
int bulkLoopCondition = bulkSize;
|
||||
int[] vectorOffsets;
|
||||
JavaKind vectorCompareKind = kind;
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
singleVectorLoopCondition++;
|
||||
bulkLoopCondition++;
|
||||
bulkSize /= 2;
|
||||
@ -274,7 +278,7 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
emitAlign(crb, asm);
|
||||
asm.bind(bulkVectorLoop);
|
||||
// memory-aligned bulk comparison
|
||||
emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, nVectors, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, !findTwoCharPrefix);
|
||||
emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, nVectors, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, !findTwoConsecutive);
|
||||
// adjust number of array slots remaining
|
||||
asm.subl(slotsRemaining, bulkSize);
|
||||
// adjust array pointer
|
||||
@ -293,7 +297,7 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
asm.cmpl(slotsRemaining, singleVectorLoopCondition);
|
||||
asm.jcc(AMD64Assembler.ConditionFlag.Below, lessThanVectorSizeRemaining);
|
||||
// compare
|
||||
emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoCharPrefix ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, false);
|
||||
emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoConsecutive ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, vectorFound, false);
|
||||
// adjust number of array slots remaining
|
||||
asm.subl(slotsRemaining, arraySlotsPerVector);
|
||||
// adjust array pointer
|
||||
@ -313,16 +317,16 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
asm.movl(tmpArrayPtrLow, arrayPtr);
|
||||
// check if pointer + vector size would cross the page boundary
|
||||
asm.andl(tmpArrayPtrLow, (vmPageSize - 1));
|
||||
asm.cmpl(tmpArrayPtrLow, (vmPageSize - (findTwoCharPrefix ? bytesPerVector + kind.getByteCount() : bytesPerVector)));
|
||||
asm.cmpl(tmpArrayPtrLow, (vmPageSize - (findTwoConsecutive ? bytesPerVector + kind.getByteCount() : bytesPerVector)));
|
||||
// if the page boundary would be crossed, do byte/character-wise comparison instead.
|
||||
asm.jccb(AMD64Assembler.ConditionFlag.Above, lessThanVectorSizeRemainingLoop);
|
||||
|
||||
Label[] overBoundsMatch = {new Label(), new Label()};
|
||||
// otherwise, do a vector compare that reads beyond array bounds
|
||||
emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoCharPrefix ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, overBoundsMatch, false);
|
||||
emitVectorCompare(asm, vectorCompareKind, vectorSize, nValues, findTwoConsecutive ? 2 : 1, vectorOffsets, arrayPtr, vecCmp, vecArray, cmpResult, overBoundsMatch, false);
|
||||
// no match
|
||||
asm.jmp(retNotFound);
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
Label overBoundsFinish = new Label();
|
||||
asm.bind(overBoundsMatch[1]);
|
||||
// get match offset of second result
|
||||
@ -348,14 +352,14 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
}
|
||||
// check if offset of matched value is greater than number of bytes remaining / out of array
|
||||
// bounds
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
asm.decrementl(slotsRemaining);
|
||||
}
|
||||
asm.cmpl(cmpResult[0], slotsRemaining);
|
||||
// match is out of bounds, return no match
|
||||
asm.jcc(AMD64Assembler.ConditionFlag.GreaterEqual, retNotFound);
|
||||
// adjust number of array slots remaining
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
asm.incrementl(slotsRemaining, 1);
|
||||
}
|
||||
asm.subl(slotsRemaining, cmpResult[0]);
|
||||
@ -365,17 +369,17 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
// compare remaining slots in the array one-by-one
|
||||
asm.bind(lessThanVectorSizeRemainingLoop);
|
||||
// check if enough array slots remain
|
||||
asm.cmpl(slotsRemaining, findTwoCharPrefix ? 1 : 0);
|
||||
asm.cmpl(slotsRemaining, findTwoConsecutive ? 1 : 0);
|
||||
asm.jcc(AMD64Assembler.ConditionFlag.LessEqual, retNotFound);
|
||||
// load char / byte
|
||||
if (byteMode(kind)) {
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
asm.movzwl(cmpResult[0], new AMD64Address(arrayPtr));
|
||||
} else {
|
||||
asm.movzbl(cmpResult[0], new AMD64Address(arrayPtr));
|
||||
}
|
||||
} else {
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
asm.movl(cmpResult[0], new AMD64Address(arrayPtr));
|
||||
} else {
|
||||
asm.movzwl(cmpResult[0], new AMD64Address(arrayPtr));
|
||||
@ -383,7 +387,7 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
}
|
||||
// check for match
|
||||
for (int i = 0; i < nValues; i++) {
|
||||
asm.cmpl(cmpResult[0], searchValue[i]);
|
||||
emitCompareInst(asm, getComparisonKind(), cmpResult[0], searchValue[i]);
|
||||
asm.jcc(AMD64Assembler.ConditionFlag.Equal, retFound);
|
||||
}
|
||||
// adjust number of array slots remaining
|
||||
@ -393,11 +397,11 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
// continue loop
|
||||
asm.jmpb(lessThanVectorSizeRemainingLoop);
|
||||
|
||||
for (int i = 1; i < nVectors; i += (findTwoCharPrefix ? 2 : 1)) {
|
||||
for (int i = 1; i < nVectors; i += (findTwoConsecutive ? 2 : 1)) {
|
||||
emitVectorFoundWithOffset(asm, kind, vectorOffsets[i], arrayPtr, cmpResult[i], slotsRemaining, vectorFound[i], retFound);
|
||||
}
|
||||
|
||||
if (findTwoCharPrefix) {
|
||||
if (findTwoConsecutive) {
|
||||
asm.bind(vectorFound[2]);
|
||||
asm.addq(arrayPtr, vectorOffsets[2]);
|
||||
// adjust number of array slots remaining
|
||||
@ -626,6 +630,23 @@ public final class AMD64ArrayIndexOfOp extends AMD64LIRInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
private static void emitCompareInst(AMD64MacroAssembler asm, JavaKind kind, Register dst, Register src) {
|
||||
switch (kind) {
|
||||
case Byte:
|
||||
asm.cmpb(dst, src);
|
||||
break;
|
||||
case Short:
|
||||
case Char:
|
||||
asm.cmpw(dst, src);
|
||||
break;
|
||||
case Int:
|
||||
asm.cmpl(dst, src);
|
||||
break;
|
||||
default:
|
||||
asm.cmpq(dst, src);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean supportsAVX2(LIRGeneratorTool tool) {
|
||||
return supports(tool, CPUFeature.AVX2);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ class ConsoleIOContext extends IOContext {
|
||||
it.set(current);
|
||||
}
|
||||
|
||||
historyLoad = Instant.now();
|
||||
historyLoad = Instant.MIN;
|
||||
loadHistory.forEach(line -> reader.getHistory().add(historyLoad, line));
|
||||
|
||||
in = reader;
|
||||
|
@ -85,7 +85,6 @@ gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8193639 solaris-all
|
||||
|
||||
runtime/appcds/javaldr/GCSharedStringsDuringDump.java 8208778 macosx-x64
|
||||
runtime/appcds/javaldr/GCDuringDump.java 8208778 macosx-x64
|
||||
runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 8213299 generic-all
|
||||
runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
|
||||
runtime/handshake/HandshakeWalkSuspendExitTest.java 8214174 generic-all
|
||||
runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64
|
||||
|
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 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 8216549
|
||||
* @summary Mismatched unsafe access to non escaping object fails
|
||||
*
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation MismatchedUnsafeLoadFromNewObject
|
||||
*/
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class MismatchedUnsafeLoadFromNewObject {
|
||||
public volatile int f_int = -1;
|
||||
public volatile int f_int2 = -1;
|
||||
|
||||
public static Unsafe unsafe = Unsafe.getUnsafe();
|
||||
public static final long f_int_off;
|
||||
public static final long f_int2_off;
|
||||
|
||||
static {
|
||||
Field f_int_field = null;
|
||||
Field f_int2_field = null;
|
||||
try {
|
||||
f_int_field = MismatchedUnsafeLoadFromNewObject.class.getField("f_int");
|
||||
f_int2_field = MismatchedUnsafeLoadFromNewObject.class.getField("f_int2");
|
||||
} catch (Exception e) {
|
||||
System.out.println("reflection failed " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
f_int_off = unsafe.objectFieldOffset(f_int_field);
|
||||
f_int2_off = unsafe.objectFieldOffset(f_int2_field);
|
||||
}
|
||||
|
||||
static public void main(String[] args) {
|
||||
for (int i = 0; i < 20_000; i++) {
|
||||
byte res = test1();
|
||||
if (res != -1) {
|
||||
throw new RuntimeException("Incorrect result: " + res);
|
||||
}
|
||||
res = test2();
|
||||
if (res != -1) {
|
||||
throw new RuntimeException("Incorrect result: " + res);
|
||||
}
|
||||
int res2 = test3();
|
||||
if (res2 != -1) {
|
||||
throw new RuntimeException("Incorrect result: " + res2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static byte test1() {
|
||||
MismatchedUnsafeLoadFromNewObject t = new MismatchedUnsafeLoadFromNewObject();
|
||||
return unsafe.getByte(t, f_int_off);
|
||||
}
|
||||
|
||||
static byte test2() {
|
||||
MismatchedUnsafeLoadFromNewObject t = new MismatchedUnsafeLoadFromNewObject();
|
||||
return unsafe.getByte(t, f_int_off+1);
|
||||
}
|
||||
|
||||
static int test3() {
|
||||
MismatchedUnsafeLoadFromNewObject t = new MismatchedUnsafeLoadFromNewObject();
|
||||
if (f_int_off < f_int2_off) {
|
||||
return unsafe.getIntUnaligned(t, f_int_off+1);
|
||||
} else {
|
||||
return unsafe.getIntUnaligned(t, f_int2_off+1);
|
||||
}
|
||||
}
|
||||
}
|
@ -583,7 +583,6 @@ java/nio/file/WatchService/MayFlies.java 7158947 solaris-
|
||||
java/nio/file/WatchService/LotsOfCancels.java 8188039 solaris-all Solaris 11
|
||||
java/nio/file/WatchService/LotsOfEvents.java 7158947 solaris-all Solaris 11
|
||||
|
||||
sun/nio/cs/OLD/TestIBMDB.java 8211841 aix-ppc64
|
||||
|
||||
############################################################################
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019, 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
|
||||
@ -67,7 +67,6 @@ public class CondyDescTest extends SymbolicDescTest {
|
||||
|
||||
private void testVarHandleDesc(DynamicConstantDesc<VarHandle> r, VarHandle vh) throws ReflectiveOperationException {
|
||||
testSymbolicDesc(r);
|
||||
assertEquals(r.resolveConstantDesc(LOOKUP), vh);
|
||||
assertEquals(vh.describeConstable().orElseThrow(), r);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessBoolean extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessByte extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessChar extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessDouble extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessFloat extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessInt extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessLong extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -141,8 +141,6 @@ public class VarHandleTestAccessShort extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -143,8 +143,6 @@ public class VarHandleTestAccessString extends VarHandleBaseTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -93,8 +93,6 @@ public class VarHandleTestByteArrayAsChar extends VarHandleBaseByteArrayTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -93,8 +93,6 @@ public class VarHandleTestByteArrayAsDouble extends VarHandleBaseByteArrayTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -93,8 +93,6 @@ public class VarHandleTestByteArrayAsFloat extends VarHandleBaseByteArrayTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -93,8 +93,6 @@ public class VarHandleTestByteArrayAsInt extends VarHandleBaseByteArrayTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -93,8 +93,6 @@ public class VarHandleTestByteArrayAsLong extends VarHandleBaseByteArrayTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -93,8 +93,6 @@ public class VarHandleTestByteArrayAsShort extends VarHandleBaseByteArrayTest {
|
||||
for (int j = 0; j < vhs1.length; j++) {
|
||||
if (i == j) {
|
||||
assertEquals(vhs1[i], vhs1[i]);
|
||||
assertEquals(vhs1[i], vhs2[i]);
|
||||
assertEquals(vhs1[i].hashCode(), vhs2[i].hashCode());
|
||||
}
|
||||
else {
|
||||
assertNotEquals(vhs1[i], vhs1[j]);
|
||||
|
@ -31,7 +31,7 @@ import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import sun.nio.cs.HistoricallyNamedCharset;
|
||||
import sun.nio.cs.*;
|
||||
import sun.nio.cs.ext.*;
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import sun.nio.cs.HistoricallyNamedCharset;
|
||||
import sun.nio.cs.*;
|
||||
import sun.nio.cs.ext.*;
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import sun.nio.cs.HistoricallyNamedCharset;
|
||||
import sun.nio.cs.*;
|
||||
import sun.nio.cs.ext.*;
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
import sun.nio.cs.HistoricallyNamedCharset;
|
||||
import sun.nio.cs.*;
|
||||
import sun.nio.cs.ext.*;
|
||||
|
||||
|
||||
|
@ -33,8 +33,7 @@ import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CoderResult;
|
||||
import sun.nio.cs.HistoricallyNamedCharset;
|
||||
import sun.nio.cs.Surrogate;
|
||||
import sun.nio.cs.*;
|
||||
import sun.nio.cs.ext.*;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user