mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-131738: optimize builtin any/all/tuple calls with a generator expression arg (#131737)
This commit is contained in:
		
							parent
							
								
									674dbf3b3a
								
							
						
					
					
						commit
						2c8f329dc6
					
				
					 16 changed files with 199 additions and 38 deletions
				
			
		
							
								
								
									
										12
									
								
								Python/generated_cases.c.h
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										12
									
								
								Python/generated_cases.c.h
									
										
									
										generated
									
									
									
								
							|  | @ -8723,16 +8723,8 @@ | |||
|             INSTRUCTION_STATS(LOAD_COMMON_CONSTANT); | ||||
|             _PyStackRef value; | ||||
|             // Keep in sync with _common_constants in opcode.py
 | ||||
|             // If we ever have more than two constants, use a lookup table
 | ||||
|             PyObject *val; | ||||
|             if (oparg == CONSTANT_ASSERTIONERROR) { | ||||
|                 val = PyExc_AssertionError; | ||||
|             } | ||||
|             else { | ||||
|                 assert(oparg == CONSTANT_NOTIMPLEMENTEDERROR); | ||||
|                 val = PyExc_NotImplementedError; | ||||
|             } | ||||
|             value = PyStackRef_FromPyObjectImmortal(val); | ||||
|             assert(oparg < NUM_COMMON_CONSTANTS); | ||||
|             value = PyStackRef_FromPyObjectNew(tstate->interp->common_consts[oparg]); | ||||
|             stack_pointer[0] = value; | ||||
|             stack_pointer += 1; | ||||
|             assert(WITHIN_STACK_BOUNDS()); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Irit Katriel
						Irit Katriel