Skip to content

Conversation

@penguin-wwy
Copy link
Contributor

@penguin-wwypenguin-wwy commented Mar 24, 2022

@brandtbucher
Copy link
Member

Is this ready for review?

If not, perhaps mark it as a "draft" for now.

@brandtbucherbrandtbucher self-requested a review March 24, 2022 17:12
@brandtbucherbrandtbucher mentioned this pull request Mar 24, 2022
26 tasks
@penguin-wwypenguin-wwy marked this pull request as draft March 24, 2022 18:03
@penguin-wwypenguin-wwy marked this pull request as ready for review March 25, 2022 14:43
@markshannon
Copy link
Member

Looks promising. Will need some tests for the new output format.

@penguin-wwy
Copy link
ContributorAuthor

One problem is that some instructions are too long(like PRECALL_BUILTIN_FAST_WITH_KEYWORDS), do I need to increase _OPNAME_WIDTH

defadaptive_test(a, b): c=a+bprint(c.__class__)

Exec dis(adaptive_test):

 30 0 RESUME 0 31 2 LOAD_FAST 0 (a) 4 LOAD_FAST 1 (b) 6 BINARY_OP 0 (+) 10 STORE_FAST 2 (c) 32 12 LOAD_GLOBAL 1 (NULL + print) 24 LOAD_FAST 2 (c) 26 LOAD_ATTR 1 (__class__) 36 PRECALL 1 40 CALL 1 50 POP_TOP 52 LOAD_CONST 0 (None) 54 RETURN_VALUE 

Exec dis(adaptive_test, adaptive=True):

 30 0 RESUME_QUICK 0 31 2 LOAD_FAST__LOAD_FAST 0 (a) 4 LOAD_FAST 1 (b) 6 BINARY_OP_ADD_INT 0 (+) 10 STORE_FAST 2 (c) 32 12 LOAD_GLOBAL_BUILTIN 1 (NULL + print) 24 LOAD_FAST 2 (c) 26 LOAD_ATTR_SLOT 1 (__class__) 36 PRECALL_BUILTIN_FAST_WITH_KEYWORDS 1 40 CALL_ADAPTIVE 1 50 POP_TOP 52 LOAD_CONST 0 (None) 54 RETURN_VALUE 

@penguin-wwy
Copy link
ContributorAuthor

penguin-wwy commented Apr 2, 2022

Looks promising. Will need some tests for the new output format.

Already add some test cases for quicken code in the dis.

Copy link
Member

@markshannonmarkshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the changes to _testinternalcapi, so we don't need to export the _PyCode_Quicken function.

@brandtbucherbrandtbucher mentioned this pull request Apr 10, 2022
@penguin-wwypenguin-wwy changed the title bpo-46841: Disassembly of quickened codegh-90997: bpo-46841: Disassembly of quickened codeApr 14, 2022
@penguin-wwy
Copy link
ContributorAuthor

I have made the requested changes; please review again :) @markshannon@brandtbucher

@bedevere-bot
Copy link

Thanks for making the requested changes!

: please review the changes made to this pull request.

@markshannon
Copy link
Member

On small typo, otherwise looks good.

@penguin-wwy
Copy link
ContributorAuthor

Thanks. :)
I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

: please review the changes made to this pull request.

@markshannon
Copy link
Member

Thanks @penguin-wwy for doing this.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@penguin-wwy@brandtbucher@markshannon@bedevere-bot@the-knights-who-say-ni