Skip to content

Commit 82a1db4

Browse files
committed
[GR-76436] Remove manual bytecode interpreter
PullRequest: graalpython/4636
2 parents 6217c2d + 090ea54 commit 82a1db4

254 files changed

Lines changed: 762 additions & 25609 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci.jsonnet

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
(import "ci/python-gate.libsonnet") +
66
(import "ci/python-bench.libsonnet") +
77
{
8-
overlay: "30def35dbfc43256d57ad3b9b981d92718728e2a",
8+
overlay: "26571215e27b3c415afb8119d38a0418c14b29c9",
99
specVersion: "8",
1010
// Until buildbot issues around CI tiers are resolved, we cannot use them
1111
// tierConfig: self.tierConfig,
@@ -134,18 +134,6 @@
134134
tags :: name,
135135
}),
136136

137-
// Manual interpreter variants (DSL disabled)
138-
local manual_interpreter_env = task_spec({
139-
environment +: {
140-
BYTECODE_DSL_INTERPRETER: "false"
141-
},
142-
}),
143-
local manual_interpreter_gate(name) = manual_interpreter_env + task_spec({
144-
tags :: name,
145-
}),
146-
local manual_interpreter_bench = manual_interpreter_env + task_spec({
147-
name_suffix +:: ["manual-interpreter"],
148-
}),
149137
local with_compiler = task_spec({
150138
dynamic_imports +:: ["/compiler"],
151139
}),
@@ -178,11 +166,6 @@
178166
"python-unittest-native-debug-build": gpgate + platform_spec(no_jobs) + native_debug_build_gate("python-unittest") + platform_spec({
179167
"linux:amd64:jdk-latest" : tier3,
180168
}),
181-
"python-unittest-manual-interpreter": gpgate + platform_spec(no_jobs) + manual_interpreter_gate("python-unittest") + platform_spec({
182-
"linux:amd64:jdk-latest" : daily + t("01:00:00"),
183-
"linux:aarch64:jdk-latest" : daily + t("01:00:00"),
184-
"darwin:aarch64:jdk-latest" : daily + t("01:00:00"),
185-
}),
186169
"python-unittest-multi-context": gpgate + require(GPY_NATIVE_STANDALONE) + platform_spec(no_jobs) + platform_spec({
187170
"linux:amd64:jdk-latest" : tier3,
188171
"linux:aarch64:jdk-latest" : daily + t("02:00:00"),
@@ -218,9 +201,6 @@
218201
"darwin:aarch64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST) + with_compiler,
219202
"windows:amd64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST) + with_compiler,
220203
}),
221-
"python-junit-manual-interpreter": gpgate + platform_spec(no_jobs) + manual_interpreter_gate("python-junit") + platform_spec({
222-
"linux:amd64:jdk-latest" : tier3 + require(GRAAL_JDK_LATEST) + with_compiler,
223-
}),
224204
"python-junit-maven": gpgate_maven + platform_spec(no_jobs) + platform_spec({
225205
"linux:amd64:jdk21" : daily + t("00:30:00"),
226206
"linux:aarch64:jdk21" : daily + t("01:00:00"),
@@ -259,9 +239,6 @@
259239
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
260240
"windows:amd64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE) + batches(2),
261241
}),
262-
"python-svm-unittest-manual-interpreter": gpgate + platform_spec(no_jobs) + manual_interpreter_gate("python-svm-unittest") + platform_spec({
263-
"linux:amd64:jdk-latest" : tier2,
264-
}),
265242
"python-tagged-unittest": gpgate + require(GPY_NATIVE_STANDALONE) + batches(TAGGED_UNITTESTS_SPLIT) + platform_spec(no_jobs) + platform_spec({
266243
"linux:amd64:jdk-latest" : tier2,
267244
"linux:aarch64:jdk-latest" : tier3,

graalpython/com.oracle.graal.python.annotations/src/com/oracle/graal/python/annotations/GenerateEnumConstants.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

graalpython/com.oracle.graal.python.benchmarks/python/harness.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ def run_benchmark(args):
526526
print("### no extra module search paths specified")
527527

528528
if GRAALPYTHON:
529-
print(f"### using bytecode DSL interpreter: {__graalpython__.is_bytecode_dsl_interpreter}")
530529
print(f"### using forced uncached interpreter: {getattr(__graalpython__, 'is_forced_uncached_interpreter', False)}")
531530

532531
BenchRunner(bench_file, bench_args=bench_args, iterations=iterations, warmup=warmup, warmup_runs=warmup_runs, startup=startup, live_results=live_results, self_measurement=self_measurement).run()

graalpython/com.oracle.graal.python.benchmarks/python/heap/import-a-lot.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -59,13 +59,6 @@
5959
import tomllib
6060
import argparse
6161
import subprocess
62-
import sys
63-
64-
# We log the bytecode DSL flag only in this benchamark, because we do not want to influence
65-
# the other benchmarks by importing the sys module. Other benchmarks will print a warning
66-
# that bytecode DSL flag could not be verified
67-
if getattr(getattr(sys, "implementation", None), "name", None) == "graalpy":
68-
print(f"### using bytecode DSL interpreter: {__graalpython__.is_bytecode_dsl_interpreter}")
6962

7063
# Sleep a bit to shake out weakref callbacks and get more measurement samples
7164
for i in range(30):

graalpython/com.oracle.graal.python.benchmarks/python/micro/virtualize-in-try-catch-oom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2024, 2026, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -47,7 +47,7 @@
4747
# Note2: we want to catch OutOfMemoryError and translate it to Python MemoryError,
4848
# so that we can attach a precise location to it if possible, but we accept that
4949
# under some circumstances the compiler may move the allocation out of the try-catch
50-
# and we will catch it elsewhere (probably the catch-all in PBytecodeRootNode) and
50+
# and we will catch it elsewhere (probably the bytecode root catch-all) and
5151
# attach imprecise location to it. Alternative is to force the allocation using
5252
# CompilerDirectives.ensureAllocatedHere, which would, however, prevent any virtualization,
5353
# which is deemed a price to high to pay for a precise location of MemoryError.

graalpython/com.oracle.graal.python.frozen/freeze_modules.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import ntpath
1212
import os
1313
import posixpath
14-
import shutil
1514
import sys
1615
from collections import namedtuple
1716
from io import StringIO
@@ -646,13 +645,8 @@ def main():
646645
STDLIB_DIR = os.path.abspath(parsed_args.python_lib)
647646
FROZEN_MODULES_DIR = os.path.abspath(parsed_args.binary_dir)
648647

649-
if __graalpython__.is_bytecode_dsl_interpreter:
650-
suffix = "bin_dsl"
651-
assert os.path.isdir(parsed_args.binary_dir), "Frozen modules for the DSL should be built after the manual bytecode interpreter."
652-
else:
653-
suffix = "bin"
654-
shutil.rmtree(parsed_args.binary_dir, ignore_errors=True)
655-
os.makedirs(parsed_args.binary_dir)
648+
suffix = "bin_dsl"
649+
os.makedirs(parsed_args.binary_dir, exist_ok=True)
656650

657651
# create module specs
658652
modules = list(parse_frozen_specs(suffix))
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
com.oracle.graal.python.processor.ArgumentClinicProcessor
2-
com.oracle.graal.python.processor.GenerateEnumConstantsProcessor
32
com.oracle.graal.python.processor.GenerateNativeDowncallsProcessor
43
com.oracle.graal.python.processor.CApiBuiltinsProcessor
54
com.oracle.graal.python.processor.SlotsProcessor

graalpython/com.oracle.graal.python.processor/src/com/oracle/graal/python/processor/GenerateEnumConstantsProcessor.java

Lines changed: 0 additions & 145 deletions
This file was deleted.

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,6 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
499499
}
500500
}
501501

