Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
79f5b82
8227745, 8233915: Enable Escape Analysis for Better Performance in th…
reinrich Sep 8, 2020
18dd54b
Changes based on dholmes' feedback.
reinrich Sep 16, 2020
5bf631b
Merge branch 'master' into JDK-8227745
reinrich Sep 24, 2020
8b393a1
Moved class EscapeBarrier and class JvmtiDeferredUpdates into dedicat…
reinrich Sep 24, 2020
1fbe3ee
Shuffled parameters of EscapeBarrier constructors to better match eac…
reinrich Sep 25, 2020
4c20797
EscapeBarrier: moved method comments.
reinrich Sep 28, 2020
35bebf0
Better encapsulation of JvmtiDeferredUpdates. Moved jvmtiDeferredLoca…
reinrich Sep 28, 2020
c33cc4e
EATests.java: bugfix to prevent ObjectCollectedException
reinrich Sep 29, 2020
1df479c
Merge branch 'master' into JDK-8227745
reinrich Sep 29, 2020
4da194f
Make parameter current_thread of JvmtiEnvBase::check_top_frame() a Ja…
reinrich Sep 29, 2020
af39d5b
Merge branch 'master' into JDK-8227745
reinrich Sep 30, 2020
1c586cf
Merge branch 'master' into JDK-8227745
reinrich Oct 6, 2020
13fb1fd
jvmtiDeferredUpdates.hpp: add/remove empty lines and improve indentat…
reinrich Oct 7, 2020
7b3e4b0
jvmtiDeferredLocalVariable: move member variables to the beginning of…
reinrich Oct 7, 2020
115e860
jvmtiDeferredUpdates.hpp: remove forward declarations.
reinrich Oct 7, 2020
9416673
More smaller changes proposed by Serguei.
reinrich Oct 7, 2020
03f751e
Factorized fragment out of EscapeBarrier::deoptimize_objects_internal…
reinrich Oct 7, 2020
94c8969
Merge branch 'master' into JDK-8227745
reinrich Oct 8, 2020
d463b4f
Merge branch 'master' into JDK-8227745
reinrich Oct 8, 2020
60d695f
Merge branch 'master' into JDK-8227745
reinrich Oct 9, 2020
06b139a
The constructor of StackFrameStream takes more parameters after JDK-8…
reinrich Oct 9, 2020
77d75e0
Merge branch 'master' into JDK-8227745
reinrich Oct 15, 2020
91b2317
EATests.java improvements
reinrich Oct 10, 2020
0adc33a
Adaptions to lazy/concurrent thread stack processing for ZGC (JEP 376)
reinrich Oct 14, 2020
07deaff
Adaptations to JDK-8254263: Remove special_runtime_exit_condition() c…
reinrich Oct 15, 2020
f02f07b
Removed unused parameter from EscapeBarrierSuspendHandshake.
reinrich Oct 16, 2020
272fb02
handle_special_runtime_exit_condition(): wait (blocked) for obj. deop…
reinrich Oct 17, 2020
2ca0918
Removed cross_modify_fence from JT::wait_for_object_deoptimization().…
reinrich Oct 18, 2020
8d09747
Merge branch 'master' into JDK-8227745
reinrich Oct 19, 2020
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
8 changes: 6 additions & 2 deletions src/hotspot/share/c1/c1_IR.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, 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
Expand Down Expand Up @@ -244,7 +244,11 @@ class IRScopeDebugInfo: public CompilationResourceObj {
bool reexecute = topmost ? should_reexecute() : false;
bool return_oop = false; // This flag will be ignored since it used only for C2 with escape analysis.
bool rethrow_exception = false;
recorder->describe_scope(pc_offset, methodHandle(), scope()->method(), bci(), reexecute, rethrow_exception, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
bool has_ea_local_in_scope = false;
bool arg_escape = false;
recorder->describe_scope(pc_offset, methodHandle(), scope()->method(), bci(),
reexecute, rethrow_exception, is_method_handle_invoke, return_oop,
has_ea_local_in_scope, arg_escape, locvals, expvals, monvals);
}
};

Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/ci/ciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ bool ciEnv::cache_jvmti_state() {
_jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions();
_jvmti_can_pop_frame = JvmtiExport::can_pop_frame();
_jvmti_can_get_owned_monitor_info = JvmtiExport::can_get_owned_monitor_info();
_jvmti_can_walk_any_space = JvmtiExport::can_walk_any_space();
return _task != NULL && _task->method()->is_old();
}

