From 92f7f3ce3b01f7c7df1c15b81c900e087248093f Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 31 Oct 2017 11:38:30 +0000 Subject: Use intrinsic codegen for compiling intrinsic methods. When compiling an intrinsic method, generate a graph that invokes the same method and try to compile it. If the call is actually intrinsified (or simplified to other HIR) and yields a leaf method, use the result of this compilation attempt, otherwise compile the actual code or JNI stub. Note that CodeGenerator::CreateThrowingSlowPathLocations() actually marks the locations as kNoCall if the throw is not in a catch block, thus considering some throwing methods (for example, String.charAt()) as leaf methods. We would ideally want to use the intrinsic codegen for all intrinsics that do not generate a slow-path call to the default implementation. Relying on the leaf method is suboptimal as we're missing out on methods that do other types of calls, for example runtime calls. This shall be fixed in a subsequent CL. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 67717501 Change-Id: I640fda7c22d4ff494b5ff77ebec3b7f5f75af652 --- compiler/compiled_method.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/compiled_method.cc') diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc index fc6a717aa6..e41371855d 100644 --- a/compiler/compiled_method.cc +++ b/compiler/compiled_method.cc @@ -26,8 +26,8 @@ CompiledCode::CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set, const ArrayRef& quick_code) : compiler_driver_(compiler_driver), - instruction_set_(instruction_set), - quick_code_(compiler_driver_->GetCompiledMethodStorage()->DeduplicateCode(quick_code)) { + quick_code_(compiler_driver_->GetCompiledMethodStorage()->DeduplicateCode(quick_code)), + packed_fields_(InstructionSetField::Encode(instruction_set)) { } CompiledCode::~CompiledCode() { @@ -48,7 +48,7 @@ bool CompiledCode::operator==(const CompiledCode& rhs) const { } size_t CompiledCode::AlignCode(size_t offset) const { - return AlignCode(offset, instruction_set_); + return AlignCode(offset, GetInstructionSet()); } size_t CompiledCode::AlignCode(size_t offset, InstructionSet instruction_set) { @@ -56,7 +56,7 @@ size_t CompiledCode::AlignCode(size_t offset, InstructionSet instruction_set) { } size_t CompiledCode::CodeDelta() const { - return CodeDelta(instruction_set_); + return CodeDelta(GetInstructionSet()); } size_t CompiledCode::CodeDelta(InstructionSet instruction_set) { -- cgit v1.2.3-59-g8ed1b