502-
if (!ImageInfo.inImageCode() && Boolean.getBoolean("python.EnableBytecodeDSLInterpreter")) {
503-
// forward the property on JVM
504-
addRelaunchArg("--vm.Dpython.EnableBytecodeDSLInterpreter=true");
505-
}
506-
507502
// According to CPython if no arguments are given, they contain an empty string.
508503
if (programArgs.isEmpty()) {
509504
programArgs.add("");

graalpython/com.oracle.graal.python.test.integration/src/com/oracle/graal/python/test/integration/runtime/ProfileTests.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -40,14 +40,10 @@
4040
*/
4141
package com.oracle.graal.python.test.integration.runtime;
4242

43-
import static com.oracle.graal.python.test.integration.PythonTests.eval;
44-
4543
import java.io.ByteArrayOutputStream;
4644
import java.io.PrintStream;
4745

48-
import org.graalvm.polyglot.Value;
4946
import org.junit.Assert;
50-
import org.junit.Assume;
5147
import org.junit.Test;
5248

5349
import com.oracle.graal.python.test.integration.PythonTests;
@@ -71,9 +67,6 @@ public void profileYield() {
7167

7268
@Test
7369
public void profileException() {
74-
Value isBytecodeDLS = eval("__graalpython__.is_bytecode_dsl_interpreter");
75-
// GR-71916
76-
Assume.assumeFalse("TODO: wrong stacktrace", isBytecodeDLS.asBoolean());
7770
String source = "import sys\n" +
7871
"def f(frame, event, arg): print(frame, event, arg)\n" +
7972
"sys.setprofile(f)\n" +

0 commit comments

Comments
 (0)