GH-116422: Tier2 hot/cold splitting (GH-116813)

Splits the "cold" path, deopts and exits, from the "hot" path, reducing the size of most jitted instructions, at the cost of slower exits.
This commit is contained in:
Mark Shannon 2024-03-26 09:35:11 +00:00 committed by GitHub
parent 61599a48f5
commit bf82f77957
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1662 additions and 1003 deletions

View file

@ -769,14 +769,7 @@
break;
}
case _LOAD_NAME: {
_Py_UopsSymbol *v;
v = sym_new_not_null(ctx);
if (v == NULL) goto out_of_space;
stack_pointer[0] = v;
stack_pointer += 1;
break;
}
/* _LOAD_NAME is not a viable micro-op for tier 2 */
case _LOAD_GLOBAL: {
_Py_UopsSymbol *res;
@ -900,14 +893,7 @@
break;
}
case _BUILD_SET: {
_Py_UopsSymbol *set;
set = sym_new_not_null(ctx);
if (set == NULL) goto out_of_space;
stack_pointer[-oparg] = set;
stack_pointer += 1 - oparg;
break;
}
/* _BUILD_SET is not a viable micro-op for tier 2 */
case _BUILD_MAP: {
_Py_UopsSymbol *map;
@ -1408,31 +1394,9 @@
/* _FOR_ITER_GEN is not a viable micro-op for tier 2 */
case _BEFORE_ASYNC_WITH: {
_Py_UopsSymbol *exit;
_Py_UopsSymbol *res;
exit = sym_new_not_null(ctx);
if (exit == NULL) goto out_of_space;
res = sym_new_not_null(ctx);
if (res == NULL) goto out_of_space;
stack_pointer[-1] = exit;
stack_pointer[0] = res;
stack_pointer += 1;
break;
}
/* _BEFORE_ASYNC_WITH is not a viable micro-op for tier 2 */
case _BEFORE_WITH: {
_Py_UopsSymbol *exit;
_Py_UopsSymbol *res;
exit = sym_new_not_null(ctx);
if (exit == NULL) goto out_of_space;
res = sym_new_not_null(ctx);
if (res == NULL) goto out_of_space;
stack_pointer[-1] = exit;
stack_pointer[0] = res;
stack_pointer += 1;
break;
}
/* _BEFORE_WITH is not a viable micro-op for tier 2 */
case _WITH_EXCEPT_START: {
_Py_UopsSymbol *res;
@ -2029,3 +1993,16 @@
break;
}
case _DEOPT: {
break;
}
case _SIDE_EXIT: {
break;
}
case _ERROR_POP_N: {
stack_pointer += -oparg;
break;
}