diff options
author | Andreas Gampe <agampe@google.com> | 2014-06-02 22:05:22 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-06-04 10:54:12 -0700 |
commit | 2a0d4ec9532a89abe722e5babdfbb846ffaad721 (patch) | |
tree | 1ec8b9aaf86ad227e9f1cbbed52cb3bf86ee0973 /runtime/thread.h | |
parent | fa5fda3ca52678b6fa739aad46e5c6ea08ae301e (diff) | |
download | art-2a0d4ec9532a89abe722e5babdfbb846ffaad721.tar.gz art-2a0d4ec9532a89abe722e5babdfbb846ffaad721.tar.bz2 art-2a0d4ec9532a89abe722e5babdfbb846ffaad721.zip |
ART: Fix forbidden thread state change in interpreter
While loading a type for assignability, it might happen that it's
not available yet locally and must be resolved. Formerly, we
disallowed a state change to ensure no GC taking place while a new
shadow frame has not been pushed on the stack yet.
As a fix, allow a "shadow frame under construction" in the thread,
which is visited during GC.
Change-Id: I973487a46b0e9e21fd6d49099d713b58f06d3b45
Diffstat (limited to 'runtime/thread.h')
-rw-r--r-- | runtime/thread.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/thread.h b/runtime/thread.h index 6569a962a0..8ac106bcf9 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -711,6 +711,13 @@ class Thread { return tlsPtr_.deoptimization_shadow_frame != nullptr; } + void SetShadowFrameUnderConstruction(ShadowFrame* sf); + void ClearShadowFrameUnderConstruction(); + + bool HasShadowFrameUnderConstruction() const { + return tlsPtr_.shadow_frame_under_construction != nullptr; + } + std::deque<instrumentation::InstrumentationStackFrame>* GetInstrumentationStack() { return tlsPtr_.instrumentation_stack; } @@ -962,8 +969,8 @@ class Thread { stack_trace_sample(nullptr), wait_next(nullptr), monitor_enter_object(nullptr), top_handle_scope(nullptr), class_loader_override(nullptr), long_jump_context(nullptr), instrumentation_stack(nullptr), debug_invoke_req(nullptr), single_step_control(nullptr), - deoptimization_shadow_frame(nullptr), name(nullptr), pthread_self(0), - last_no_thread_suspension_cause(nullptr), thread_local_start(nullptr), + deoptimization_shadow_frame(nullptr), shadow_frame_under_construction(nullptr), name(nullptr), + pthread_self(0), last_no_thread_suspension_cause(nullptr), thread_local_start(nullptr), thread_local_pos(nullptr), thread_local_end(nullptr), thread_local_objects(0), thread_local_alloc_stack_top(nullptr), thread_local_alloc_stack_end(nullptr) { } @@ -1039,6 +1046,9 @@ class Thread { // Shadow frame stack that is used temporarily during the deoptimization of a method. ShadowFrame* deoptimization_shadow_frame; + // Shadow frame stack that is currently under construction but not yet on the stack + ShadowFrame* shadow_frame_under_construction; + // A cached copy of the java.lang.Thread's name. std::string* name; |