summaryrefslogtreecommitdiffstats
path: root/Tools/cases_generator
diff options
context:
space:
mode:
authorBrett Simmers <swtaarrs@users.noreply.github.com>2024-03-01 02:53:32 (GMT)
committerGitHub <noreply@github.com>2024-03-01 02:53:32 (GMT)
commit339c8e1c13adc299a0e2e49c93067e7817692380 (patch)
tree4d2c0708d04ea383b533115e83ec4f49fbf826e7 /Tools/cases_generator
parent2e94a6687c1a9750e9d2408a8dff0a422aeaf0e4 (diff)
downloadcpython-339c8e1c13adc299a0e2e49c93067e7817692380.zip
cpython-339c8e1c13adc299a0e2e49c93067e7817692380.tar.gz
cpython-339c8e1c13adc299a0e2e49c93067e7817692380.tar.bz2
gh-115999: Disable the specializing adaptive interpreter in free-threaded builds (#116013)
For now, disable all specialization when the GIL might be disabled.
Diffstat (limited to 'Tools/cases_generator')
-rw-r--r--Tools/cases_generator/tier1_generator.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tools/cases_generator/tier1_generator.py b/Tools/cases_generator/tier1_generator.py
index aba36ec..fb2ab93 100644
--- a/Tools/cases_generator/tier1_generator.py
+++ b/Tools/cases_generator/tier1_generator.py
@@ -87,6 +87,8 @@ def write_uop(
out.emit(
f"{type}{cache.name} = {reader}(&this_instr[{offset}].cache);\n"
)
+ if inst.family is None:
+ out.emit(f"(void){cache.name};\n")
offset += cache.size
emit_tokens(out, uop, stack, inst)
if uop.properties.stores_sp:
@@ -131,8 +133,10 @@ def generate_tier1(
needs_this = uses_this(inst)
out.emit("\n")
out.emit(f"TARGET({name}) {{\n")
+ unused_guard = "(void)this_instr;\n" if inst.family is None else ""
if needs_this and not inst.is_target:
out.emit(f"_Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;\n")
+ out.emit(unused_guard)
else:
out.emit(f"frame->instr_ptr = next_instr;\n")
out.emit(f"next_instr += {inst.size};\n")
@@ -141,6 +145,7 @@ def generate_tier1(
out.emit(f"PREDICTED({name});\n")
if needs_this:
out.emit(f"_Py_CODEUNIT *this_instr = next_instr - {inst.size};\n")
+ out.emit(unused_guard)
if inst.family is not None:
out.emit(
f"static_assert({inst.family.size} == {inst.size-1}"