summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
authorDmitry Petrochenko <dmitry.petrochenko@intel.com>2014-05-16 17:43:39 +0700
committerAndreas Gampe <agampe@google.com>2014-05-16 17:10:20 -0700
commitf0972a410a0665dbe32bd96df09a572d69f9f3a3 (patch)
tree7e68b84a8395c72bdacb293c9e42cb3817f14668 /compiler
parentde1129a26e0474ea8bb9112938ebb867163969fd (diff)
downloadandroid_art-f0972a410a0665dbe32bd96df09a572d69f9f3a3.tar.gz
android_art-f0972a410a0665dbe32bd96df09a572d69f9f3a3.tar.bz2
android_art-f0972a410a0665dbe32bd96df09a572d69f9f3a3.zip
Fix generic jni issue in ArtMethod::GetQuickFrameInfo
The 64-bit host mode fails to start due to incorrect detection of GetQuickGenericJniTrampoline. The quick_code is 32-bit and taken from oat file, but GetQuickGenericJniTrampoline returnf 0x7fffxx (64-bit) address of trampoline and execution went to incorrect way. Some clean-up. Original Author: Dmitry Petrochenko <dmitry.petrochenko@intel.com> Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com> Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com> Change-Id: I0952443b2a9f6833ad37ec373837ae208681fad7
Diffstat (limited to 'compiler')
-rw-r--r--compiler/common_compiler_test.h5
-rw-r--r--compiler/image_writer.cc3
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h
index 586c442227..7a91e47fb1 100644
--- a/compiler/common_compiler_test.h
+++ b/compiler/common_compiler_test.h
@@ -130,6 +130,9 @@ static inline InstructionSetFeatures ParseFeatureList(std::string str) {
return result;
}
+// Normally the ClassLinker supplies this.
+extern "C" void art_quick_generic_jni_trampoline(mirror::ArtMethod*);
+
class CommonCompilerTest : public CommonRuntimeTest {
public:
// Create an OatMethod based on pointers (for unit tests).
@@ -217,7 +220,7 @@ class CommonCompilerTest : public CommonRuntimeTest {
oat_method.LinkMethod(method);
method->SetEntryPointFromInterpreter(interpreter::artInterpreterToInterpreterBridge);
} else {
- const void* method_code = GetQuickGenericJniTrampoline();
+ const void* method_code = reinterpret_cast<void*>(art_quick_generic_jni_trampoline);
OatFile::OatMethod oat_method = CreateOatMethod(method_code, nullptr);
oat_method.LinkMethod(method);
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 20a66d4022..eb1c5811c7 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -757,7 +757,8 @@ void ImageWriter::PatchOatCodeAndMethods() {
uintptr_t value = quick_code - patch_location + patch->RelativeOffset();
SetPatchLocation(patch, value);
} else {
- if (quick_code == reinterpret_cast<uintptr_t>(GetQuickToInterpreterBridge())) {
+ if (quick_code == reinterpret_cast<uintptr_t>(GetQuickToInterpreterBridge()) ||
+ quick_code == reinterpret_cast<uintptr_t>(class_linker->GetQuickGenericJniTrampoline())) {
if (target->IsNative()) {
// generic JNI, not interpreter bridge from GetQuickOatCodeFor().
code_offset = quick_generic_jni_trampoline_offset_;