Skip to content

Commit

Permalink
8264016: [JVMCI] add some thread local fields for use by JVMCI
Browse files Browse the repository at this point in the history
Reviewed-by: shade
Backport-of: 182b11c
  • Loading branch information
jerboaa committed Aug 25, 2021
1 parent 3bc2275 commit 1f6eb0f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hotspot/share/jvmci/vmStructs_jvmci.cpp
Expand Up @@ -179,6 +179,9 @@
nonstatic_field(JavaThread, _pending_failed_speculation, long) \
nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \
nonstatic_field(JavaThread, _jvmci_counters, jlong*) \
nonstatic_field(JavaThread, _jvmci_reserved0, intptr_t*) \
nonstatic_field(JavaThread, _jvmci_reserved1, intptr_t*) \
nonstatic_field(JavaThread, _jvmci_reserved_oop0, oop) \
nonstatic_field(JavaThread, _reserved_stack_activation, address) \
\
static_field(java_lang_Class, _klass_offset, int) \
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/share/runtime/thread.cpp
Expand Up @@ -1622,6 +1622,9 @@ void JavaThread::initialize() {
_adjusting_comp_level = false;
_jvmci._alternate_call_target = NULL;
assert(_jvmci._implicit_exception_pc == NULL, "must be");
_jvmci_reserved0 = NULL;
_jvmci_reserved1 = NULL;
_jvmci_reserved_oop0 = NULL;
if (JVMCICounterSize > 0) {
_jvmci_counters = NEW_C_HEAP_ARRAY(jlong, JVMCICounterSize, mtInternal);
memset(_jvmci_counters, 0, sizeof(jlong) * JVMCICounterSize);
Expand Down Expand Up @@ -2923,6 +2926,9 @@ void JavaThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
f->do_oop((oop*) &_vm_result);
f->do_oop((oop*) &_exception_oop);
f->do_oop((oop*) &_pending_async_exception);
#if INCLUDE_JVMCI
f->do_oop((oop*) &_jvmci_reserved_oop0);
#endif

if (jvmti_thread_state() != NULL) {
jvmti_thread_state()->oops_do(f, cf);
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/runtime/thread.hpp
Expand Up @@ -1083,6 +1083,11 @@ class JavaThread: public Thread {
// Support for high precision, thread sensitive counters in JVMCI compiled code.
jlong* _jvmci_counters;

// Fast thread locals for use by JVMCI
intptr_t* _jvmci_reserved0;
intptr_t* _jvmci_reserved1;
oop _jvmci_reserved_oop0;

public:
static jlong* _jvmci_old_thread_counters;
static void collect_counters(typeArrayOop array);
Expand Down

1 comment on commit 1f6eb0f

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