summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2019-02-12 11:45:06 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-02-12 11:45:06 +0000
commita05344750f6996b32de18a25d0ba55115235dbb6 (patch)
treef8a50bc1f5e8fe4c9f4bc69d7b690fd08611ab84 /compiler/optimizing/optimizing_compiler.cc
parent72c403b9b5027e7849a5145a0af0166f5d3d42c2 (diff)
parent68efa7b1128486e08ae60cd27181645b27bbd2e4 (diff)
Merge "Add code size to CodeInfo"
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index e8f8d32525..4f43b71fde 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1171,7 +1171,8 @@ CompiledMethod* OptimizingCompiler::Compile(const dex::CodeItem* code_item,
}
static ScopedArenaVector<uint8_t> CreateJniStackMap(ScopedArenaAllocator* allocator,
- const JniCompiledMethod& jni_compiled_method) {
+ const JniCompiledMethod& jni_compiled_method,
+ size_t code_size) {
// StackMapStream is quite large, so allocate it using the ScopedArenaAllocator
// to stay clear of the frame size limit.
std::unique_ptr<StackMapStream> stack_map_stream(
@@ -1181,7 +1182,7 @@ static ScopedArenaVector<uint8_t> CreateJniStackMap(ScopedArenaAllocator* alloca
jni_compiled_method.GetCoreSpillMask(),
jni_compiled_method.GetFpSpillMask(),
/* num_dex_registers= */ 0);
- stack_map_stream->EndMethod();
+ stack_map_stream->EndMethod(code_size);
return stack_map_stream->Encode();
}
@@ -1239,8 +1240,8 @@ CompiledMethod* OptimizingCompiler::JniCompile(uint32_t access_flags,
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kCompiledNativeStub);
ScopedArenaAllocator stack_map_allocator(&arena_stack); // Will hold the stack map.
- ScopedArenaVector<uint8_t> stack_map = CreateJniStackMap(&stack_map_allocator,
- jni_compiled_method);
+ ScopedArenaVector<uint8_t> stack_map = CreateJniStackMap(
+ &stack_map_allocator, jni_compiled_method, jni_compiled_method.GetCode().size());
return CompiledMethod::SwapAllocCompiledMethod(
GetCompilerDriver()->GetCompiledMethodStorage(),
jni_compiled_method.GetInstructionSet(),
@@ -1290,8 +1291,8 @@ bool OptimizingCompiler::JitCompile(Thread* self,
ArenaStack arena_stack(runtime->GetJitArenaPool());
// StackMapStream is large and it does not fit into this frame, so we need helper method.
ScopedArenaAllocator stack_map_allocator(&arena_stack); // Will hold the stack map.
- ScopedArenaVector<uint8_t> stack_map = CreateJniStackMap(&stack_map_allocator,
- jni_compiled_method);
+ ScopedArenaVector<uint8_t> stack_map = CreateJniStackMap(
+ &stack_map_allocator, jni_compiled_method, jni_compiled_method.GetCode().size());
uint8_t* stack_map_data = nullptr;
uint8_t* roots_data = nullptr;
uint32_t data_size = code_cache->ReserveData(self,