summaryrefslogtreecommitdiffstats
path: root/compiler/common_compiler_test.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-03-05 16:11:04 -0800
committerIan Rogers <irogers@google.com>2014-03-05 22:32:53 -0800
commitbf6b92a158053c98b15f4393abb3b86344ec9a20 (patch)
tree93a28d1e01b045a8df23fe5279601496b62af3dd /compiler/common_compiler_test.h
parent359597ee8c0667a7d2c0b74dcbb0f90bb6059bae (diff)
downloadandroid_art-bf6b92a158053c98b15f4393abb3b86344ec9a20.tar.gz
android_art-bf6b92a158053c98b15f4393abb3b86344ec9a20.tar.bz2
android_art-bf6b92a158053c98b15f4393abb3b86344ec9a20.zip
Generic JNI implementation for x86_64
Starting implementation for generic JNI on x86_64. Frames are of large static size (>4K) right now, should be compacted later. Passes the whole of jni_compiler_test. Change-Id: I88ac3e13a534afe7568d62a1ef97cb766e8260e4
Diffstat (limited to 'compiler/common_compiler_test.h')
-rw-r--r--compiler/common_compiler_test.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h
index 3bdc95ea54..bca72b872b 100644
--- a/compiler/common_compiler_test.h
+++ b/compiler/common_compiler_test.h
@@ -204,19 +204,31 @@ class CommonCompilerTest : public CommonRuntimeTest {
} else {
// No code? You must mean to go into the interpreter.
// Or the generic JNI...
- const void* method_code = method->IsNative() ? GetQuickGenericJniTrampoline()
- : (kUsePortableCompiler
- ? GetPortableToInterpreterBridge()
- : GetQuickToInterpreterBridge());
- OatFile::OatMethod oat_method = CreateOatMethod(method_code,
- kStackAlignment,
- 0,
- 0,
- nullptr,
- nullptr,
- nullptr);
- oat_method.LinkMethod(method);
- method->SetEntryPointFromInterpreter(interpreter::artInterpreterToInterpreterBridge);
+ if (!method->IsNative()) {
+ const void* method_code = kUsePortableCompiler ? GetPortableToInterpreterBridge()
+ : GetQuickToInterpreterBridge();
+ OatFile::OatMethod oat_method = CreateOatMethod(method_code,
+ kStackAlignment,
+ 0,
+ 0,
+ nullptr,
+ nullptr,
+ nullptr);
+ oat_method.LinkMethod(method);
+ method->SetEntryPointFromInterpreter(interpreter::artInterpreterToInterpreterBridge);
+ } else {
+ const void* method_code = GetQuickGenericJniTrampoline();
+ mirror::ArtMethod* callee_save_method = runtime_->GetCalleeSaveMethod(Runtime::kRefsAndArgs);
+ OatFile::OatMethod oat_method = CreateOatMethod(method_code,
+ callee_save_method->GetFrameSizeInBytes(),
+ callee_save_method->GetCoreSpillMask(),
+ callee_save_method->GetFpSpillMask(),
+ nullptr,
+ nullptr,
+ nullptr);
+ oat_method.LinkMethod(method);
+ method->SetEntryPointFromInterpreter(artInterpreterToCompiledCodeBridge);
+ }
}
// Create bridges to transition between different kinds of compiled bridge.
if (method->GetEntryPointFromPortableCompiledCode() == nullptr) {