Introduce -Xint flag for ART.
Change-Id: I0f7d8c0b0f33e77ca2d3fbf05b7a16fedb86a545
diff --git a/src/object.cc b/src/object.cc
index aaaa245..4eb5066 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -657,33 +657,41 @@
// Pass everything as arguments.
AbstractMethod::InvokeStub* stub = GetInvokeStub();
-
if (UNLIKELY(!Runtime::Current()->IsStarted())){
- LOG(INFO) << "Not invoking " << PrettyMethod(this) << " for a runtime that isn't started.";
+ LOG(INFO) << "Not invoking " << PrettyMethod(this) << " for a runtime that isn't started";
if (result != NULL) {
result->SetJ(0);
}
} else {
- if (GetCode() != NULL && stub != NULL) {
- bool log = false;
- if (log) {
- LOG(INFO) << StringPrintf("invoking %s code=%p stub=%p",
+ bool interpret = self->ReadFlag(kEnterInterpreter);
+ const bool kLogInvocationStartAndReturn = false;
+ if (!interpret && GetCode() != NULL && stub != NULL) {
+ if (kLogInvocationStartAndReturn) {
+ LOG(INFO) << StringPrintf("Invoking '%s' code=%p stub=%p",
PrettyMethod(this).c_str(), GetCode(), stub);
}
(*stub)(this, receiver, self, args, result);
- if (log) {
- LOG(INFO) << StringPrintf("returned %s code=%p stub=%p",
+ if (kLogInvocationStartAndReturn) {
+ LOG(INFO) << StringPrintf("Returned '%s' code=%p stub=%p",
PrettyMethod(this).c_str(), GetCode(), stub);
}
} else {
- LOG(INFO) << "Not invoking " << PrettyMethod(this)
- << " code=" << reinterpret_cast<const void*>(GetCode())
- << " stub=" << reinterpret_cast<void*>(stub);
const bool kInterpretMethodsWithNoCode = false;
- if (kInterpretMethodsWithNoCode) {
+ if (interpret || kInterpretMethodsWithNoCode) {
+ if (kLogInvocationStartAndReturn) {
+ LOG(INFO) << "Interpreting " << PrettyMethod(this) << "'";
+ }
art::interpreter::EnterInterpreterFromInvoke(self, this, receiver, args, result);
- } else if (result != NULL) {
+ if (kLogInvocationStartAndReturn) {
+ LOG(INFO) << "Returned '" << PrettyMethod(this) << "'";
+ }
+ } else {
+ LOG(INFO) << "Not invoking '" << PrettyMethod(this)
+ << "' code=" << reinterpret_cast<const void*>(GetCode())
+ << " stub=" << reinterpret_cast<void*>(stub);
+ if (result != NULL) {
result->SetJ(0);
+ }
}
}
}