New submission from Serhiy Storchaka:

Currently the compiler produces BUILD_MAP_UNPACK with an argument at most 255. 
If needed to merge more than 255 dictionaries, BUILD_MAP_UNPACK is called 
several times. But this is unneeded complication since BUILD_MAP_UNPACK doesn't 
have a limitation on its argument. Seems this code is the remnants from the 
patches when there was not the opcode BUILD_MAP_UNPACK_WITH_CALL, and 
BUILD_MAP_UNPACK packed the position of function name in higher bits of its 
argument.

Proposed patch simplifies the compiler, makes the bytecode faster if merge more 
than 255 dictionaries and more compact if merge more than 509 dictionaries.

BUILD_MAP_UNPACK was introduced in issue2292.

----------
components: Interpreter Core
files: BUILD_MAP_UNPACK-unlimited-arg.patch
keywords: patch
messages: 281885
nosy: Joshua.Landau, benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, 
neil.g, serhiy.storchaka, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Simplify compiling to BUILD_MAP_UNPACK
type: enhancement
versions: Python 3.7
Added file: 
http://bugs.python.org/file45676/BUILD_MAP_UNPACK-unlimited-arg.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to