diff options
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index bac16cd5df..8dd423fcbb 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -58,6 +58,9 @@ namespace art { +// If true, we record the static and direct invokes in the invoke infos. +static constexpr bool kEnableDexLayoutOptimizations = false; + // Return whether a location is consistent with a type. static bool CheckType(Primitive::Type type, Location location) { if (location.IsFpuRegister() @@ -801,7 +804,18 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, outer_environment_size, inlining_depth); - EmitEnvironment(instruction->GetEnvironment(), slow_path); + HEnvironment* const environment = instruction->GetEnvironment(); + EmitEnvironment(environment, slow_path); + // Record invoke info, the common case for the trampoline is super and static invokes. Only + // record these to reduce oat file size. + if (kEnableDexLayoutOptimizations) { + if (environment != nullptr && + instruction->IsInvoke() && + instruction->IsInvokeStaticOrDirect()) { + HInvoke* const invoke = instruction->AsInvoke(); + stack_map_stream_.AddInvoke(invoke->GetInvokeType(), invoke->GetDexMethodIndex()); + } + } stack_map_stream_.EndStackMapEntry(); HLoopInformation* info = instruction->GetBlock()->GetLoopInformation(); @@ -818,7 +832,6 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, EmitEnvironment(instruction->GetEnvironment(), slow_path); stack_map_stream_.EndStackMapEntry(); if (kIsDebugBuild) { - HEnvironment* environment = instruction->GetEnvironment(); for (size_t i = 0, environment_size = environment->Size(); i < environment_size; ++i) { HInstruction* in_environment = environment->GetInstructionAt(i); if (in_environment != nullptr) { |