Skip to content

Commit 26eaa5a

Browse files
committed
add new mx python -compile-truffle-immediately option, alias for:
-Dgraal.TruffleCompileImmediatly=true -Dgraal.TruffleCompilationExceptionsAreThrown=true
1 parent d3c5945 commit 26eaa5a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,21 @@
2121
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2222
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
2323
# OF THE POSSIBILITY OF SUCH DAMAGE.
24-
from argparse import ArgumentParser
2524
import os
2625
import platform
2726
import re
2827
import shutil
2928
import subprocess
3029
import sys
3130
import tempfile
31+
from argparse import ArgumentParser
3232

3333
import mx
3434
import mx_benchmark
3535
import mx_gate
3636
import mx_sdk
3737
import mx_subst
3838
import mx_urlrewrites
39-
from mx_downstream import testdownstream
4039
from mx_gate import Task
4140
from mx_graalpython_benchmark import PythonBenchmarkSuite
4241
from mx_unittest import unittest
@@ -57,10 +56,12 @@ def _get_stdlib_home():
5756
def _get_svm_binary():
5857
return os.path.join(_suite.dir, "graalpython-svm")
5958

59+
6060
def __get_svm_binary_from_graalvm():
6161
vmdir = os.path.join(mx.suite("truffle").dir, "..", "vm")
6262
return os.path.join(vmdir, "mxbuild", "-".join([mx.get_os(), mx.get_arch()]), "graalpython.image", "graalpython")
6363

64+
6465
def _extract_graalpython_internal_options(args):
6566
internal = []
6667
non_internal = []
@@ -148,6 +149,10 @@ def _extract_graalpython_internal_options(args):
148149
# internal += ['-Dgraal.MaximumLoopExplosionCount=1000']
149150
# internal += ['-Dgraal.TruffleCompilationThreshold=100000']
150151

152+
elif arg == '-compile-truffle-immediately' and _mx_graal:
153+
internal += ['-Dgraal.TruffleCompileImmediately=true']
154+
internal += ['-Dgraal.TruffleCompilationExceptionsAreThrown=true']
155+
151156
else:
152157
non_internal += [arg]
153158

@@ -857,6 +862,7 @@ def import_python_sources(args):
857862
_suite.vc.update(_suite.dir, rev=tip)
858863
_suite.vc.git_command(_suite.dir, ["merge", "python-import"])
859864

865+
860866
# ----------------------------------------------------------------------------------------------------------------------
861867
#
862868
# add the defined python benchmark suites

0 commit comments

Comments
 (0)