KEMBAR78
[mypyc] Merge new_list_op and new_set_op by TH3CHARLie · Pull Request #9378 · python/mypy · GitHub
Skip to content

Conversation

@TH3CHARLie
Copy link
Collaborator

This PR builds new_list_op in irbuild.

For empty list, we introduce a c_custom_op to do the job. To set the following list item, we rely on pointer addition and LoadMem

@TH3CHARLie TH3CHARLie marked this pull request as draft August 30, 2020 14:04
@TH3CHARLie
Copy link
Collaborator Author

Unfortunately, the 32bit test suite is failing because the offset computation in IR is foo = bar + 8 while on 32bit platform it should be foo = bar + 4.

@TH3CHARLie TH3CHARLie requested a review from JukkaL August 30, 2020 14:49
@TH3CHARLie TH3CHARLie marked this pull request as ready for review August 30, 2020 14:50
@JukkaL
Copy link
Collaborator

JukkaL commented Sep 2, 2020

Unfortunately, the 32bit test suite is failing because the offset computation in IR is foo = bar + 8 while on 32bit platform it should be foo = bar + 4.

Similar to how we have native_int, we could add WORD_SIZE as a constant that gets replaced with the number of bytes in a word in a test case description (4 on a 32-bit platform and 8 on a 64-bit platform).

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Overall approach looks good. It's great that we can represent such complicated ops in the IR. Left various comments about details. The biggest issues are the type attribute of SetMem (see the comment in refcount.py) and handling of set items.

@TH3CHARLie TH3CHARLie requested a review from JukkaL September 6, 2020 14:17
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the updates! Looks good now.

@JukkaL JukkaL merged commit d066e44 into python:master Sep 9, 2020
@TH3CHARLie TH3CHARLie deleted the list-new-op branch September 9, 2020 09:49
@TH3CHARLie
Copy link
Collaborator Author

Thanks for the review!

Sign up for free to 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.

2 participants