- Notifications
You must be signed in to change notification settings - Fork 52
Closed
Description
Currently we go through a two stage process to get to the adaptive form of instructions.
The explanation below uses CALL
, but it applies to all specializable instructions.
- When unmarshaling the code object we create the bytecode
CALL, oparg, 0, 0, 0 ...
where the zeros are the cache. - When executing, check a counter and quicken when that counter reaches zero.
- When quickening, replace all
CALL
s withCALL_ADAPTIVE
s.
Instead we should quicken when unmarshaling, so that we create:
(CALL_ADAPTIVE oparg) 7 # uint16_t not byte pair ...
instead of
(CALL oparg) (0 0)
The marshaled form only needs one byte for instructions without an oparg and two for other instructions. No space is needed for the cache.
ericsnowcurrently
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done