Skip to content

Commit

Permalink
8288129: Shenandoah: Skynet test crashed with iu + aggressive
Browse files Browse the repository at this point in the history
Reviewed-by: eosterlund, rkennke
  • Loading branch information
ashu-mehra authored and adinn committed Sep 21, 2022
1 parent 07afa3f commit 84d7ff6
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.cpp
Expand Up @@ -51,9 +51,6 @@ void ShenandoahIUMode::initialize_flags() const {
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
}

// Disable Loom
SHENANDOAH_ERGO_DISABLE_FLAG(VMContinuations);

SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);
SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/access.hpp
Expand Up @@ -118,7 +118,7 @@ class Access: public AllStatic {
template <DecoratorSet expected_mo_decorators>
static void verify_heap_oop_decorators() {
const DecoratorSet heap_oop_decorators = AS_DECORATOR_MASK | ON_DECORATOR_MASK |
IN_HEAP | IS_ARRAY | IS_NOT_NULL;
IN_HEAP | IS_ARRAY | IS_NOT_NULL | IS_DEST_UNINITIALIZED;
verify_decorators<expected_mo_decorators | heap_oop_decorators>();
}

Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/share/oops/oop.hpp
Expand Up @@ -147,12 +147,15 @@ class oopDesc {
}

// Access to fields in a instanceOop through these methods.
template <DecoratorSet decorator>
template<DecoratorSet decorators>
oop obj_field_access(int offset) const;
oop obj_field(int offset) const;

void obj_field_put(int offset, oop value);
void obj_field_put_raw(int offset, oop value);
void obj_field_put_volatile(int offset, oop value);
template<DecoratorSet decorators>
void obj_field_put_access(int offset, oop value);

Metadata* metadata_field(int offset) const;
void metadata_field_put(int offset, Metadata* value);
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/oops/oop.inline.hpp
Expand Up @@ -207,6 +207,8 @@ inline oop oopDesc::obj_field_access(int offset) const { return Hea
inline oop oopDesc::obj_field(int offset) const { return HeapAccess<>::oop_load_at(as_oop(), offset); }

inline void oopDesc::obj_field_put(int offset, oop value) { HeapAccess<>::oop_store_at(as_oop(), offset, value); }
template <DecoratorSet decorators>
inline void oopDesc::obj_field_put_access(int offset, oop value) { HeapAccess<decorators>::oop_store_at(as_oop(), offset, value); }

inline jbyte oopDesc::byte_field(int offset) const { return *field_addr<jbyte>(offset); }
inline void oopDesc::byte_field_put(int offset, jbyte value) { *field_addr<jbyte>(offset) = value; }
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/oops/stackChunkOop.hpp
Expand Up @@ -71,6 +71,8 @@ class stackChunkOopDesc : public instanceOopDesc {
inline bool is_parent_null() const;
template<typename P>
inline void set_parent_raw(oop value);
template<DecoratorSet decorators>
inline void set_parent_access(oop value);

inline int stack_size() const;

Expand All @@ -96,6 +98,8 @@ class stackChunkOopDesc : public instanceOopDesc {
inline void set_cont(oop value);
template<typename P>
inline void set_cont_raw(oop value);
template<DecoratorSet decorators>
inline void set_cont_access(oop value);

inline int bottom() const;

Expand Down
8 changes: 6 additions & 2 deletions src/hotspot/share/oops/stackChunkOop.inline.hpp
Expand Up @@ -52,6 +52,8 @@ inline bool stackChunkOopDesc::is_parent_null() const { return jdk_inte
inline void stackChunkOopDesc::set_parent(stackChunkOop value) { jdk_internal_vm_StackChunk::set_parent(this, value); }
template<typename P>
inline void stackChunkOopDesc::set_parent_raw(oop value) { jdk_internal_vm_StackChunk::set_parent_raw<P>(this, value); }
template<DecoratorSet decorators>
inline void stackChunkOopDesc::set_parent_access(oop value) { jdk_internal_vm_StackChunk::set_parent_access<decorators>(this, value); }

inline int stackChunkOopDesc::stack_size() const { return jdk_internal_vm_StackChunk::size(as_oop()); }

Expand Down Expand Up @@ -90,9 +92,11 @@ inline oop stackChunkOopDesc::cont() const {
obj = (oop)NativeAccess<>::oop_load(&obj);
return obj;
}
inline void stackChunkOopDesc::set_cont(oop value) { jdk_internal_vm_StackChunk::set_cont(this, value); }
inline void stackChunkOopDesc::set_cont(oop value) { jdk_internal_vm_StackChunk::set_cont(this, value); }
template<typename P>
inline void stackChunkOopDesc::set_cont_raw(oop value) { jdk_internal_vm_StackChunk::set_cont_raw<P>(this, value); }
inline void stackChunkOopDesc::set_cont_raw(oop value) { jdk_internal_vm_StackChunk::set_cont_raw<P>(this, value); }
template<DecoratorSet decorators>
inline void stackChunkOopDesc::set_cont_access(oop value) { jdk_internal_vm_StackChunk::set_cont_access<decorators>(this, value); }

inline int stackChunkOopDesc::bottom() const { return stack_size() - argsize(); }

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/continuationFreezeThaw.cpp
Expand Up @@ -1290,8 +1290,8 @@ stackChunkOop Freeze<ConfigT>::allocate_chunk(size_t stack_size) {
assert(chunk->is_gc_mode() == false, "");

// fields are uninitialized
chunk->set_parent_raw<typename ConfigT::OopT>(_cont.last_nonempty_chunk());
chunk->set_cont_raw<typename ConfigT::OopT>(_cont.continuation());
chunk->set_parent_access<IS_DEST_UNINITIALIZED>(_cont.last_nonempty_chunk());
chunk->set_cont_access<IS_DEST_UNINITIALIZED>(_cont.continuation());

assert(chunk->parent() == nullptr || chunk->parent()->is_stackChunk(), "");

Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/runtime/continuationJavaClasses.hpp
Expand Up @@ -109,6 +109,8 @@ class jdk_internal_vm_StackChunk: AllStatic {
static inline bool is_parent_null(oop chunk); // bypasses barriers for a faster test
template<typename P>
static inline void set_parent_raw(oop chunk, oop value);
template<DecoratorSet decorators>
static inline void set_parent_access(oop chunk, oop value);

static inline int size(oop chunk);
static inline void set_size(HeapWord* chunk, int value);
Expand Down Expand Up @@ -136,6 +138,8 @@ class jdk_internal_vm_StackChunk: AllStatic {
static inline oop cont_raw(oop chunk);
template<typename P>
static inline void set_cont_raw(oop chunk, oop value);
template<DecoratorSet decorators>
static inline void set_cont_access(oop chunk, oop value);
};

#endif // SHARE_RUNTIME_CONTINUATIONJAVACLASSES_HPP
10 changes: 10 additions & 0 deletions src/hotspot/share/runtime/continuationJavaClasses.inline.hpp
Expand Up @@ -97,6 +97,11 @@ inline void jdk_internal_vm_StackChunk::set_parent_raw(oop chunk, oop value) {
RawAccess<>::oop_store(chunk->field_addr<P>(_parent_offset), value);
}

template<DecoratorSet decorators>
inline void jdk_internal_vm_StackChunk::set_parent_access(oop chunk, oop value) {
chunk->obj_field_put_access<decorators>(_parent_offset, value);
}

inline oop jdk_internal_vm_StackChunk::cont(oop chunk) {
return chunk->obj_field(_cont_offset);
}
Expand All @@ -115,6 +120,11 @@ inline void jdk_internal_vm_StackChunk::set_cont_raw(oop chunk, oop value) {
RawAccess<>::oop_store(chunk->field_addr<P>(_cont_offset), value);
}

template<DecoratorSet decorators>
inline void jdk_internal_vm_StackChunk::set_cont_access(oop chunk, oop value) {
chunk->obj_field_put_access<decorators>(_cont_offset, value);
}

inline int jdk_internal_vm_StackChunk::size(oop chunk) {
return chunk->int_field(_size_offset);
}
Expand Down

1 comment on commit 84d7ff6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.