Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8161ff8f
Commit
8161ff8f
authored
Jun 27, 2004
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #966493: Cleanup generator/eval_frame exposure.
parent
34242154
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
18 deletions
+13
-18
Include/Python.h
Include/Python.h
+1
-0
Include/ceval.h
Include/ceval.h
+1
-1
Include/genobject.h
Include/genobject.h
+4
-2
Objects/genobject.c
Objects/genobject.c
+1
-1
Python/ceval.c
Python/ceval.c
+6
-14
No files found.
Include/Python.h
View file @
8161ff8f
...
...
@@ -99,6 +99,7 @@
#include "sliceobject.h"
#include "cellobject.h"
#include "iterobject.h"
#include "genobject.h"
#include "descrobject.h"
#include "weakrefobject.h"
...
...
Include/ceval.h
View file @
8161ff8f
...
...
@@ -64,7 +64,7 @@ PyAPI_FUNC(char *) PyEval_GetFuncName(PyObject *);
PyAPI_FUNC
(
char
*
)
PyEval_GetFuncDesc
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyEval_GetCallStats
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyEval_Eval
uateFrame
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyEval_Eval
Frame
(
struct
_frame
*
);
/* this used to be handled on a per-thread basis - now just two globals */
PyAPI_DATA
(
volatile
int
)
_Py_Ticker
;
...
...
Include/genobject.h
View file @
8161ff8f
...
...
@@ -7,11 +7,13 @@
extern
"C"
{
#endif
struct
_frame
;
/* Avoid including frameobject.h */
typedef
struct
{
PyObject_HEAD
/* The gi_ prefix is intended to remind of generator-iterator. */
PyFrameObject
*
gi_frame
;
struct
_frame
*
gi_frame
;
/* True if generator is being executed. */
int
gi_running
;
...
...
@@ -25,7 +27,7 @@ PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) ((op)->ob_type == &PyGen_Type)
PyAPI_FUNC
(
PyObject
*
)
PyGen_New
(
PyFrameObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyGen_New
(
struct
_frame
*
);
#ifdef __cplusplus
}
...
...
Objects/genobject.c
View file @
8161ff8f
...
...
@@ -44,7 +44,7 @@ gen_iternext(PyGenObject *gen)
f
->
f_back
=
tstate
->
frame
;
gen
->
gi_running
=
1
;
result
=
PyEval_Eval
uateFrame
((
PyObject
*
)
f
);
result
=
PyEval_Eval
Frame
(
f
);
gen
->
gi_running
=
0
;
/* Don't keep the reference to f_back any longer than necessary. It
...
...
Python/ceval.c
View file @
8161ff8f
...
...
@@ -10,7 +10,6 @@
#include "compile.h"
#include "frameobject.h"
#include "genobject.h"
#include "eval.h"
#include "opcode.h"
#include "structmember.h"
...
...
@@ -49,7 +48,6 @@ void dump_tsc(int opcode, int ticked, uint64 inst0, uint64 inst1,
typedef
PyObject
*
(
*
callproc
)(
PyObject
*
,
PyObject
*
,
PyObject
*
);
/* Forward declarations */
static
PyObject
*
eval_frame
(
PyFrameObject
*
);
#ifdef WITH_TSC
static
PyObject
*
call_function
(
PyObject
***
,
int
,
uint64
*
,
uint64
*
);
#else
...
...
@@ -458,8 +456,8 @@ PyEval_EvalCode(PyCodeObject *co, PyObject *globals, PyObject *locals)
/* Interpreter main loop */
static
PyObject
*
eval_f
rame
(
PyFrameObject
*
f
)
PyObject
*
PyEval_EvalF
rame
(
PyFrameObject
*
f
)
{
#ifdef DXPAIRS
int
lastopcode
=
0
;
...
...
@@ -2455,8 +2453,8 @@ fast_yield:
}
/* this is gonna seem *real weird*, but if you put some other code between
eval_frame() and PyEval_EvalCodeEx() you will need to adjust the test in
the if statement in Misc/gdbinit:ppystack */
PyEval_EvalFrame() and PyEval_EvalCodeEx() you will need to adjust
the test in
the if statement in Misc/gdbinit:ppystack */
PyObject
*
PyEval_EvalCodeEx
(
PyCodeObject
*
co
,
PyObject
*
globals
,
PyObject
*
locals
,
...
...
@@ -2684,7 +2682,7 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
return
PyGen_New
(
f
);
}
retval
=
eval_f
rame
(
f
);
retval
=
PyEval_EvalF
rame
(
f
);
fail:
/* Jump here from prelude on failure */
...
...
@@ -3415,12 +3413,6 @@ PyEval_GetFuncDesc(PyObject *func)
}
}
PyObject
*
PyEval_EvaluateFrame
(
PyObject
*
fo
)
{
return
eval_frame
((
PyFrameObject
*
)
fo
);
}
#define EXT_POP(STACK_POINTER) (*--(STACK_POINTER))
static
void
...
...
@@ -3597,7 +3589,7 @@ fast_function(PyObject *func, PyObject ***pp_stack, int n, int na, int nk)
Py_INCREF
(
*
stack
);
fastlocals
[
i
]
=
*
stack
++
;
}
retval
=
eval_f
rame
(
f
);
retval
=
PyEval_EvalF
rame
(
f
);
assert
(
tstate
!=
NULL
);
++
tstate
->
recursion_depth
;
Py_DECREF
(
f
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment