1616
1717#include <ctype.h>
1818
19- #ifdef WITH_TSC
19+ #ifndef WITH_TSC
20+ #define rdtscll (var )
21+ #else /*WITH_TSC defined*/
2022
2123typedef unsigned long long uint64 ;
2224
@@ -868,9 +870,7 @@ PyEval_EvalFrame(PyFrameObject *f)
868870#endif
869871
870872 /* Main switch on opcode */
871- #ifdef WITH_TSC
872873 rdtscll (inst0 );
873- #endif
874874
875875 switch (opcode ) {
876876
@@ -1629,13 +1629,9 @@ PyEval_EvalFrame(PyFrameObject *f)
16291629 v = SECOND ();
16301630 u = THIRD ();
16311631 STACKADJ (-3 );
1632- #ifdef WITH_TSC
16331632 rdtscll (intr0 );
1634- #endif
16351633 err = exec_statement (f , u , v , w );
1636- #ifdef WITH_TSC
16371634 rdtscll (intr1 );
1638- #endif
16391635 Py_DECREF (u );
16401636 Py_DECREF (v );
16411637 Py_DECREF (w );
@@ -2011,13 +2007,9 @@ PyEval_EvalFrame(PyFrameObject *f)
20112007 x = NULL ;
20122008 break ;
20132009 }
2014- #ifdef WITH_TSC
20152010 rdtscll (intr0 );
2016- #endif
20172011 x = PyEval_CallObject (x , w );
2018- #ifdef WITH_TSC
20192012 rdtscll (intr1 );
2020- #endif
20212013 Py_DECREF (w );
20222014 SET_TOP (x );
20232015 if (x != NULL ) continue ;
@@ -2031,13 +2023,9 @@ PyEval_EvalFrame(PyFrameObject *f)
20312023 "no locals found during 'import *'" );
20322024 break ;
20332025 }
2034- #ifdef WITH_TSC
20352026 rdtscll (intr0 );
2036- #endif
20372027 err = import_all_from (x , v );
2038- #ifdef WITH_TSC
20392028 rdtscll (intr1 );
2040- #endif
20412029 PyFrame_LocalsToFast (f , 0 );
20422030 Py_DECREF (v );
20432031 if (err == 0 ) continue ;
@@ -2046,13 +2034,9 @@ PyEval_EvalFrame(PyFrameObject *f)
20462034 case IMPORT_FROM :
20472035 w = GETITEM (names , oparg );
20482036 v = TOP ();
2049- #ifdef WITH_TSC
20502037 rdtscll (intr0 );
2051- #endif
20522038 x = import_from (v , w );
2053- #ifdef WITH_TSC
20542039 rdtscll (intr1 );
2055- #endif
20562040 PUSH (x );
20572041 if (x != NULL ) continue ;
20582042 break ;
@@ -2206,13 +2190,9 @@ PyEval_EvalFrame(PyFrameObject *f)
22062190 } else
22072191 Py_INCREF (func );
22082192 sp = stack_pointer ;
2209- #ifdef WITH_TSC
22102193 rdtscll (intr0 );
2211- #endif
22122194 x = ext_do_call (func , & sp , flags , na , nk );
2213- #ifdef WITH_TSC
22142195 rdtscll (intr1 );
2215- #endif
22162196 stack_pointer = sp ;
22172197 Py_DECREF (func );
22182198
@@ -2325,9 +2305,7 @@ PyEval_EvalFrame(PyFrameObject *f)
23252305
23262306 on_error :
23272307
2328- #ifdef WITH_TSC
23292308 rdtscll (inst1 );
2330- #endif
23312309
23322310 /* Quickly continue if no error occurred */
23332311
@@ -2340,9 +2318,7 @@ PyEval_EvalFrame(PyFrameObject *f)
23402318 "XXX undetected error\n" );
23412319 else {
23422320#endif
2343- #ifdef WITH_TSC
23442321 rdtscll (loop1 );
2345- #endif
23462322 continue ; /* Normal, fast path */
23472323#ifdef CHECKEXC
23482324 }
@@ -2461,9 +2437,7 @@ PyEval_EvalFrame(PyFrameObject *f)
24612437
24622438 if (why != WHY_NOT )
24632439 break ;
2464- #ifdef WITH_TSC
24652440 rdtscll (loop1 );
2466- #endif
24672441
24682442 } /* main loop */
24692443
@@ -3560,13 +3534,9 @@ call_function(PyObject ***pp_stack, int oparg
35603534 else {
35613535 PyObject * callargs ;
35623536 callargs = load_args (pp_stack , na );
3563- #ifdef WITH_TSC
35643537 rdtscll (* pintr0 );
3565- #endif
35663538 C_TRACE (x = PyCFunction_Call (func ,callargs ,NULL ));
3567- #ifdef WITH_TSC
35683539 rdtscll (* pintr1 );
3569- #endif
35703540 Py_XDECREF (callargs );
35713541 }
35723542 } else {
@@ -3584,16 +3554,12 @@ call_function(PyObject ***pp_stack, int oparg
35843554 n ++ ;
35853555 } else
35863556 Py_INCREF (func );
3587- #ifdef WITH_TSC
35883557 rdtscll (* pintr0 );
3589- #endif
35903558 if (PyFunction_Check (func ))
35913559 x = fast_function (func , pp_stack , n , na , nk );
35923560 else
35933561 x = do_call (func , pp_stack , na , nk );
3594- #ifdef WITH_TSC
35953562 rdtscll (* pintr1 );
3596- #endif
35973563 Py_DECREF (func );
35983564 }
35993565
0 commit comments