Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-126204: Add a sys._jit_enabled helper #126247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 32 commits into from
Closed

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Oct 31, 2024

@Eclips4 Eclips4 marked this pull request as ready for review October 31, 2024 16:49
Copy link
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

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

I'm not convinced that pyconfig.h is the right home for this - it seems like just pulling it from sysconfig is sufficient.

I'd rather not take the changes in the PC/PCbuild directories if we don't have to.

Comment on lines -1785 to -1788
# Temporarily enable ignore_stderr=True to ignore warnings on JIT builds
# See gh-126255 for more information
self.check_all_configs("test_initconfig_api", config, preconfig,
api=API_ISOLATED, ignore_stderr=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

That's fun. Due to incorrect assumptions, where JIT is actually enabled or not, this hack is no longer needed. Just setting PYTHON_JIT=0 is enough here.

@Eclips4 Eclips4 requested a review from pablogsal November 10, 2024 03:24
@Eclips4 Eclips4 marked this pull request as ready for review November 10, 2024 03:24
@Eclips4 Eclips4 changed the title gh-126204: Add a Py_JIT_ENABLED variable to pyconfig.h gh-126204: Add a sys._jit_enabled helper Nov 10, 2024
@Eclips4 Eclips4 requested a review from picnixz November 10, 2024 15:34
Co-authored-by: BΓ©nΓ©dikt Tran <[email protected]>
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

A final nitpick. And a question: is there a lot of

_PyOptimizerObject* optimizer = _Py_GetOptimizer();
if (optimizer != NULL) {
	Py_DECREF(optimizer);
	...
}

in the code? if so, we could perhaps have some function that checks if there is an optimizer.

EDIT: Since we are moving to removing the _PyOptimizer API, it's possible we don't need this.

Co-authored-by: BΓ©nΓ©dikt Tran <[email protected]>
@Eclips4
Copy link
Member Author

Eclips4 commented Nov 11, 2024

A final nitpick. And a question: is there a lot of

_PyOptimizerObject* optimizer = _Py_GetOptimizer();
if (optimizer != NULL) {
	Py_DECREF(optimizer);
	...
}

in the code? if so, we could perhaps have some function that checks if there is an optimizer.

EDIT: Since we are moving to removing the _PyOptimizer API, it's possible we don't need this.

In fact, there are only two uses of _Py_GetOptimizer. I'm not sure if we should remove this usage in this PR.

@Eclips4 Eclips4 requested a review from zooba November 13, 2024 20:56
@Eclips4
Copy link
Member Author

Eclips4 commented Jan 30, 2025

Superseded by #129194

@Eclips4 Eclips4 closed this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants