OSDN Git Service

Fix JIT direct call to interpreter bridge
authorMathieu Chartier <mathieuc@google.com>
Fri, 27 Feb 2015 02:28:07 +0000 (18:28 -0800)
committerMathieu Chartier <mathieuc@google.com>
Fri, 27 Feb 2015 02:49:38 +0000 (18:49 -0800)
FormulaEvaluationActions.EvaluateAndApplyChanges on hammerhead eng:
Before: 3550ms
After: 2540

Bug: 17950037
Change-Id: If7acaea20d4adb5418d00ef13192e2d4c29032af

compiler/driver/compiler_driver.cc

index 15b3d08..90e63e9 100644 (file)
@@ -1316,6 +1316,14 @@ void CompilerDriver::GetCodeAndMethodForDirectCall(InvokeType* type, InvokeType
       }
     }
   }
+  if (runtime->UseJit()) {
+    // If we are the JIT, then don't allow a direct call to the interpreter bridge since this will
+    // never be updated even after we compile the method.
+    if (runtime->GetClassLinker()->IsQuickToInterpreterBridge(
+        reinterpret_cast<const void*>(compiler_->GetEntryPointOf(method)))) {
+      use_dex_cache = true;
+    }
+  }
   if (method_code_in_boot) {
     *stats_flags |= kFlagDirectCallToBoot | kFlagDirectMethodToBoot;
   }