[Python-checkins] python/dist/src/Python ceval.c,2.374,2.375

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Feb 8 14:59:30 EST 2004


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29206

Modified Files:
	ceval.c 
Log Message:
SF patch #884022:  dynamic execution profiling vs opcode prediction
(Contributed by Andrew I MacIntyre.)

disables opcode prediction when dynamic execution
profiling is in effect, so the profiling counters at
the top of the main interpreter loop in eval_frame()
are updated for each opcode.



Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.374
retrieving revision 2.375
diff -C2 -d -r2.374 -r2.375
*** ceval.c	6 Feb 2004 18:32:33 -0000	2.374
--- ceval.c	8 Feb 2004 19:59:27 -0000	2.375
***************
*** 646,652 ****
--- 646,661 ----
  	A successful prediction saves a trip through the eval-loop including
  	its two unpredictable branches, the HASARG test and the switch-case.
+ 
+         If collecting opcode statistics, turn off prediction so that 
+ 	statistics are accurately maintained (the predictions bypass 
+ 	the opcode frequency counter updates).
  */
  
+ #ifdef DYNAMIC_EXECUTION_PROFILE
+ #define PREDICT(op)		if (0) goto PRED_##op
+ #else
  #define PREDICT(op)		if (*next_instr == op) goto PRED_##op
+ #endif
+ 
  #define PREDICTED(op)		PRED_##op: next_instr++
  #define PREDICTED_WITH_ARG(op)	PRED_##op: oparg = (next_instr[2]<<8) + \




More information about the Python-checkins mailing list