mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Record cache hits for BINARY_SUBSCR specializations (GH-29060)
This commit is contained in:
		
							parent
							
								
									09c04e7f0d
								
							
						
					
					
						commit
						6e35b096ac
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -2242,6 +2242,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | ||||||
|             Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0]; |             Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0]; | ||||||
|             DEOPT_IF(index >= PyList_GET_SIZE(list), BINARY_SUBSCR); |             DEOPT_IF(index >= PyList_GET_SIZE(list), BINARY_SUBSCR); | ||||||
| 
 | 
 | ||||||
|  |             record_hit_inline(next_instr, oparg); | ||||||
|             STAT_INC(BINARY_SUBSCR, hit); |             STAT_INC(BINARY_SUBSCR, hit); | ||||||
|             PyObject *res = PyList_GET_ITEM(list, index); |             PyObject *res = PyList_GET_ITEM(list, index); | ||||||
|             assert(res != NULL); |             assert(res != NULL); | ||||||
|  | @ -2266,6 +2267,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | ||||||
|             Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0]; |             Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0]; | ||||||
|             DEOPT_IF(index >= PyTuple_GET_SIZE(tuple), BINARY_SUBSCR); |             DEOPT_IF(index >= PyTuple_GET_SIZE(tuple), BINARY_SUBSCR); | ||||||
| 
 | 
 | ||||||
|  |             record_hit_inline(next_instr, oparg); | ||||||
|             STAT_INC(BINARY_SUBSCR, hit); |             STAT_INC(BINARY_SUBSCR, hit); | ||||||
|             PyObject *res = PyTuple_GET_ITEM(tuple, index); |             PyObject *res = PyTuple_GET_ITEM(tuple, index); | ||||||
|             assert(res != NULL); |             assert(res != NULL); | ||||||
|  | @ -2280,6 +2282,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | ||||||
|         TARGET(BINARY_SUBSCR_DICT) { |         TARGET(BINARY_SUBSCR_DICT) { | ||||||
|             PyObject *dict = SECOND(); |             PyObject *dict = SECOND(); | ||||||
|             DEOPT_IF(!PyDict_CheckExact(SECOND()), BINARY_SUBSCR); |             DEOPT_IF(!PyDict_CheckExact(SECOND()), BINARY_SUBSCR); | ||||||
|  |             record_hit_inline(next_instr, oparg); | ||||||
|             STAT_INC(BINARY_SUBSCR, hit); |             STAT_INC(BINARY_SUBSCR, hit); | ||||||
|             PyObject *sub = TOP(); |             PyObject *sub = TOP(); | ||||||
|             PyObject *res = PyDict_GetItemWithError(dict, sub); |             PyObject *res = PyDict_GetItemWithError(dict, sub); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ken Jin
						Ken Jin