mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	gh-91719: Reload opcode on unknown error so that C can optimize the dispatching in ceval.c (#94364)
This commit is contained in:
		
							parent
							
								
									d68f2d27bb
								
							
						
					
					
						commit
						ea39b77de9
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		|  | @ -0,0 +1,2 @@ | ||||||
|  | Reload ``opcode`` when raising ``unknown opcode error`` in the interpreter main loop, | ||||||
|  | for C compilers to generate dispatching code independently. | ||||||
|  | @ -5706,6 +5706,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int | ||||||
| #else | #else | ||||||
|         EXTRA_CASES  // From opcode.h, a 'case' for each unused opcode
 |         EXTRA_CASES  // From opcode.h, a 'case' for each unused opcode
 | ||||||
| #endif | #endif | ||||||
|  |             /* Tell C compilers not to hold the opcode variable in the loop.
 | ||||||
|  |                next_instr points the current instruction without TARGET(). */ | ||||||
|  |             opcode = _Py_OPCODE(*next_instr); | ||||||
|             fprintf(stderr, "XXX lineno: %d, opcode: %d\n", |             fprintf(stderr, "XXX lineno: %d, opcode: %d\n", | ||||||
|                     _PyInterpreterFrame_GetLine(frame),  opcode); |                     _PyInterpreterFrame_GetLine(frame),  opcode); | ||||||
|             _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); |             _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neonene
						neonene