mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
Changes for frame object speedup:
- get fastlocals differently - call newframeobject() with fewer arguments - toss getowner(), which was unused anyway
This commit is contained in:
parent
f3e85a0356
commit
768360243a
1 changed files with 2 additions and 14 deletions
|
@ -403,17 +403,14 @@ eval_code2(co, globals, locals,
|
||||||
current_frame, /*back*/
|
current_frame, /*back*/
|
||||||
co, /*code*/
|
co, /*code*/
|
||||||
globals, /*globals*/
|
globals, /*globals*/
|
||||||
locals, /*locals*/
|
locals); /*locals*/
|
||||||
owner, /*owner*/
|
|
||||||
co->co_stacksize, /*nvalues*/
|
|
||||||
CO_MAXBLOCKS); /*nblocks*/
|
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
current_frame = f;
|
current_frame = f;
|
||||||
|
|
||||||
if (co->co_nlocals > 0)
|
if (co->co_nlocals > 0)
|
||||||
fastlocals = ((listobject *)f->f_fastlocals)->ob_item;
|
fastlocals = f->f_localsplus;
|
||||||
|
|
||||||
if (co->co_argcount > 0 ||
|
if (co->co_argcount > 0 ||
|
||||||
co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) {
|
co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) {
|
||||||
|
@ -2129,15 +2126,6 @@ getglobals()
|
||||||
return current_frame->f_globals;
|
return current_frame->f_globals;
|
||||||
}
|
}
|
||||||
|
|
||||||
object *
|
|
||||||
getowner()
|
|
||||||
{
|
|
||||||
if (current_frame == NULL)
|
|
||||||
return NULL;
|
|
||||||
else
|
|
||||||
return current_frame->f_owner;
|
|
||||||
}
|
|
||||||
|
|
||||||
object *
|
object *
|
||||||
getframe()
|
getframe()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue