-
Notifications
You must be signed in to change notification settings - Fork 23
[opcode][3.11] support CALL_FUNCTION_EX
in py311
#362
[opcode][3.11] support CALL_FUNCTION_EX
in py311
#362
Conversation
Thanks for your contribution! |
…ort_RETURN_VALUE_py311 # Conflicts: # tests/run_all.sh
if len(self.stack) == 1 and isinstance(self.stack.peek(), NullVariable): | ||
self.stack.pop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是可以备注一下什么情况下会出现多出来一个Null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前这个测试来看的话是只有LOAD_GLOBAL
会
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但是理论上所有LOAD_GLOBAL出来的null在CALL的时候就应该已经被移除了,RETURN这里应该就没有了,如果还有的话感觉应该是哪里还有些问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
从这个单测来看的话没调用CALL
, 应该是这其中的某个也需要pop
[transform] OriginCode: build_tuple_unpack_with_call
31 0 RESUME 0
34 2 LOAD_GLOBAL 1 (NULL + build_tuple_unpack_with_call_inner)
14 BUILD_LIST 0
16 LOAD_FAST 0 (x)
18 LIST_EXTEND 1
20 LOAD_FAST 1 (y)
22 LIST_EXTEND 1
24 LIST_TO_TUPLE
26 CALL_FUNCTION_EX 0
28 STORE_FAST 2 (z)
35 30 LOAD_FAST 2 (z)
32 LOAD_CONST 1 (0)
34 BINARY_SUBSCR
44 LOAD_CONST 2 (1)
46 BINARY_OP 0 (+)
50 RETURN_VALUE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该要在CALL_FUNCTION_EX
下做pop
的,写错了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMeow 🐾
现在的实现和我之前调研的应该是一致的
CALL_FUNCTION_EX
in py311
相关任务:任务 1
单测状态变化:
test_10_build_unpack.py
❌ -> ✅