summaryrefslogtreecommitdiff
path: root/runtime/stack_map.h
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2019-02-13 17:27:17 +0000
committer David Srbecky <dsrbecky@google.com> 2019-02-14 09:43:00 +0000
commite1412dacbf1d2a809bd1fca658cc8cb8f61f8ee6 (patch)
treebb3f56ecefe08b66f7a330a02caef0b089a0c2af /runtime/stack_map.h
parent8f20a23a35fa6fbe4dcb4ff70268a24dc7fb2a24 (diff)
Revert^2 "Add code size to CodeInfo"
This temporarily adds 0.25% to oat file size. The space will be reclaimed back in follow-up CL. This reverts commit 8f20a23a35fa6fbe4dcb4ff70268a24dc7fb2a24. Reason for revert: Reland as-is after CL/903819 Bug: 123510633 Test: DCHECK compare the two stored code sizes. Change-Id: Ia3ab31c208948f4996188764fcdcba13d9977d19
Diffstat (limited to 'runtime/stack_map.h')
-rw-r--r--runtime/stack_map.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index 87133cf59c..59da923661 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -438,8 +438,15 @@ class CodeInfo {
// Accumulate code info size statistics into the given Stats tree.
static void CollectSizeStats(const uint8_t* code_info, /*out*/ Stats* parent);
+ ALWAYS_INLINE static size_t DecodeCodeSize(const uint8_t* data,
+ InstructionSet isa = kRuntimeISA) {
+ uint32_t packed_code_size = BitMemoryReader(data).ReadVarint();
+ return StackMap::UnpackNativePc(packed_code_size, isa);
+ }
+
ALWAYS_INLINE static QuickMethodFrameInfo DecodeFrameInfo(const uint8_t* data) {
BitMemoryReader reader(data);
+ reader.ReadVarint(); // Skip code size.
return QuickMethodFrameInfo(
reader.ReadVarint() * kStackAlignment, // Decode packed_frame_size_ and unpack.
reader.ReadVarint(), // core_spill_mask_.
@@ -461,6 +468,7 @@ class CodeInfo {
// Invokes the callback with member pointer of each header field.
template<typename Callback>
ALWAYS_INLINE static void ForEachHeaderField(Callback callback) {
+ callback(&CodeInfo::packed_code_size_);
callback(&CodeInfo::packed_frame_size_);
callback(&CodeInfo::core_spill_mask_);
callback(&CodeInfo::fp_spill_mask_);
@@ -486,6 +494,7 @@ class CodeInfo {
callback(&CodeInfo::dex_register_catalog_);
}
+ uint32_t packed_code_size_ = 0; // The size of native PC range.
uint32_t packed_frame_size_ = 0; // Frame size in kStackAlignment units.
uint32_t core_spill_mask_ = 0;
uint32_t fp_spill_mask_ = 0;