aboutsummaryrefslogtreecommitdiffstats
path: root/decompile.c
diff options
context:
space:
mode:
authornop <nop>1997-07-07 03:24:53 +0000
committernop <nop>1997-07-07 03:24:53 +0000
commit4e8941e8c27ace0e64bb27e06cd955e2137f2ac8 (patch)
tree37904929fb883595e143fe48a51a0f4c554b79ec /decompile.c
parent5b0b8d4d456c535f60f2034a57097567a3d0d75f (diff)
downloadmoo-cvs-4e8941e8c27ace0e64bb27e06cd955e2137f2ac8.tar.gz
moo-cvs-4e8941e8c27ace0e64bb27e06cd955e2137f2ac8.tar.xz
moo-cvs-4e8941e8c27ace0e64bb27e06cd955e2137f2ac8.zip
Merge UNSAFE_OPTS (r5) after extensive testing.
Diffstat (limited to 'decompile.c')
-rw-r--r--decompile.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/decompile.c b/decompile.c
index c9e0265..d78c652 100644
--- a/decompile.c
+++ b/decompile.c
@@ -963,7 +963,12 @@ find_hot_node(Stmt * stmt)
int
find_line_number(Program * prog, int vector, int pc)
{
- Stmt *tree = program_to_tree(prog, MAIN_VECTOR, vector, pc);
+ Stmt *tree;
+
+ if (prog->cached_lineno_pc == pc)
+ return prog->cached_lineno;
+
+ tree = program_to_tree(prog, MAIN_VECTOR, vector, pc);
lineno = prog->first_lineno;
find_hot_node(tree);
@@ -972,15 +977,24 @@ find_line_number(Program * prog, int vector, int pc)
if (!hot_node && hot_position != DONE)
panic("Can't do job in FIND_LINE_NUMBER!");
+ prog->cached_lineno_pc = pc;
+ prog->cached_lineno = lineno;
return lineno;
}
char rcsid_decompile[] = "$Id$";
/* $Log$
-/* Revision 1.2 1997/03/03 04:18:32 nop
-/* GNU Indent normalization
+/* Revision 1.3 1997/07/07 03:24:53 nop
+/* Merge UNSAFE_OPTS (r5) after extensive testing.
/*
+ * Revision 1.2.2.1 1997/06/05 09:00:00 bjj
+ * Cache one pc/lineno pair with each Program. Hopefully most programs that
+ * fail multiple times usually do it on the same line!
+ *
+ * Revision 1.2 1997/03/03 04:18:32 nop
+ * GNU Indent normalization
+ *
* Revision 1.1.1.1 1997/03/03 03:44:59 nop
* LambdaMOO 1.8.0p5
*