Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7683602

Browse files
committed
Changes for frame object speedup:
- get fastlocals differently - call newframeobject() with fewer arguments - toss getowner(), which was unused anyway
1 parent f3e85a0 commit 7683602

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

Python/ceval.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,14 @@ eval_code2(co, globals, locals,
403403
current_frame, /*back*/
404404
co, /*code*/
405405
globals, /*globals*/
406-
locals, /*locals*/
407-
owner, /*owner*/
408-
co->co_stacksize, /*nvalues*/
409-
CO_MAXBLOCKS); /*nblocks*/
406+
locals); /*locals*/
410407
if (f == NULL)
411408
return NULL;
412409

413410
current_frame = f;
414411

415412
if (co->co_nlocals > 0)
416-
fastlocals = ((listobject *)f->f_fastlocals)->ob_item;
413+
fastlocals = f->f_localsplus;
417414

418415
if (co->co_argcount > 0 ||
419416
co->co_flags & (CO_VARARGS | CO_VARKEYWORDS)) {
@@ -2129,15 +2126,6 @@ getglobals()
21292126
return current_frame->f_globals;
21302127
}
21312128

2132-
object *
2133-
getowner()
2134-
{
2135-
if (current_frame == NULL)
2136-
return NULL;
2137-
else
2138-
return current_frame->f_owner;
2139-
}
2140-
21412129
object *
21422130
getframe()
21432131
{

0 commit comments

Comments
 (0)