Expand Down Expand Up @@ -271,6 +272,10 @@ bool ciEnv::jvmti_state_changed() const {
JvmtiExport::can_get_owned_monitor_info()) {
return true;
}
if (!_jvmti_can_walk_any_space &&
JvmtiExport::can_walk_any_space()) {
return true;
}

return false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/ci/ciEnv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class ciEnv : StackObj {
bool _jvmti_can_post_on_exceptions;
bool _jvmti_can_pop_frame;
bool _jvmti_can_get_owned_monitor_info; // includes can_get_owned_monitor_stack_depth_info
bool _jvmti_can_walk_any_space;

// Cache DTrace flags
bool _dtrace_extended_probes;
Expand Down Expand Up @@ -349,6 +350,7 @@ class ciEnv : StackObj {
bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; }
bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; }
bool jvmti_can_get_owned_monitor_info() const { return _jvmti_can_get_owned_monitor_info; }
bool jvmti_can_walk_any_space() const { return _jvmti_can_walk_any_space; }

// Cache DTrace flags
void cache_dtrace_flags();
Expand Down
10 changes: 3 additions & 7 deletions src/hotspot/share/code/compiledMethod.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
Expand Down Expand Up @@ -293,17 +293,13 @@ void CompiledMethod::verify_oop_relocations() {
ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
PcDesc* pd = pc_desc_at(pc);
guarantee(pd != NULL, "scope must be present");
return new ScopeDesc(this, pd->scope_decode_offset(),
pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
pd->return_oop());
return new ScopeDesc(this, pd);
}

ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
PcDesc* pd = pc_desc_near(pc);
guarantee(pd != NULL, "scope must be present");
return new ScopeDesc(this, pd->scope_decode_offset(),
pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
pd->return_oop());
return new ScopeDesc(this, pd);
}

