Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First refactoring (thaw_fast) #158

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
@@ -5062,7 +5062,7 @@ int jdk_internal_vm_StackChunk::_sp_offset;
int jdk_internal_vm_StackChunk::_pc_offset;
int jdk_internal_vm_StackChunk::_argsize_offset;
int jdk_internal_vm_StackChunk::_flags_offset;
int jdk_internal_vm_StackChunk::_maxSize_offset;
int jdk_internal_vm_StackChunk::_maxThawingSize_offset;
int jdk_internal_vm_StackChunk::_cont_offset;

#define STACKCHUNK_FIELDS_DO(macro) \
14 changes: 7 additions & 7 deletions src/hotspot/share/classfile/javaClasses.hpp
Original file line number Diff line number Diff line change
@@ -1126,10 +1126,10 @@ class jdk_internal_vm_Continuation: AllStatic {

// Interface to jdk.internal.vm.StackChunk objects
#define STACKCHUNK_INJECTED_FIELDS(macro) \
macro(jdk_internal_vm_StackChunk, cont, continuation_signature, false) \
macro(jdk_internal_vm_StackChunk, flags, byte_signature, false) \
macro(jdk_internal_vm_StackChunk, pc, intptr_signature, false) \
macro(jdk_internal_vm_StackChunk, maxSize, int_signature, false) \
macro(jdk_internal_vm_StackChunk, cont, continuation_signature, false) \
macro(jdk_internal_vm_StackChunk, flags, byte_signature, false) \
macro(jdk_internal_vm_StackChunk, pc, intptr_signature, false) \
macro(jdk_internal_vm_StackChunk, maxThawingSize, int_signature, false) \

class jdk_internal_vm_StackChunk: AllStatic {
friend class JavaClasses;
@@ -1140,7 +1140,7 @@ class jdk_internal_vm_StackChunk: AllStatic {
static int _pc_offset;
static int _argsize_offset;
static int _flags_offset;
static int _maxSize_offset;
static int _maxThawingSize_offset;
static int _cont_offset;


@@ -1175,8 +1175,8 @@ class jdk_internal_vm_StackChunk: AllStatic {
static inline void release_set_flags(oop chunk, uint8_t value);
static inline bool try_set_flags(oop chunk, uint8_t expected_value, uint8_t new_value);

static inline int maxSize(oop chunk);
static inline void set_maxSize(oop chunk, int value);
static inline int maxThawingSize(oop chunk);
static inline void set_maxThawingSize(oop chunk, int value);

// cont oop's processing is essential for the chunk's GC protocol
static inline oop cont(oop chunk);
10 changes: 5 additions & 5 deletions src/hotspot/share/classfile/javaClasses.inline.hpp
Original file line number Diff line number Diff line change
@@ -362,16 +362,16 @@ inline bool jdk_internal_vm_StackChunk::try_set_flags(oop chunk, uint8_t expecte
return Atomic::cmpxchg(chunk->field_addr<uint8_t>(_flags_offset), expected_value, new_value) == expected_value;
}

inline int jdk_internal_vm_StackChunk::maxSize(oop chunk) {
return chunk->int_field(_maxSize_offset);
inline int jdk_internal_vm_StackChunk::maxThawingSize(oop chunk) {
return chunk->int_field(_maxThawingSize_offset);
}

inline void jdk_internal_vm_StackChunk::set_maxSize(oop chunk, int value) {
inline void jdk_internal_vm_StackChunk::set_maxThawingSize(oop chunk, int value) {
#ifdef ASSERT
jint old = maxSize(chunk);
jint old = maxThawingSize(chunk);
log_develop_trace(continuations)("%s max_size: %d -> %d", value >= old ? "add" : "sub", old, value);
#endif
chunk->int_field_put(_maxSize_offset, value);
chunk->int_field_put(_maxThawingSize_offset, value);
}

inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) {
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/vmSymbols.hpp
Original file line number Diff line number Diff line change
@@ -525,6 +525,7 @@
template(checkIndex_name, "checkIndex") \
template(scoped_cache_shift_name, "SCOPED_CACHE_SHIFT") \
template(jfr_epoch_name, "jfr_epoch") \
template(maxThawingSize_name, "maxThawingSize") \
\
/* name symbols needed by intrinsics */ \
VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/instanceStackChunkKlass.cpp
Original file line number Diff line number Diff line change
@@ -239,7 +239,7 @@ void InstanceStackChunkKlass::print_chunk(const stackChunkOop c, bool verbose, o
c->requires_barriers(), c->is_gc_mode(), c->has_bitmap(), p2i((oopDesc*)c->parent()));
st->print_cr(" flags mixed: %d", c->has_mixed_frames());
st->print_cr(" size: %d argsize: %d max_size: %d sp: %d pc: " INTPTR_FORMAT,
c->stack_size(), c->argsize(), c->max_size(), c->sp(), p2i(c->pc()));
c->stack_size(), c->argsize(), c->max_thawing_size(), c->sp(), p2i(c->pc()));

if (verbose) {
st->cr();
6 changes: 3 additions & 3 deletions src/hotspot/share/oops/stackChunkOop.cpp
Original file line number Diff line number Diff line change
@@ -570,7 +570,7 @@ bool stackChunkOopDesc::verify(size_t* out_size, int* out_oops, int* out_frames,

if (is_empty()) {
assert(argsize() == 0, "");
assert(max_size() == 0, "");
assert(max_thawing_size() == 0, "");
}

assert(oopDesc::is_oop_or_null(parent()), "");
@@ -612,9 +612,9 @@ bool stackChunkOopDesc::verify(size_t* out_size, int* out_oops, int* out_frames,
int calculated_max_size = closure._size
+ closure._num_i2c * frame::align_wiggle
+ closure._num_interpreted_frames * frame::align_wiggle;
assert(max_size() == calculated_max_size,
assert(max_thawing_size() == calculated_max_size,
"max_size(): %d calculated_max_size: %d argsize: %d num_i2c: %d",
max_size(), calculated_max_size, closure._argsize, closure._num_i2c);
max_thawing_size(), calculated_max_size, closure._argsize, closure._num_i2c);

if (out_size != nullptr) *out_size += size;
if (out_oops != nullptr) *out_oops += closure._num_oops;
4 changes: 2 additions & 2 deletions src/hotspot/share/oops/stackChunkOop.hpp
Original file line number Diff line number Diff line change
@@ -86,8 +86,8 @@ class stackChunkOopDesc : public instanceOopDesc {
inline void set_flags(uint8_t value);
inline void release_set_flags(uint8_t value);

inline int max_size() const;
inline void set_max_size(int value);
inline int max_thawing_size() const;
inline void set_max_thawing_size(int value);

inline oop cont() const;
template<typename P> inline oop cont() const;
6 changes: 3 additions & 3 deletions src/hotspot/share/oops/stackChunkOop.inline.hpp
Original file line number Diff line number Diff line change
@@ -76,10 +76,10 @@ inline bool stackChunkOopDesc::try_set_flags(uint8_t prev_flags, uint8_t new_fla
return jdk_internal_vm_StackChunk::try_set_flags(this, prev_flags, new_flags);
}

inline int stackChunkOopDesc::max_size() const { return jdk_internal_vm_StackChunk::maxSize(as_oop()); }
inline void stackChunkOopDesc::set_max_size(int value) {
inline int stackChunkOopDesc::max_thawing_size() const { return jdk_internal_vm_StackChunk::maxThawingSize(as_oop()); }
inline void stackChunkOopDesc::set_max_thawing_size(int value) {
assert(value >= 0, "size must be >= 0");
jdk_internal_vm_StackChunk::set_maxSize(this, (jint)value);
jdk_internal_vm_StackChunk::set_maxThawingSize(this, (jint)value);
}

inline oop stackChunkOopDesc::cont() const { return UseCompressedOops ? cont<narrowOop>() : cont<oop>(); /* jdk_internal_vm_StackChunk::cont(as_oop()); */ }
219 changes: 128 additions & 91 deletions src/hotspot/share/runtime/continuationFreezeThaw.cpp

Large diffs are not rendered by default.