Skip to content

Commit

Permalink
8288935: Remove excessive includes introduced in loom
Browse files Browse the repository at this point in the history
Reviewed-by: rehn, stefank
  • Loading branch information
iklam committed Jun 24, 2022
1 parent 239b4bb commit f67c536
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 46 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/gc/shared/memAllocator.cpp
Expand Up @@ -23,6 +23,8 @@
*/

#include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/vmClasses.hpp"
#include "gc/shared/allocTracer.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/memAllocator.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/oops/instanceStackChunkKlass.cpp
Expand Up @@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "classfile/vmClasses.hpp"
#include "compiler/oopMap.inline.hpp"
#include "gc/shared/gc_globals.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceStackChunkKlass.inline.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/instanceStackChunkKlass.hpp
Expand Up @@ -25,13 +25,13 @@
#ifndef SHARE_OOPS_INSTANCESTACKCHUNKKLASS_HPP
#define SHARE_OOPS_INSTANCESTACKCHUNKKLASS_HPP

#include "memory/memRegion.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"

class ClassFileParser;
class MemRegion;

// An InstanceStackChunkKlass is a specialization of the InstanceKlass.
//
Expand Down
13 changes: 0 additions & 13 deletions src/hotspot/share/oops/instanceStackChunkKlass.inline.hpp
Expand Up @@ -26,24 +26,11 @@

#include "oops/instanceStackChunkKlass.hpp"

#include "code/codeBlob.inline.hpp"
#include "code/codeCache.inline.hpp"
#include "code/nativeInst.hpp"
#include "compiler/oopMap.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/gc_globals.hpp"
#include "logging/log.hpp"
#include "oops/instanceKlass.inline.hpp"
#include "oops/klass.hpp"
#include "oops/oop.inline.hpp"
#include "oops/stackChunkOop.inline.hpp"
#include "runtime/continuationJavaClasses.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/globals.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/smallRegisterMap.inline.hpp"
#include "runtime/stackChunkFrameStream.inline.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/debug.hpp"
#include "utilities/devirtualizer.inline.hpp"
Expand Down
8 changes: 8 additions & 0 deletions src/hotspot/share/runtime/continuation.cpp
Expand Up @@ -23,6 +23,7 @@
*/

#include "precompiled.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "runtime/arguments.hpp"
#include "runtime/continuation.hpp"
#include "runtime/continuationEntry.inline.hpp"
Expand Down Expand Up @@ -149,6 +150,13 @@ ContinuationEntry* Continuation::get_continuation_entry_for_sp(JavaThread* threa
return entry;
}

ContinuationEntry* Continuation::get_continuation_entry_for_entry_frame(JavaThread* thread, const frame& f) {
assert(is_continuation_enterSpecial(f), "");
ContinuationEntry* entry = (ContinuationEntry*)f.unextended_sp();
assert(entry == get_continuation_entry_for_sp(thread, f.sp()-2), "mismatched entry");
return entry;
}

bool Continuation::is_frame_in_continuation(JavaThread* thread, const frame& f) {
return f.is_heap_frame() || (get_continuation_entry_for_sp(thread, f.unextended_sp()) != nullptr);
}
Expand Down
17 changes: 7 additions & 10 deletions src/hotspot/share/runtime/continuation.hpp
Expand Up @@ -25,13 +25,16 @@
#ifndef SHARE_VM_RUNTIME_CONTINUATION_HPP
#define SHARE_VM_RUNTIME_CONTINUATION_HPP

#include "memory/allStatic.hpp"
#include "oops/oopsHierarchy.hpp"
#include "memory/iterator.hpp"
#include "runtime/frame.hpp"
#include "runtime/globals.hpp"
#include "jni.h"

class ContinuationEntry;
class frame;
class FrameValues;
class Handle;
class outputStream;
class RegisterMap;

