diff options
author | 2022-03-23 12:49:30 +0000 | |
---|---|---|
committer | 2022-07-12 13:03:15 +0000 | |
commit | fc067a360d14db5f84fd4b58e0dee6cb04ee759b (patch) | |
tree | a9217edb3a03e3937411407f704ad26e5887fb9a /compiler/optimizing/stack_map_stream.cc | |
parent | 0ae89052f7213701b8b3a782266e84b3d3600dbf (diff) |
Introduce a flag to check if JITed code has instrumentation support
Introduce a new flag to identify if JITed code was compiled with
instrumentation support. We used to check if the runtime is java
debuggable to check for instrumentation support of JITed code. We only
set the java debuggable at runtime init and never changed it after. So
this check was sufficient since we always JIT code with instrumentation
support in debuggable runtimes.
We want to be able to change the runtime to debuggable after the runtime
has started. As a first step, introduce a new flag to explicitly check
if JITed code was compiled with instrumentation support. Use this flag
to check if code needs entry / exit stubs and to check if code is async
deoptimizeable.
Bug: 222479430
Test: art/test.py
Change-Id: Ibcaeab869aa8ce153920a801dcc60988411c775b
Diffstat (limited to 'compiler/optimizing/stack_map_stream.cc')
-rw-r--r-- | compiler/optimizing/stack_map_stream.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/stack_map_stream.cc b/compiler/optimizing/stack_map_stream.cc index f55bbee1c8..c13a35567b 100644 --- a/compiler/optimizing/stack_map_stream.cc +++ b/compiler/optimizing/stack_map_stream.cc @@ -49,7 +49,8 @@ void StackMapStream::BeginMethod(size_t frame_size_in_bytes, size_t core_spill_mask, size_t fp_spill_mask, uint32_t num_dex_registers, - bool baseline) { + bool baseline, + bool debuggable) { DCHECK(!in_method_) << "Mismatched Begin/End calls"; in_method_ = true; DCHECK_EQ(packed_frame_size_, 0u) << "BeginMethod was already called"; @@ -60,6 +61,7 @@ void StackMapStream::BeginMethod(size_t frame_size_in_bytes, fp_spill_mask_ = fp_spill_mask; num_dex_registers_ = num_dex_registers; baseline_ = baseline; + debuggable_ = debuggable; if (kVerifyStackMaps) { dchecks_.emplace_back([=](const CodeInfo& code_info) { @@ -367,6 +369,7 @@ ScopedArenaVector<uint8_t> StackMapStream::Encode() { uint32_t flags = (inline_infos_.size() > 0) ? CodeInfo::kHasInlineInfo : 0; flags |= baseline_ ? CodeInfo::kIsBaseline : 0; + flags |= debuggable_ ? CodeInfo::kIsDebuggable : 0; DCHECK_LE(flags, kVarintMax); // Ensure flags can be read directly as byte. uint32_t bit_table_flags = 0; ForEachBitTable([&bit_table_flags](size_t i, auto bit_table) { |