address CompiledMethod::oops_reloc_begin() const {
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/code/debugInfoRec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ void DebugInformationRecorder::describe_scope(int pc_offset,
bool rethrow_exception,
bool is_method_handle_invoke,
bool return_oop,
bool has_ea_local_in_scope,
bool arg_escape,
DebugToken* locals,
DebugToken* expressions,
DebugToken* monitors) {
Expand All @@ -304,6 +306,8 @@ void DebugInformationRecorder::describe_scope(int pc_offset,
last_pd->set_rethrow_exception(rethrow_exception);
last_pd->set_is_method_handle_invoke(is_method_handle_invoke);
last_pd->set_return_oop(return_oop);
last_pd->set_has_ea_local_in_scope(has_ea_local_in_scope);
last_pd->set_arg_escape(arg_escape);

// serialize sender stream offest
stream()->write_int(sender_stream_offset);
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/code/debugInfoRec.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2020, 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
Expand Down Expand Up @@ -105,6 +105,8 @@ class DebugInformationRecorder: public ResourceObj {
bool rethrow_exception = false,
bool is_method_handle_invoke = false,
bool return_oop = false,
bool has_ea_local_in_scope = false,
bool arg_escape = false,
DebugToken* locals = NULL,
DebugToken* expressions = NULL,
DebugToken* monitors = NULL);
Expand Down
8 changes: 2 additions & 6 deletions src/hotspot/share/code/nmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2419,9 +2419,7 @@ void nmethod::verify_interrupt_point(address call_site) {

PcDesc* pd = pc_desc_at(nativeCall_at(call_site)->return_address());
assert(pd != NULL, "PcDesc must exist");
for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(),
pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
pd->return_oop());
for (ScopeDesc* sd = new ScopeDesc(this, pd);
!sd->is_top(); sd = sd->sender()) {
sd->verify();
}
Expand Down Expand Up @@ -3056,9 +3054,7 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) {
ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
PcDesc* p = pc_desc_near(begin+1);
if (p != NULL && p->real_pc(this) <= end) {
return new ScopeDesc(this, p->scope_decode_offset(),
p->obj_decode_offset(), p->should_reexecute(), p->rethrow_exception(),
p->return_oop());
return new ScopeDesc(this, p);
}
return NULL;
}
Expand Down
16 changes: 14 additions & 2 deletions src/hotspot/share/code/pcDesc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, 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
Expand Down Expand Up @@ -42,7 +42,9 @@ class PcDesc {
PCDESC_reexecute = 1 << 0,
PCDESC_is_method_handle_invoke = 1 << 1,
PCDESC_return_oop = 1 << 2,
PCDESC_rethrow_exception = 1 << 3
PCDESC_rethrow_exception = 1 << 3,
PCDESC_has_ea_local_in_scope = 1 << 4,
PCDESC_arg_escape = 1 << 5
};

int _flags;
Expand Down Expand Up @@ -89,6 +91,16 @@ class PcDesc {
bool return_oop() const { return (_flags & PCDESC_return_oop) != 0; }
void set_return_oop(bool z) { set_flag(PCDESC_return_oop, z); }

// Indicates if there are objects in scope that, based on escape analysis, are local to the
// compiled method or local to the current thread, i.e. NoEscape or ArgEscape
bool has_ea_local_in_scope() const { return (_flags & PCDESC_has_ea_local_in_scope) != 0; }
void set_has_ea_local_in_scope(bool z) { set_flag(PCDESC_has_ea_local_in_scope, z); }

// Indicates if this pc descriptor is at a call site where objects that do not escape the
// current thread are passed as arguments.
bool arg_escape() const { return (_flags & PCDESC_arg_escape) != 0; }
void set_arg_escape(bool z) { set_flag(PCDESC_arg_escape, z); }

// Returns the real pc
address real_pc(const CompiledMethod* code) const;

Expand Down
25 changes: 10 additions & 15 deletions src/hotspot/share/code/scopeDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,16 @@
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"

ScopeDesc::ScopeDesc(const CompiledMethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool rethrow_exception, bool return_oop) {
ScopeDesc::ScopeDesc(const CompiledMethod* code, PcDesc* pd, bool ignore_objects) {
int obj_decode_offset = ignore_objects ? DebugInformationRecorder::serialized_null : pd->obj_decode_offset();
_code = code;
_decode_offset = decode_offset;
_decode_offset = pd->scope_decode_offset();
_objects = decode_object_values(obj_decode_offset);
_reexecute = reexecute;
_rethrow_exception = rethrow_exception;
_return_oop = return_oop;
decode_body();
}

ScopeDesc::ScopeDesc(const CompiledMethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop) {
_code = code;
_decode_offset = decode_offset;
_objects = decode_object_values(DebugInformationRecorder::serialized_null);
_reexecute = reexecute;
_rethrow_exception = rethrow_exception;
_return_oop = return_oop;
_reexecute = pd->should_reexecute();
_rethrow_exception = pd->rethrow_exception();
_return_oop = pd->return_oop();
_has_ea_local_in_scope = ignore_objects ? false : pd->has_ea_local_in_scope();
_arg_escape = ignore_objects ? false : pd->arg_escape();
decode_body();
}

Expand All @@ -59,6 +52,8 @@ void ScopeDesc::initialize(const ScopeDesc* parent, int decode_offset) {
_reexecute = false; //reexecute only applies to the first scope
_rethrow_exception = false;
_return_oop = false;
_has_ea_local_in_scope = parent->has_ea_local_in_scope();
_arg_escape = false;
decode_body();
}

Expand Down
16 changes: 9 additions & 7 deletions src/hotspot/share/code/scopeDesc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, 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
Expand Down Expand Up @@ -60,12 +60,7 @@ class SimpleScopeDesc : public StackObj {
class ScopeDesc : public ResourceObj {
public:
// Constructor
ScopeDesc(const CompiledMethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool rethrow_exception, bool return_oop);

// Calls above, giving default value of "serialized_null" to the
// "obj_decode_offset" argument. (We don't use a default argument to
// avoid a .hpp-.hpp dependency.)
ScopeDesc(const CompiledMethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop);
ScopeDesc(const CompiledMethod* code, PcDesc* pd, bool ignore_objects = false);

// Direct access to scope
ScopeDesc* at_offset(int decode_offset) { return new ScopeDesc(this, decode_offset); }
Expand All @@ -76,6 +71,10 @@ class ScopeDesc : public ResourceObj {
bool should_reexecute() const { return _reexecute; }
bool rethrow_exception() const { return _rethrow_exception; }
bool return_oop() const { return _return_oop; }
// Returns true if one or more NoEscape or ArgEscape objects exist in
// any of the scopes at compiled pc.
bool has_ea_local_in_scope() const { return _has_ea_local_in_scope; }
bool arg_escape() const { return _arg_escape; }

GrowableArray<ScopeValue*>* locals();
GrowableArray<ScopeValue*>* expressions();
Expand Down Expand Up @@ -105,6 +104,9 @@ class ScopeDesc : public ResourceObj {
bool _reexecute;
bool _rethrow_exception;
bool _return_oop;
bool _has_ea_local_in_scope; // One or more NoEscape or ArgEscape objects exist in
// any of the scopes at compiled pc.
bool _arg_escape; // Compiled Java call in youngest scope passes ArgEscape

// Decoding offsets
int _decode_offset;
Expand Down
Loading