Skip to content

Commit a1b0590

Browse files
authored
Merge branch 'main' into gh-144316-get_stack_trace
2 parents 39b6abe + 67ddba9 commit a1b0590

37 files changed

+2385
-1809
lines changed

Doc/library/urllib.parse.rst

Lines changed: 81 additions & 135 deletions
Large diffs are not rendered by default.

Doc/library/venv.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ subclass which installs setuptools and pip into a created virtual environment::
550550
from subprocess import Popen, PIPE
551551
import sys
552552
from threading import Thread
553-
from urllib.parse import urlparse
553+
from urllib.parse import urlsplit
554554
from urllib.request import urlretrieve
555555
import venv
556556

@@ -621,7 +621,7 @@ subclass which installs setuptools and pip into a created virtual environment::
621621
stream.close()
622622

623623
def install_script(self, context, name, url):
624-
_, _, path, _, _, _ = urlparse(url)
624+
_, _, path, _, _ = urlsplit(url)
625625
fn = os.path.split(path)[-1]
626626
binpath = context.bin_path
627627
distpath = os.path.join(binpath, fn)

Doc/whatsnew/3.15.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -968,10 +968,10 @@ unittest
968968
urllib.parse
969969
------------
970970

971-
* Add the *missing_as_none* parameter to :func:`~urllib.parse.urlparse`,
972-
:func:`~urllib.parse.urlsplit` and :func:`~urllib.parse.urldefrag` functions.
973-
Add the *keep_empty* parameter to :func:`~urllib.parse.urlunparse` and
974-
:func:`~urllib.parse.urlunsplit` functions.
971+
* Add the *missing_as_none* parameter to :func:`~urllib.parse.urlsplit`,
972+
:func:`~urllib.parse.urlparse` and :func:`~urllib.parse.urldefrag` functions.
973+
Add the *keep_empty* parameter to :func:`~urllib.parse.urlunsplit` and
974+
:func:`~urllib.parse.urlunparse` functions.
975975
This allows to distinguish between empty and not defined URI components
976976
and preserve empty components.
977977
(Contributed by Serhiy Storchaka in :gh:`67041`.)

Include/internal/pycore_opcode_metadata.h

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_optimizer.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ extern JitOptRef _Py_uop_sym_new_compact_int(JitOptContext *ctx);
298298
extern void _Py_uop_sym_set_compact_int(JitOptContext *ctx, JitOptRef sym);
299299
extern JitOptRef _Py_uop_sym_new_predicate(JitOptContext *ctx, JitOptRef lhs_ref, JitOptRef rhs_ref, JitOptPredicateKind kind);
300300
extern void _Py_uop_sym_apply_predicate_narrowing(JitOptContext *ctx, JitOptRef sym, bool branch_is_true);
301+
extern void _Py_uop_sym_set_recorded_value(JitOptContext *ctx, JitOptRef sym, PyObject *value);
302+
extern void _Py_uop_sym_set_recorded_type(JitOptContext *ctx, JitOptRef sym, PyTypeObject *type);
303+
extern void _Py_uop_sym_set_recorded_gen_func(JitOptContext *ctx, JitOptRef ref, PyFunctionObject *value);
304+
extern PyCodeObject *_Py_uop_sym_get_probable_func_code(JitOptRef sym);
305+
extern PyObject *_Py_uop_sym_get_probable_value(JitOptRef sym);
301306

302307
extern void _Py_uop_abstractcontext_init(JitOptContext *ctx);
303308
extern void _Py_uop_abstractcontext_fini(JitOptContext *ctx);
@@ -308,6 +313,14 @@ extern _Py_UOpsAbstractFrame *_Py_uop_frame_new(
308313
int curr_stackentries,
309314
JitOptRef *args,
310315
int arg_len);
316+
317+
extern _Py_UOpsAbstractFrame *_Py_uop_frame_new_from_symbol(
318+
JitOptContext *ctx,
319+
JitOptRef callable,
320+
int curr_stackentries,
321+
JitOptRef *args,
322+
int arg_len);
323+
311324
extern int _Py_uop_frame_pop(JitOptContext *ctx, PyCodeObject *co, int curr_stackentries);
312325

313326
PyAPI_FUNC(PyObject *) _Py_uop_symbols_test(PyObject *self, PyObject *ignored);
@@ -341,6 +354,7 @@ _PyJit_TryInitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame,
341354
int oparg, _PyExecutorObject *current_executor);
342355

343356
PyAPI_FUNC(void) _PyJit_FinalizeTracing(PyThreadState *tstate, int err);
357+
void _PyPrintExecutor(_PyExecutorObject *executor, const _PyUOpInstruction *marker);
344358
void _PyJit_TracerFree(_PyThreadStateImpl *_tstate);
345359

346360
void _PyJit_Tracer_InvalidateDependency(PyThreadState *old_tstate, void *obj);

Include/internal/pycore_optimizer_types.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ typedef enum _JitSymType {
4141
JIT_SYM_TRUTHINESS_TAG = 9,
4242
JIT_SYM_COMPACT_INT = 10,
4343
JIT_SYM_PREDICATE_TAG = 11,
44+
JIT_SYM_RECORDED_VALUE_TAG = 12,
45+
JIT_SYM_RECORDED_TYPE_TAG = 13,
46+
JIT_SYM_RECORDED_GEN_FUNC_TAG = 14,
4447
} JitSymType;
4548

4649
typedef struct _jit_opt_known_class {
@@ -87,6 +90,24 @@ typedef struct {
8790
uint16_t rhs;
8891
} JitOptPredicate;
8992

93+
typedef struct _jit_opt_recorded_value {
94+
uint8_t tag;
95+
bool known_type;
96+
PyObject *value;
97+
} JitOptRecordedValue;
98+
99+
typedef struct _jit_opt_recorded_type {
100+
uint8_t tag;
101+
PyTypeObject *type;
102+
} JitOptRecordedType;
103+
104+
/* Represents a generator, but we record the
105+
* function as the generator is emphemeral */
106+
typedef struct _jit_opt_recorded_gen_func {
107+
uint8_t tag;
108+
PyFunctionObject *func;
109+
} JitOptRecordedGenFunc;
110+
90111
typedef struct {
91112
uint8_t tag;
92113
} JitOptCompactInt;
@@ -100,6 +121,9 @@ typedef union _jit_opt_symbol {
100121
JitOptTruthiness truthiness;
101122
JitOptCompactInt compact;
102123
JitOptPredicate predicate;
124+
JitOptRecordedValue recorded_value;
125+
JitOptRecordedType recorded_type;
126+
JitOptRecordedGenFunc recorded_gen_func;
103127
} JitOptSymbol;
104128

105129
// This mimics the _PyStackRef API

0 commit comments

Comments
 (0)