summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver-inl.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-02-24 08:10:57 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-02-24 08:10:57 +0000
commita5ca888d715cd0c6c421313211caa1928be3e399 (patch)
treebdb08a2cbcf277ab7f02626a23b52a3fdf272ffe /compiler/driver/compiler_driver-inl.h
parent2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 (diff)
Revert "Add JIT"
Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
Diffstat (limited to 'compiler/driver/compiler_driver-inl.h')
-rw-r--r--compiler/driver/compiler_driver-inl.h43
1 files changed, 15 insertions, 28 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h
index 4a35e9fbe7..9948c82663 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/compiler/driver/compiler_driver-inl.h
@@ -56,13 +56,14 @@ inline mirror::Class* CompilerDriver::ResolveCompilingMethodsClass(
return referrer_class;
}
-inline mirror::ArtField* CompilerDriver::ResolveFieldWithDexFile(
+inline mirror::ArtField* CompilerDriver::ResolveField(
const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
- Handle<mirror::ClassLoader> class_loader, const DexFile* dex_file,
+ Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,
uint32_t field_idx, bool is_static) {
- DCHECK_EQ(dex_cache->GetDexFile(), dex_file);
- mirror::ArtField* resolved_field = Runtime::Current()->GetClassLinker()->ResolveField(
- *dex_file, field_idx, dex_cache, class_loader, is_static);
+ DCHECK_EQ(dex_cache->GetDexFile(), mUnit->GetDexFile());
+ DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()));
+ mirror::ArtField* resolved_field = mUnit->GetClassLinker()->ResolveField(
+ *mUnit->GetDexFile(), field_idx, dex_cache, class_loader, is_static);
DCHECK_EQ(resolved_field == nullptr, soa.Self()->IsExceptionPending());
if (UNLIKELY(resolved_field == nullptr)) {
// Clean up any exception left by type resolution.
@@ -77,19 +78,6 @@ inline mirror::ArtField* CompilerDriver::ResolveFieldWithDexFile(
return resolved_field;
}
-inline mirror::DexCache* CompilerDriver::FindDexCache(const DexFile* dex_file) {
- return Runtime::Current()->GetClassLinker()->FindDexCache(*dex_file);
-}
-
-inline mirror::ArtField* CompilerDriver::ResolveField(
- const ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
- Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,
- uint32_t field_idx, bool is_static) {
- DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()));
- return ResolveFieldWithDexFile(soa, dex_cache, class_loader, mUnit->GetDexFile(), field_idx,
- is_static);
-}
-
inline void CompilerDriver::GetResolvedFieldDexFileLocation(
mirror::ArtField* resolved_field, const DexFile** declaring_dex_file,
uint16_t* declaring_class_idx, uint16_t* declaring_field_idx) {
@@ -184,7 +172,7 @@ inline bool CompilerDriver::IsStaticFieldsClassInitialized(mirror::Class* referr
inline mirror::ArtMethod* CompilerDriver::ResolveMethod(
ScopedObjectAccess& soa, Handle<mirror::DexCache> dex_cache,
Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,
- uint32_t method_idx, InvokeType invoke_type, bool check_incompatible_class_change) {
+ uint32_t method_idx, InvokeType invoke_type) {
DCHECK_EQ(dex_cache->GetDexFile(), mUnit->GetDexFile());
DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()));
mirror::ArtMethod* resolved_method = mUnit->GetClassLinker()->ResolveMethod(
@@ -196,8 +184,7 @@ inline mirror::ArtMethod* CompilerDriver::ResolveMethod(
soa.Self()->ClearException();
return nullptr;
}
- if (check_incompatible_class_change &&
- UNLIKELY(resolved_method->CheckIncompatibleClassChange(invoke_type))) {
+ if (UNLIKELY(resolved_method->CheckIncompatibleClassChange(invoke_type))) {
// Silently return nullptr on incompatible class change.
return nullptr;
}
@@ -240,14 +227,14 @@ inline int CompilerDriver::IsFastInvoke(
target_method->dex_method_index))) {
return 0;
}
+
// Sharpen a virtual call into a direct call when the target is known not to have been
// overridden (ie is final).
- const bool same_dex_file = target_method->dex_file == mUnit->GetDexFile();
- bool can_sharpen_virtual_based_on_type = same_dex_file &&
+ bool can_sharpen_virtual_based_on_type =
(*invoke_type == kVirtual) && (resolved_method->IsFinal() || methods_class->IsFinal());
// For invoke-super, ensure the vtable index will be correct to dispatch in the vtable of
// the super class.
- bool can_sharpen_super_based_on_type = same_dex_file && (*invoke_type == kSuper) &&
+ bool can_sharpen_super_based_on_type = (*invoke_type == kSuper) &&
(referrer_class != methods_class) && referrer_class->IsSubClass(methods_class) &&
resolved_method->GetMethodIndex() < methods_class->GetVTableLength() &&
(methods_class->GetVTableEntry(resolved_method->GetMethodIndex()) == resolved_method) &&
@@ -256,10 +243,10 @@ inline int CompilerDriver::IsFastInvoke(
if (can_sharpen_virtual_based_on_type || can_sharpen_super_based_on_type) {
// Sharpen a virtual call into a direct call. The method_idx is into referrer's
// dex cache, check that this resolved method is where we expect it.
- CHECK_EQ(target_method->dex_file, mUnit->GetDexFile());
- DCHECK_EQ(dex_cache.Get(), mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile()));
- CHECK_EQ(referrer_class->GetDexCache()->GetResolvedMethod(target_method->dex_method_index),
- resolved_method) << PrettyMethod(resolved_method);
+ CHECK(target_method->dex_file == mUnit->GetDexFile());
+ DCHECK(dex_cache.Get() == mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile()));
+ CHECK(referrer_class->GetDexCache()->GetResolvedMethod(target_method->dex_method_index) ==
+ resolved_method) << PrettyMethod(resolved_method);
int stats_flags = kFlagMethodResolved;
GetCodeAndMethodForDirectCall(/*out*/invoke_type,
kDirect, // Sharp type