class Continuations : public AllStatic {
private:
Expand Down Expand Up @@ -84,13 +87,7 @@ class Continuation : AllStatic {
static const ContinuationEntry* last_continuation(const JavaThread* thread, oop cont_scope);
static ContinuationEntry* get_continuation_entry_for_continuation(JavaThread* thread, oop continuation);
static ContinuationEntry* get_continuation_entry_for_sp(JavaThread* thread, intptr_t* const sp);

static ContinuationEntry* get_continuation_entry_for_entry_frame(JavaThread* thread, const frame& f) {
assert(is_continuation_enterSpecial(f), "");
ContinuationEntry* entry = (ContinuationEntry*)f.unextended_sp();
assert(entry == get_continuation_entry_for_sp(thread, f.sp()-2), "mismatched entry");
return entry;
}
static ContinuationEntry* get_continuation_entry_for_entry_frame(JavaThread* thread, const frame& f);

static bool is_continuation_mounted(JavaThread* thread, oop continuation);
static bool is_continuation_scope_mounted(JavaThread* thread, oop cont_scope);
Expand Down
14 changes: 14 additions & 0 deletions src/hotspot/share/runtime/continuationEntry.cpp
Expand Up @@ -71,6 +71,20 @@ void ContinuationEntry::setup_oopmap(OopMap* map) {
map->set_oop(VMRegImpl::stack2reg(in_bytes(chunk_offset()) / VMRegImpl::stack_slot_size));
}

#ifndef PRODUCT
void ContinuationEntry::describe(FrameValues& values, int frame_no) const {
address usp = (address)this;
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::parent_offset())), "parent");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::cont_offset())), "continuation");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::flags_offset())), "flags");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::chunk_offset())), "chunk");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::argsize_offset())), "argsize");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::pin_count_offset())), "pin_count");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::parent_cont_fastpath_offset())), "parent fastpath");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::parent_held_monitor_count_offset())), "parent held monitor count");
}
#endif

#ifdef ASSERT
bool ContinuationEntry::assert_entry_frame_laid_out(JavaThread* thread) {
assert(thread->has_last_Java_frame(), "Wrong place to use this assertion");
Expand Down
26 changes: 5 additions & 21 deletions src/hotspot/share/runtime/continuationEntry.hpp
Expand Up @@ -30,9 +30,10 @@
#include "runtime/continuation.hpp"
#include "utilities/sizes.hpp"

class RegisterMap;
class OopMap;
class CompiledMethod;
class JavaThread;
class OopMap;
class RegisterMap;

// Metadata stored in the continuation entry frame
class ContinuationEntry {
Expand Down Expand Up @@ -112,32 +113,15 @@ class ContinuationEntry {
void update_register_map(RegisterMap* map) const;
void flush_stack_processing(JavaThread* thread) const;

intptr_t* bottom_sender_sp() const {
intptr_t* sp = entry_sp() - argsize();
#ifdef _LP64
sp = align_down(sp, frame::frame_alignment);
#endif
return sp;
}

inline intptr_t* bottom_sender_sp() const;
inline oop cont_oop() const;
inline oop scope() const;
inline static oop cont_oop_or_null(const ContinuationEntry* ce);

bool is_virtual_thread() const { return _flags != 0; }

#ifndef PRODUCT
void describe(FrameValues& values, int frame_no) const {
address usp = (address)this;
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::parent_offset())), "parent");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::cont_offset())), "continuation");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::flags_offset())), "flags");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::chunk_offset())), "chunk");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::argsize_offset())), "argsize");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::pin_count_offset())), "pin_count");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::parent_cont_fastpath_offset())), "parent fastpath");
values.describe(frame_no, (intptr_t*)(usp + in_bytes(ContinuationEntry::parent_held_monitor_count_offset())), "parent held monitor count");
}
void describe(FrameValues& values, int frame_no) const;
#endif

#ifdef ASSERT
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/share/runtime/continuationEntry.inline.hpp
Expand Up @@ -28,9 +28,19 @@
#include "runtime/continuationEntry.hpp"

#include "oops/access.hpp"
#include "runtime/frame.hpp"
#include "utilities/align.hpp"

#include CPU_HEADER_INLINE(continuationEntry)

inline intptr_t* ContinuationEntry::bottom_sender_sp() const {
intptr_t* sp = entry_sp() - argsize();
#ifdef _LP64
sp = align_down(sp, frame::frame_alignment);
#endif
return sp;
}

inline oop ContinuationEntry::cont_oop() const {
oop snapshot = _cont;
return NativeAccess<>::oop_load(&snapshot);
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/runtime/continuationHelper.inline.hpp
Expand Up @@ -30,6 +30,7 @@
#include "code/scopeDesc.hpp"
#include "compiler/oopMap.hpp"
#include "compiler/oopMap.inline.hpp"
#include "interpreter/oopMapCache.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/stackValue.hpp"
#include "utilities/macros.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/runtime/stackChunkFrameStream.hpp
Expand Up @@ -27,12 +27,13 @@

#include "memory/allocation.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/frame.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"

class CodeBlob;
class frame;
class ImmutableOopMap;
class RegisterMap;
class VMRegImpl;
typedef VMRegImpl* VMReg;

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp
Expand Up @@ -26,6 +26,7 @@

#include "runtime/stackChunkFrameStream.hpp"

#include "code/codeCache.inline.hpp"
#include "compiler/oopMap.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
Expand Down

1 comment on commit f67c536

@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.