summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2017-03-12 22:24:50 -0700
committerMathieu Chartier <mathieuc@google.com>2017-03-16 10:20:34 -0700
commitcbcedbf9382bc773713cd3552ed96f417bf1daeb (patch)
tree58eed766a69ddddbc41d21624244e14547fa1dff /compiler/optimizing/code_generator.cc
parentef62210a1466c133056c4bfdae9f8f5417065eff (diff)
Add method info to oat files
The method info data is stored separately from the code info to reduce oat size by improving deduplication of stack maps. To reduce code size, this moves the invoke info and inline info method indices to this table. Oat size for a large app (arm64): 77746816 -> 74023552 (-4.8%) Average oat size reduction for golem (arm64): 2% Repurposed unused SrcMapElem deduping to be for MethodInfo. TODO: Delete SrcMapElem in a follow up CL. Bug: 36124906 Test: clean-oat-host && test-art-host-run-test Change-Id: I2241362e728389030b959f42161ce817cf6e2009
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc
index 424b8507fb..b7c80756b0 100644
--- a/compiler/optimizing/code_generator.cc
+++ b/compiler/optimizing/code_generator.cc
@@ -654,8 +654,12 @@ std::unique_ptr<CodeGenerator> CodeGenerator::Create(HGraph* graph,
}
}
-size_t CodeGenerator::ComputeStackMapsSize() {
- return stack_map_stream_.PrepareForFillIn();
+void CodeGenerator::ComputeStackMapAndMethodInfoSize(size_t* stack_map_size,
+ size_t* method_info_size) {
+ DCHECK(stack_map_size != nullptr);
+ DCHECK(method_info_size != nullptr);
+ *stack_map_size = stack_map_stream_.PrepareForFillIn();
+ *method_info_size = stack_map_stream_.ComputeMethodInfoSize();
}
static void CheckCovers(uint32_t dex_pc,
@@ -723,10 +727,13 @@ static void CheckLoopEntriesCanBeUsedForOsr(const HGraph& graph,
}
}
-void CodeGenerator::BuildStackMaps(MemoryRegion region, const DexFile::CodeItem& code_item) {
- stack_map_stream_.FillIn(region);
+void CodeGenerator::BuildStackMaps(MemoryRegion stack_map_region,
+ MemoryRegion method_info_region,
+ const DexFile::CodeItem& code_item) {
+ stack_map_stream_.FillInCodeInfo(stack_map_region);
+ stack_map_stream_.FillInMethodInfo(method_info_region);
if (kIsDebugBuild) {
- CheckLoopEntriesCanBeUsedForOsr(*graph_, CodeInfo(region), code_item);
+ CheckLoopEntriesCanBeUsedForOsr(*graph_, CodeInfo(stack_map_region), code_item);
}
}