summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2021-03-02 18:14:31 +0000
committerDavid Srbecky <dsrbecky@google.com>2021-03-05 12:03:30 +0000
commit17b4d2b14fd26088bca195b5d7c48f26b8b545d8 (patch)
treebd2f741127dbb63e04aee99e5f65a2960f63f2be /compiler/optimizing/optimizing_compiler.cc
parent39d529f45bad3ecf2bd6b376a049fde6cb0c21b4 (diff)
Add code size to CodeInfo.
This is in preparation of removing it from OatQuickMethodHeader. Bug: 123510633 Test: m test-art-host-gtest Test: ./art/test.py -b -r --host Change-Id: I5c5adb4c040e329b81c1393aa1b80ee017729c8a
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 172a0834f0..bf99a0e5ac 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1131,7 +1131,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(
@@ -1142,7 +1143,7 @@ static ScopedArenaVector<uint8_t> CreateJniStackMap(ScopedArenaAllocator* alloca
jni_compiled_method.GetFpSpillMask(),
/* num_dex_registers= */ 0,
/* baseline= */ false);
- stack_map_stream->EndMethod();
+ stack_map_stream->EndMethod(code_size);
return stack_map_stream->Encode();
}
@@ -1203,8 +1204,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(
GetCompiledMethodStorage(),
jni_compiled_method.GetInstructionSet(),
@@ -1262,8 +1263,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());
ArrayRef<const uint8_t> reserved_code;
ArrayRef<const uint8_t> reserved_data;