Move MethodInfo to CodeInfo.
There is no need to treat it specially any more,
because of the de-duplication at BitTable level.
This saves 0.6% of oat file size.
Test: test-art-host-gtest
Change-Id: Ife7927d736243879a41d6f325d49ebf6930a63f6
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 9398026..d96746f 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -715,18 +715,16 @@
ArenaVector<uint8_t> method_info(allocator->Adapter(kArenaAllocStackMaps));
size_t stack_map_size = 0;
size_t method_info_size = 0;
- codegen->ComputeStackMapAndMethodInfoSize(&stack_map_size, &method_info_size);
+ codegen->ComputeStackMapSize(&stack_map_size);
stack_map.resize(stack_map_size);
method_info.resize(method_info_size);
codegen->BuildStackMaps(MemoryRegion(stack_map.data(), stack_map.size()),
- MemoryRegion(method_info.data(), method_info.size()),
code_item_for_osr_check);
CompiledMethod* compiled_method = CompiledMethod::SwapAllocCompiledMethod(
GetCompilerDriver(),
codegen->GetInstructionSet(),
code_allocator->GetMemory(),
- ArrayRef<const uint8_t>(method_info),
ArrayRef<const uint8_t>(stack_map),
ArrayRef<const uint8_t>(*codegen->GetAssembler()->cfi().data()),
ArrayRef<const linker::LinkerPatch>(linker_patches));
@@ -1101,8 +1099,7 @@
static void CreateJniStackMap(ArenaStack* arena_stack,
const JniCompiledMethod& jni_compiled_method,
- /* out */ ArenaVector<uint8_t>* stack_map,
- /* out */ ArenaVector<uint8_t>* method_info) {
+ /* out */ ArenaVector<uint8_t>* stack_map) {
ScopedArenaAllocator allocator(arena_stack);
StackMapStream stack_map_stream(&allocator, jni_compiled_method.GetInstructionSet());
stack_map_stream.BeginMethod(
@@ -1112,9 +1109,7 @@
/* num_dex_registers */ 0);
stack_map_stream.EndMethod();
stack_map->resize(stack_map_stream.PrepareForFillIn());
- method_info->resize(stack_map_stream.ComputeMethodInfoSize());
stack_map_stream.FillInCodeInfo(MemoryRegion(stack_map->data(), stack_map->size()));
- stack_map_stream.FillInMethodInfo(MemoryRegion(method_info->data(), method_info->size()));
}
CompiledMethod* OptimizingCompiler::JniCompile(uint32_t access_flags,
@@ -1169,13 +1164,11 @@
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kCompiledNativeStub);
ArenaVector<uint8_t> stack_map(allocator.Adapter(kArenaAllocStackMaps));
- ArenaVector<uint8_t> method_info(allocator.Adapter(kArenaAllocStackMaps));
- CreateJniStackMap(&arena_stack, jni_compiled_method, &stack_map, &method_info);
+ CreateJniStackMap(&arena_stack, jni_compiled_method, &stack_map);
return CompiledMethod::SwapAllocCompiledMethod(
GetCompilerDriver(),
jni_compiled_method.GetInstructionSet(),
jni_compiled_method.GetCode(),
- ArrayRef<const uint8_t>(method_info),
ArrayRef<const uint8_t>(stack_map),
jni_compiled_method.GetCfi(),
/* patches */ ArrayRef<const linker::LinkerPatch>());
@@ -1237,34 +1230,28 @@
ArenaSet<ArtMethod*, std::less<ArtMethod*>> cha_single_implementation_list(
allocator.Adapter(kArenaAllocCHA));
ArenaVector<uint8_t> stack_map(allocator.Adapter(kArenaAllocStackMaps));
- ArenaVector<uint8_t> method_info(allocator.Adapter(kArenaAllocStackMaps));
ArenaStack arena_stack(runtime->GetJitArenaPool());
// StackMapStream is large and it does not fit into this frame, so we need helper method.
// TODO: Try to avoid the extra memory copy that results from this.
- CreateJniStackMap(&arena_stack, jni_compiled_method, &stack_map, &method_info);
+ CreateJniStackMap(&arena_stack, jni_compiled_method, &stack_map);
uint8_t* stack_map_data = nullptr;
- uint8_t* method_info_data = nullptr;
uint8_t* roots_data = nullptr;
uint32_t data_size = code_cache->ReserveData(self,
stack_map.size(),
- method_info.size(),
/* number_of_roots */ 0,
method,
&stack_map_data,
- &method_info_data,
&roots_data);
if (stack_map_data == nullptr || roots_data == nullptr) {
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kJitOutOfMemoryForCommit);
return false;
}
memcpy(stack_map_data, stack_map.data(), stack_map.size());
- memcpy(method_info_data, method_info.data(), method_info.size());
const void* code = code_cache->CommitCode(
self,
method,
stack_map_data,
- method_info_data,
roots_data,
jni_compiled_method.GetCode().data(),
jni_compiled_method.GetCode().size(),
@@ -1340,8 +1327,7 @@
}
size_t stack_map_size = 0;
- size_t method_info_size = 0;
- codegen->ComputeStackMapAndMethodInfoSize(&stack_map_size, &method_info_size);
+ codegen->ComputeStackMapSize(&stack_map_size);
size_t number_of_roots = codegen->GetNumberOfJitRoots();
// We allocate an object array to ensure the JIT roots that we will collect in EmitJitRoots
// will be visible by the GC between EmitLiterals and CommitCode. Once CommitCode is
@@ -1357,30 +1343,24 @@
return false;
}
uint8_t* stack_map_data = nullptr;
- uint8_t* method_info_data = nullptr;
uint8_t* roots_data = nullptr;
uint32_t data_size = code_cache->ReserveData(self,
stack_map_size,
- method_info_size,
number_of_roots,
method,
&stack_map_data,
- &method_info_data,
&roots_data);
if (stack_map_data == nullptr || roots_data == nullptr) {
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kJitOutOfMemoryForCommit);
return false;
}
- codegen->BuildStackMaps(MemoryRegion(stack_map_data, stack_map_size),
- MemoryRegion(method_info_data, method_info_size),
- code_item);
+ codegen->BuildStackMaps(MemoryRegion(stack_map_data, stack_map_size), code_item);
codegen->EmitJitRoots(code_allocator.GetData(), roots, roots_data);
const void* code = code_cache->CommitCode(
self,
method,
stack_map_data,
- method_info_data,
roots_data,
code_allocator.GetMemory().data(),
code_allocator.GetMemory().size(),