summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_unit_test.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2017-10-31 11:38:30 +0000
committerVladimir Marko <vmarko@google.com>2017-11-15 14:29:52 +0000
commit92f7f3ce3b01f7c7df1c15b81c900e087248093f (patch)
tree37647ac824e450f80d752539cabbe631ba795c75 /compiler/optimizing/optimizing_unit_test.h
parent5dcb0d2cabe9d67987a6a7477fb124cef92abefb (diff)
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
Diffstat (limited to 'compiler/optimizing/optimizing_unit_test.h')
-rw-r--r--compiler/optimizing/optimizing_unit_test.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h
index e90c30d5ca..158c252f45 100644
--- a/compiler/optimizing/optimizing_unit_test.h
+++ b/compiler/optimizing/optimizing_unit_test.h
@@ -22,6 +22,7 @@
#include "common_compiler_test.h"
#include "dex_file.h"
#include "dex_instruction.h"
+#include "driver/dex_compilation_unit.h"
#include "handle_scope-inl.h"
#include "mirror/class_loader.h"
#include "mirror/dex_cache.h"
@@ -133,12 +134,11 @@ class OptimizingUnitTest : public CommonCompilerTest {
if (handles_ == nullptr) {
handles_.reset(new VariableSizedHandleScope(soa.Self()));
}
- const DexFile* dex_file = graph->GetAllocator()->Alloc<DexFile>();
const DexCompilationUnit* dex_compilation_unit =
new (graph->GetAllocator()) DexCompilationUnit(
handles_->NewHandle<mirror::ClassLoader>(nullptr),
/* class_linker */ nullptr,
- *dex_file,
+ graph->GetDexFile(),
code_item,
/* class_def_index */ DexFile::kDexNoIndex16,
/* method_idx */ dex::kDexNoIndex,