28
28
typedef unsigned long long uint64 ;
29
29
30
30
#if defined(__ppc__ ) /* <- Don't know if this is the correct symbol; this
31
- section should work for GCC on any PowerPC platform,
32
- irrespective of OS. POWER? Who knows :-) */
31
+ section should work for GCC on any PowerPC
32
+ platform, irrespective of OS.
33
+ POWER? Who knows :-) */
33
34
34
35
#define READ_TIMESTAMP (var ) ppc_getcounter(&var)
35
36
@@ -93,7 +94,8 @@ static PyObject * call_function(PyObject ***, int);
93
94
static PyObject * fast_function (PyObject * , PyObject * * * , int , int , int );
94
95
static PyObject * do_call (PyObject * , PyObject * * * , int , int );
95
96
static PyObject * ext_do_call (PyObject * , PyObject * * * , int , int , int );
96
- static PyObject * update_keyword_args (PyObject * , int , PyObject * * * ,PyObject * );
97
+ static PyObject * update_keyword_args (PyObject * , int , PyObject * * * ,
98
+ PyObject * );
97
99
static PyObject * update_star_args (int , int , PyObject * , PyObject * * * );
98
100
static PyObject * load_args (PyObject * * * , int );
99
101
#define CALL_FLAG_VAR 1
@@ -509,7 +511,8 @@ PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
509
511
PyObject *
510
512
PyEval_EvalFrame (PyFrameObject * f ) {
511
513
/* This is for backward compatibility with extension modules that
512
- used this API; core interpreter code should call PyEval_EvalFrameEx() */
514
+ used this API; core interpreter code should call
515
+ PyEval_EvalFrameEx() */
513
516
return PyEval_EvalFrameEx (f , 0 );
514
517
}
515
518
@@ -519,7 +522,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
519
522
#ifdef DXPAIRS
520
523
int lastopcode = 0 ;
521
524
#endif
522
- register PyObject * * stack_pointer ; /* Next free slot in value stack */
525
+ register PyObject * * stack_pointer ; /* Next free slot in value stack */
523
526
register unsigned char * next_instr ;
<
10000
td data-grid-cell-id="diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59de-524-527-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">524
527
register int opcode ; /* Current opcode */
525
528
register int oparg ; /* Current opcode argument, if any */
@@ -610,10 +613,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
610
613
#define JUMPBY (x ) (next_instr += (x))
611
614
612
615
/* OpCode prediction macros
613
- Some opcodes tend to come in pairs thus making it possible to predict
614
- the second code when the first is run. For example, COMPARE_OP is often
615
- followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And, those opcodes are often
616
- followed by a POP_TOP.
616
+ Some opcodes tend to come in pairs thus making it possible to
617
+ predict the second code when the first is run. For example,
618
+ COMPARE_OP is often followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And,
619
+ those opcodes are often followed by a POP_TOP.
617
620
618
621
Verifying the prediction costs a single high-speed test of register
619
622
variable against a constant. If the pairing was good, then the
@@ -660,11 +663,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
660
663
#define PUSH (v ) { (void)(BASIC_PUSH(v), \
661
664
lltrace && prtrace(TOP(), "push")); \
662
665
assert(STACK_LEVEL() <= co->co_stacksize); }
663
- #define POP () ((void)(lltrace && prtrace(TOP(), "pop")), BASIC_POP())
666
+ #define POP () ((void)(lltrace && prtrace(TOP(), "pop")), \
667
+ BASIC_POP())
664
668
#define STACKADJ (n ) { (void)(BASIC_STACKADJ(n), \
665
669
lltrace && prtrace(TOP(), "stackadj")); \
666
670
assert(STACK_LEVEL() <= co->co_stacksize); }
667
- #define EXT_POP (STACK_POINTER ) (lltrace && prtrace((STACK_POINTER)[-1], "ext_pop"), *--(STACK_POINTER))
671
+ #define EXT_POP (STACK_POINTER ) (lltrace && prtrace((STACK_POINTER)[-1], \
672
+ "ext_pop"), *--(STACK_POINTER))
668
673
#else
669
674
#define PUSH (v ) BASIC_PUSH(v)
670
675
#define POP () BASIC_POP()
@@ -1568,7 +1573,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1568
1573
if ((x = f -> f_locals ) != NULL ) {
1569
1574
if ((err = PyObject_DelItem (x , w )) != 0 )
1570
1575
format_exc_check_arg (PyExc_NameError ,
1571
- NAME_ERROR_MSG ,w );
1576
+ NAME_ERROR_MSG ,
1577
+ w );
1572
1578
break ;
1573
1579
}
1574
1580
PyErr_Format (PyExc_SystemError ,
@@ -1579,24 +1585,28 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1579
1585
PREDICTED_WITH_ARG (UNPACK_SEQUENCE );
1580
1586
case UNPACK_SEQUENCE :
1581
1587
v = POP ();
1582
- if (PyTuple_CheckExact (v ) && PyTuple_GET_SIZE (v ) == oparg ) {
1583
- PyObject * * items = ((PyTupleObject * )v )-> ob_item ;
1588
+ if (PyTuple_CheckExact (v ) &&
1589
+ PyTuple_GET_SIZE (v ) == oparg ) {
1590
+ PyObject * * items = \
1591
+ ((PyTupleObject * )v )-> ob_item ;
1584
1592
while (oparg -- ) {
1585
1593
w = items [oparg ];
1586
1594
Py_INCREF (w );
1587
1595
PUSH (w );
1588
1596
}
1589
1597
Py_DECREF (v );
1590
1598
continue ;
1591
- } else if (PyList_CheckExact (v ) && PyList_GET_SIZE (v ) == oparg ) {
1592
- PyObject * * items = ((PyListObject * )v )-> ob_item ;
1599
+ } else if (PyList_CheckExact (v ) &&
1600
+ PyList_GET_SIZE (v ) == oparg ) {
1601
+ PyObject * * items = \
1602
+ ((PyListObject * )v )-> ob_item ;
1593
1603
while (oparg -- ) {
1594
1604
w = items [oparg ];
1595
1605
Py_INCREF (w );
1596
1606
PUSH (w );
1597
1607
}
1598
1608
} else if (unpack_iterable (v , oparg , -1 ,
1599
- stack_pointer + oparg )) {
1609
+ stack_pointer + oparg )) {
1600
1610
stack_pointer += oparg ;
1601
1611
} else {
1602
1612
/* unpack_iterable() raised an exception */
@@ -1669,7 +1679,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1669
1679
else {
1670
1680
x = PyObject_GetItem (v , w );
1671
1681
if (x == NULL && PyErr_Occurred ()) {
1672
- if (!PyErr_ExceptionMatches (PyExc_KeyError ))
1682
+ if (!PyErr_ExceptionMatches (
1683
+ PyExc_KeyError ))
1673
1684
break ;
1674
1685
PyErr_Clear ();
1675
1686
}
@@ -1681,7 +1692,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1681
1692
if (x == NULL ) {
1682
1693
format_exc_check_arg (
1683
1694
PyExc_NameError ,
1684
- NAME_ERROR_MSG , w );
1695
+ NAME_ERROR_MSG , w );
1685
1696
break ;
1686
1697
}
1687
1698
}
@@ -1782,13 +1793,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
1782
1793
UNBOUNDLOCAL_ERROR_MSG ,
1783
1794
v );
1784
1795
} else {
1785
- v = PyTuple_GET_ITEM (
1786
- co -> co_freevars ,
1787
- oparg - PyTuple_GET_SIZE (co -> co_cellvars ));
1788
- format_exc_check_arg (
1789
- PyExc_NameError ,
1790
- UNBOUNDFREE_ERROR_MSG ,
1791
- v );
1796
+ v = PyTuple_GET_ITEM (co -> co_freevars , oparg -
1797
+ PyTuple_GET_SIZE (co -> co_cellvars ));
1798
+ format_exc_check_arg (PyExc_NameError ,
1799
+ UNBOUNDFREE_ERROR_MSG , v );
1792
1800
}
1793
1801
break ;
1794
1802
@@ -2046,7 +2054,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
2046
2054
continue ;
2047
2055
}
2048
2056
if (PyErr_Occurred ()) {
2049
- if (!PyErr_ExceptionMatches (PyExc_StopIteration ))
2057
+ if (!PyErr_ExceptionMatches (
2058
+ PyExc_StopIteration ))
2050
2059
break ;
2051
2060
PyErr_Clear ();
2052
2061
}
@@ -2072,9 +2081,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
2072
2081
case SETUP_LOOP :
2073
2082
case SETUP_EXCEPT :
2074
2083
case SETUP_FINALLY :
2075
- /* NOTE: If you add any new block-setup opcodes that are
2076
- not try/except/finally handlers, you may need to
2077
- update the PyGen_NeedsFinalizing() function. */
2084
+ /* NOTE: If you add any new block-setup opcodes that
2085
+ are not try/except/finally handlers, you may need
2086
+ to update the PyGen_NeedsFinalizing() function.
2087
+ */
2078
2088
2079
2089
PyFrame_BlockSetup (f , opcode , INSTR_OFFSET () + oparg ,
2080
2090
STACK_LEVEL ());
@@ -3968,8 +3978,9 @@ string_concatenate(PyObject *v, PyObject *w,
3968
3978
if (v -> ob_refcnt == 2 ) {
3969
3979
/* In the common case, there are 2 references to the value
3970
3980
* stored in 'variable' when the += is performed: one on the
3971
- * value stack (in 'v') and one still stored in the 'variable'.
3972
- * We try to delete the variable now to reduce the refcnt to 1.
3981
+ * value stack (in 'v') and one still stored in the
3982
+ * 'variable'. We try to delete the variable now to reduce
3983
+ * the refcnt to 1.
3973
3984
*/
3974
3985
switch (* next_instr ) {
3975
3986
case STORE_FAST :
@@ -3982,7 +3993,8 @@ string_concatenate(PyObject *v, PyObject *w,
3982
3993
}
3983
3994
case STORE_DEREF :
3984
3995
{
3985
- PyObject * * freevars = f -> f_localsplus + f -> f_code -> co_nlocals ;
3996
+ PyObject * * freevars = (f -> f_localsplus +
3997
+ f -> f_code -> co_nlocals );
3986
3998
PyObject * c = freevars [PEEKARG ()];
3987
3999
if (PyCell_GET (c ) == v )
3988
4000
PyCell_Set (c , NULL );
@@ -4010,10 +4022,10 @@ string_concatenate(PyObject *v, PyObject *w,
4010
4022
*/
4011
4023
if (_PyString_Resize (& v , new_len ) != 0 ) {
4012
4024
/* XXX if _PyString_Resize() fails, 'v' has been
4013
- * deallocated so it cannot be put back into 'variable'.
4014
- * The MemoryError is raised when there is no value in
4015
- * 'variable', which might (very remotely) be a cause
4016
- * of incompatibilities.
4025
+ * deallocated so it cannot be put back into
4026
+ * 'variable'. The MemoryError is raised when there
4027
+ * is no value in 'variable', which might (very
4028
+ * remotely) be a cause of incompatibilities.
4017
4029
*/
4018
4030
return NULL ;
4019
4031
}
0 commit comments