Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit619edb8

Browse files
authored
gh-132336: Mark a few "slow path" functions used by the interpreter loop as noinline (#132337)
Mark a few functions used by the interpreter loop as noinlineThese are all the slow path and should not be inlined into the interpreterloop. Unfortunately, they end up being inlined with LTO and the current PGOtask.
1 parent5f1aed1 commit619edb8

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

‎Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ skip_to_next_entry(unsigned char *p, unsigned char *end) {
14271427

14281428
#defineMAX_LINEAR_SEARCH 40
14291429

1430-
staticint
1430+
staticPy_NO_INLINEint
14311431
get_exception_handler(PyCodeObject*code,intindex,int*level,int*handler,int*lasti)
14321432
{
14331433
unsignedchar*start= (unsignedchar*)PyBytes_AS_STRING(code->co_exceptiontable);

‎Python/instrumentation.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ call_instrumentation_vector(
12001200
returnerr;
12011201
}
12021202

1203-
int
1203+
Py_NO_INLINEint
12041204
_Py_call_instrumentation(
12051205
PyThreadState*tstate,intevent,
12061206
_PyInterpreterFrame*frame,_Py_CODEUNIT*instr)
@@ -1209,7 +1209,7 @@ _Py_call_instrumentation(
12091209
returncall_instrumentation_vector(instr,tstate,event,frame,instr,2,args);
12101210
}
12111211

1212-
int
1212+
Py_NO_INLINEint
12131213
_Py_call_instrumentation_arg(
12141214
PyThreadState*tstate,intevent,
12151215
_PyInterpreterFrame*frame,_Py_CODEUNIT*instr,PyObject*arg)
@@ -1218,7 +1218,7 @@ _Py_call_instrumentation_arg(
12181218
returncall_instrumentation_vector(instr,tstate,event,frame,instr,3,args);
12191219
}
12201220

1221-
int
1221+
Py_NO_INLINEint
12221222
_Py_call_instrumentation_2args(
12231223
PyThreadState*tstate,intevent,
12241224
_PyInterpreterFrame*frame,_Py_CODEUNIT*instr,PyObject*arg0,PyObject*arg1)
@@ -1227,7 +1227,7 @@ _Py_call_instrumentation_2args(
12271227
returncall_instrumentation_vector(instr,tstate,event,frame,instr,4,args);
12281228
}
12291229

1230-
_Py_CODEUNIT*
1230+
Py_NO_INLINE_Py_CODEUNIT*
12311231
_Py_call_instrumentation_jump(
12321232
_Py_CODEUNIT*instr,PyThreadState*tstate,intevent,
12331233
_PyInterpreterFrame*frame,_Py_CODEUNIT*src,_Py_CODEUNIT*dest)
@@ -1271,7 +1271,7 @@ call_instrumentation_vector_protected(
12711271
assert(_PyErr_Occurred(tstate));
12721272
}
12731273

1274-
void
1274+
Py_NO_INLINEvoid
12751275
_Py_call_instrumentation_exc2(
12761276
PyThreadState*tstate,intevent,
12771277
_PyInterpreterFrame*frame,_Py_CODEUNIT*instr,PyObject*arg0,PyObject*arg1)
@@ -1294,7 +1294,7 @@ _Py_Instrumentation_GetLine(PyCodeObject *code, int index)
12941294
returnline;
12951295
}
12961296

1297-
int
1297+
Py_NO_INLINEint
12981298
_Py_call_instrumentation_line(PyThreadState*tstate,_PyInterpreterFrame*frame,_Py_CODEUNIT*instr,_Py_CODEUNIT*prev)
12991299
{
13001300
PyCodeObject*code=_PyFrame_GetCode(frame);
@@ -1396,7 +1396,7 @@ _Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame,
13961396
returnoriginal_opcode;
13971397
}
13981398

1399-
int
1399+
Py_NO_INLINEint
14001400
_Py_call_instrumentation_instruction(PyThreadState*tstate,_PyInterpreterFrame*frame,_Py_CODEUNIT*instr)
14011401
{
14021402
PyCodeObject*code=_PyFrame_GetCode(frame);

‎Python/specialize.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ specialize_module_load_attr(
818818

819819
/* Attribute specialization */
820820

821-
void
821+
Py_NO_INLINEvoid
822822
_Py_Specialize_LoadSuperAttr(_PyStackRefglobal_super_st,_PyStackRefcls_st,_Py_CODEUNIT*instr,intload_method) {
823823
PyObject*global_super=PyStackRef_AsPyObjectBorrow(global_super_st);
824824
PyObject*cls=PyStackRef_AsPyObjectBorrow(cls_st);
@@ -1342,7 +1342,7 @@ specialize_instance_load_attr(PyObject* owner, _Py_CODEUNIT* instr, PyObject* na
13421342
returnresult;
13431343
}
13441344

1345-
void
1345+
Py_NO_INLINEvoid
13461346
_Py_Specialize_LoadAttr(_PyStackRefowner_st,_Py_CODEUNIT*instr,PyObject*name)
13471347
{
13481348
PyObject*owner=PyStackRef_AsPyObjectBorrow(owner_st);
@@ -1373,7 +1373,7 @@ _Py_Specialize_LoadAttr(_PyStackRef owner_st, _Py_CODEUNIT *instr, PyObject *nam
13731373
}
13741374
}
13751375

1376-
void
1376+
Py_NO_INLINEvoid
13771377
_Py_Specialize_StoreAttr(_PyStackRefowner_st,_Py_CODEUNIT*instr,PyObject*name)
13781378
{
13791379
PyObject*owner=PyStackRef_AsPyObjectBorrow(owner_st);
@@ -1771,7 +1771,7 @@ specialize_load_global_lock_held(
17711771
unspecialize(instr);
17721772
}
17731773

1774-
void
1774+
Py_NO_INLINEvoid
17751775
_Py_Specialize_LoadGlobal(
17761776
PyObject*globals,PyObject*builtins,
17771777
_Py_CODEUNIT*instr,PyObject*name)
@@ -1891,7 +1891,7 @@ store_subscr_fail_kind(PyObject *container, PyObject *sub)
18911891
}
18921892
#endif
18931893

1894-
void
1894+
Py_NO_INLINEvoid
18951895
_Py_Specialize_StoreSubscr(_PyStackRefcontainer_st,_PyStackRefsub_st,_Py_CODEUNIT*instr)
18961896
{
18971897
PyObject*container=PyStackRef_AsPyObjectBorrow(container_st);
@@ -2171,7 +2171,7 @@ specialize_c_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs)
21712171
}
21722172
}
21732173

2174-
void
2174+
Py_NO_INLINEvoid
21752175
_Py_Specialize_Call(_PyStackRefcallable_st,_Py_CODEUNIT*instr,intnargs)
21762176
{
21772177
PyObject*callable=PyStackRef_AsPyObjectBorrow(callable_st);
@@ -2211,7 +2211,7 @@ _Py_Specialize_Call(_PyStackRef callable_st, _Py_CODEUNIT *instr, int nargs)
22112211
}
22122212
}
22132213

2214-
void
2214+
Py_NO_INLINEvoid
22152215
_Py_Specialize_CallKw(_PyStackRefcallable_st,_Py_CODEUNIT*instr,intnargs)
22162216
{
22172217
PyObject*callable=PyStackRef_AsPyObjectBorrow(callable_st);
@@ -2566,7 +2566,7 @@ binary_op_extended_specialization(PyObject *lhs, PyObject *rhs, int oparg,
25662566
return0;
25672567
}
25682568

2569-
void
2569+
Py_NO_INLINEvoid
25702570
_Py_Specialize_BinaryOp(_PyStackReflhs_st,_PyStackRefrhs_st,_Py_CODEUNIT*instr,
25712571
intoparg,_PyStackRef*locals)
25722572
{
@@ -2724,7 +2724,7 @@ compare_op_fail_kind(PyObject *lhs, PyObject *rhs)
27242724
}
27252725
#endif// Py_STATS
27262726

2727-
void
2727+
Py_NO_INLINEvoid
27282728
_Py_Specialize_CompareOp(_PyStackReflhs_st,_PyStackRefrhs_st,_Py_CODEUNIT*instr,
27292729
intoparg)
27302730
{
@@ -2787,7 +2787,7 @@ unpack_sequence_fail_kind(PyObject *seq)
27872787
}
27882788
#endif// Py_STATS
27892789

2790-
void
2790+
Py_NO_INLINEvoid
27912791
_Py_Specialize_UnpackSequence(_PyStackRefseq_st,_Py_CODEUNIT*instr,intoparg)
27922792
{
27932793
PyObject*seq=PyStackRef_AsPyObjectBorrow(seq_st);
@@ -2894,7 +2894,7 @@ int
28942894
}
28952895
#endif// Py_STATS
28962896

2897-
void
2897+
Py_NO_INLINEvoid
28982898
_Py_Specialize_ForIter(_PyStackRefiter,_Py_CODEUNIT*instr,intoparg)
28992899
{
29002900
assert(ENABLE_SPECIALIZATION_FT);
@@ -2949,7 +2949,7 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
29492949
unspecialize(instr);
29502950
}
29512951

2952-
void
2952+
Py_NO_INLINEvoid
29532953
_Py_Specialize_Send(_PyStackRefreceiver_st,_Py_CODEUNIT*instr)
29542954
{
29552955
PyObject*receiver=PyStackRef_AsPyObjectBorrow(receiver_st);
@@ -3019,7 +3019,7 @@ check_type_always_true(PyTypeObject *ty)
30193019
return0;
30203020
}
30213021

3022-
void
3022+
Py_NO_INLINEvoid
30233023
_Py_Specialize_ToBool(_PyStackRefvalue_o,_Py_CODEUNIT*instr)
30243024
{
30253025
assert(ENABLE_SPECIALIZATION_FT);
@@ -3093,7 +3093,7 @@ containsop_fail_kind(PyObject *value) {
30933093
}
30943094
#endif
30953095

3096-
void
3096+
Py_NO_INLINEvoid
30973097
_Py_Specialize_ContainsOp(_PyStackRefvalue_st,_Py_CODEUNIT*instr)
30983098
{
30993099
PyObject*value=PyStackRef_AsPyObjectBorrow(value_st);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp