mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-44525: Split calls into PRECALL and CALL (GH-30011)
* Add 3 new opcodes for calls: PRECALL_METHOD, CALL_NO_KW, CALL_KW. * Update specialization to handle new CALL opcodes. * Specialize call to method descriptors. * Remove old CALL opcodes: CALL_FUNCTION, CALL_METHOD, CALL_METHOD_KW, CALL_FUNCTION_KW.
This commit is contained in:
parent
d60457a667
commit
9f8f45144b
15 changed files with 395 additions and 236 deletions
|
@ -839,7 +839,7 @@ if 1:
|
|||
self.assertNotIn('LOAD_METHOD', instructions)
|
||||
self.assertNotIn('CALL_METHOD', instructions)
|
||||
self.assertIn('LOAD_ATTR', instructions)
|
||||
self.assertIn('CALL_FUNCTION', instructions)
|
||||
self.assertIn('CALL_NO_KW', instructions)
|
||||
|
||||
def test_lineno_procedure_call(self):
|
||||
def call():
|
||||
|
@ -1095,7 +1095,7 @@ f(
|
|||
)
|
||||
"""
|
||||
compiled_code, _ = self.check_positions_against_ast(snippet)
|
||||
self.assertOpcodeSourcePositionIs(compiled_code, 'CALL_FUNCTION',
|
||||
self.assertOpcodeSourcePositionIs(compiled_code, 'CALL_NO_KW',
|
||||
line=1, end_line=3, column=0, end_column=1)
|
||||
|
||||
def test_very_long_line_end_offset(self):
|
||||
|
@ -1105,7 +1105,7 @@ f(
|
|||
snippet = f"g('{long_string}')"
|
||||
|
||||
compiled_code, _ = self.check_positions_against_ast(snippet)
|
||||
self.assertOpcodeSourcePositionIs(compiled_code, 'CALL_FUNCTION',
|
||||
self.assertOpcodeSourcePositionIs(compiled_code, 'CALL_NO_KW',
|
||||
line=1, end_line=1, column=None, end_column=None)
|
||||
|
||||
def test_complex_single_line_expression(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue