From e71474621b968a9bc649d067155d31213f5764a9 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 13 Apr 2011 14:10:04 -0700 Subject: [PATCH] Fix debugger performance regression http://b/issue?id=4282910 The interpreter was reporting every instruction as a method entry point, causing significant performance degradation in the debugger. Change-Id: If6fb092d6ade7fc3d74be3c7f806bf2d6923a063 --- vm/interp/Interp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vm/interp/Interp.c b/vm/interp/Interp.c index e670d49e8..092df3207 100644 --- a/vm/interp/Interp.c +++ b/vm/interp/Interp.c @@ -714,7 +714,7 @@ void dvmReportReturn(Thread* self) * the event list unless we know there's at least one lurking within. */ static void updateDebugger(const Method* method, const u2* pc, const u4* fp, - bool methodEntry, Thread* self) + Thread* self) { int eventFlags = 0; @@ -727,8 +727,10 @@ static void updateDebugger(const Method* method, const u2* pc, const u4* fp, */ dvmExportPC(pc, fp); - if (methodEntry) + if (self->debugIsMethodEntry) { eventFlags |= DBG_METHOD_ENTRY; + self->debugIsMethodEntry = false; + } /* * See if we have a breakpoint here. @@ -1775,8 +1777,7 @@ void dvmCheckBefore(const u2 *pc, u4 *fp, Thread* self) } if (self->interpBreak.ctl.subMode & kSubModeDebuggerActive) { - updateDebugger(method, pc, fp, - self->debugIsMethodEntry, self); + updateDebugger(method, pc, fp, self); } if (gDvm.instructionCountEnableCount != 0) { /* -- 2.11.0