mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-134584: Specialize POP_TOP by reference and type in JIT (GH-135761)
This commit is contained in:
		
							parent
							
								
									99712c45cc
								
							
						
					
					
						commit
						569fc6870f
					
				
					 12 changed files with 239 additions and 62 deletions
				
			
		
							
								
								
									
										40
									
								
								Python/executor_cases.c.h
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										40
									
								
								Python/executor_cases.c.h
									
										
									
										generated
									
									
									
								
							|  | @ -539,6 +539,46 @@ | |||
|             break; | ||||
|         } | ||||
| 
 | ||||
|         case _POP_TOP_NOP: { | ||||
|             _PyStackRef value; | ||||
|             value = stack_pointer[-1]; | ||||
|             assert(PyStackRef_IsNull(value) || (!PyStackRef_RefcountOnObject(value)) || | ||||
|                    _Py_IsImmortal((PyStackRef_AsPyObjectBorrow(value)))); | ||||
|             stack_pointer += -1; | ||||
|             assert(WITHIN_STACK_BOUNDS()); | ||||
|             break; | ||||
|         } | ||||
| 
 | ||||
|         case _POP_TOP_INT: { | ||||
|             _PyStackRef value; | ||||
|             value = stack_pointer[-1]; | ||||
|             assert(PyLong_CheckExact(PyStackRef_AsPyObjectBorrow(value))); | ||||
|             PyStackRef_CLOSE_SPECIALIZED(value, _PyLong_ExactDealloc); | ||||
|             stack_pointer += -1; | ||||
|             assert(WITHIN_STACK_BOUNDS()); | ||||
|             break; | ||||
|         } | ||||
| 
 | ||||
|         case _POP_TOP_FLOAT: { | ||||
|             _PyStackRef value; | ||||
|             value = stack_pointer[-1]; | ||||
|             assert(PyFloat_CheckExact(PyStackRef_AsPyObjectBorrow(value))); | ||||
|             PyStackRef_CLOSE_SPECIALIZED(value, _PyFloat_ExactDealloc); | ||||
|             stack_pointer += -1; | ||||
|             assert(WITHIN_STACK_BOUNDS()); | ||||
|             break; | ||||
|         } | ||||
| 
 | ||||
|         case _POP_TOP_UNICODE: { | ||||
|             _PyStackRef value; | ||||
|             value = stack_pointer[-1]; | ||||
|             assert(PyUnicode_CheckExact(PyStackRef_AsPyObjectBorrow(value))); | ||||
|             PyStackRef_CLOSE_SPECIALIZED(value, _PyUnicode_ExactDealloc); | ||||
|             stack_pointer += -1; | ||||
|             assert(WITHIN_STACK_BOUNDS()); | ||||
|             break; | ||||
|         } | ||||
| 
 | ||||
|         case _POP_TWO: { | ||||
|             _PyStackRef tos; | ||||
|             _PyStackRef nos; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ken Jin
						Ken Jin