Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gluon-bot committed Oct 2, 2023
2 parents fbb0987 + cd3ccf2 commit e499223
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,16 @@ public static UpdateScope openUpdateScopeTrackingOriginalCallsites(InliningLog i
* preserving all inlining decisions. It is a responsibility of the caller to delete the
* replaced invoke.
*
* If the log is in a {@link #openDefaultUpdateScope default} update scope (i.e., updates to
* invokes are handled by the user), this call has no effect.
*
* @param inliningLog the inlining log or {@code null} if it disabled
* @param replacedInvoke the invoke that is getting replaced
*
* @return a bound {@link UpdateScope} or {@code null} if the log is disabled
*/
public static UpdateScope openUpdateScopeTrackingReplacement(InliningLog inliningLog, Invokable replacedInvoke) {
if (inliningLog == null) {
if (inliningLog == null || inliningLog.currentUpdateScope == inliningLog.noUpdates) {
return null;
}
return inliningLog.openUpdateScope((nullInvoke, replacementInvoke) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.graalvm.compiler.nodeinfo.NodeSize;
import org.graalvm.compiler.nodes.virtual.VirtualObjectNode;
import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.serviceprovider.IsolateUtil;
import org.graalvm.util.json.JSONFormatter;

import jdk.vm.ci.meta.JavaTypeProfile;
Expand Down Expand Up @@ -706,7 +707,7 @@ public void emit(Function<ResolvedJavaMethod, String> methodNameFormatter) {
}
PathUtilities.createDirectories(pathOptionValue);
@SuppressWarnings("deprecation")
String fileName = String.valueOf(Thread.currentThread().getId());
String fileName = IsolateUtil.getIsolateID() + "_" + Thread.currentThread().getId();
String filePath = PathUtilities.getPath(pathOptionValue, fileName);
try (OutputStream outputStream = PathUtilities.openOutputStream(filePath, true);
PrintStream printStream = new PrintStream(outputStream)) {
Expand Down
13 changes: 9 additions & 4 deletions vm/mx.vm/mx_vm_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, vm, bm_suite, args):
self.bmSuite = bm_suite
self.benchmark_suite_name = bm_suite.benchSuiteName(args) if len(inspect.getfullargspec(bm_suite.benchSuiteName).args) > 1 else bm_suite.benchSuiteName()
self.benchmark_name = bm_suite.benchmarkName()
self.executable, self.classpath_arguments, self.system_properties, self.image_vm_args, image_run_args, self.split_run = NativeImageVM.extract_benchmark_arguments(args)
self.executable, self.classpath_arguments, self.modulepath_arguments, self.system_properties, self.image_vm_args, image_run_args, self.split_run = NativeImageVM.extract_benchmark_arguments(args)
self.extra_image_build_arguments = bm_suite.extra_image_build_argument(self.benchmark_name, args)
# use list() to create fresh copies to safeguard against accidental modification
self.image_run_args = bm_suite.extra_run_arg(self.benchmark_name, args, list(image_run_args))
Expand Down Expand Up @@ -185,6 +185,7 @@ def __init__(self, vm, bm_suite, args):
self.bundle_create_path = self.get_bundle_create_path_if_present()
if not self.bundle_path:
self.base_image_build_args += self.classpath_arguments
self.base_image_build_args += self.modulepath_arguments
self.base_image_build_args += self.executable
self.base_image_build_args += svm_experimental_options(['-H:Path=' + self.output_dir])
self.base_image_build_args += svm_experimental_options([
Expand Down Expand Up @@ -459,7 +460,7 @@ def supported_vm_arg_prefixes():
_VM_OPTS_SPACE_SEPARATED_ARG = ['-mp', '-modulepath', '-limitmods', '-addmods', '-upgrademodulepath', '-m',
'--module-path', '--limit-modules', '--add-modules', '--upgrade-module-path',
'--module', '--module-source-path', '--add-exports', '--add-opens', '--add-reads',
'--patch-module', '--boot-class-path', '--source-path', '-cp', '-classpath']
'--patch-module', '--boot-class-path', '--source-path', '-cp', '-classpath', '-p']

@staticmethod
def _split_vm_arguments(args):
Expand Down Expand Up @@ -495,6 +496,7 @@ def extract_benchmark_arguments(args):
vm_args, executable, image_run_args = NativeImageVM._split_vm_arguments(clean_args)

classpath_arguments = []
modulepath_arguments = []
system_properties = [a for a in vm_args if a.startswith('-D')]
image_vm_args = []
i = 0
Expand All @@ -506,6 +508,9 @@ def extract_benchmark_arguments(args):
elif vm_arg.startswith('-cp') or vm_arg.startswith('-classpath'):
classpath_arguments += [vm_arg, vm_args[i + 1]]
i += 2
elif vm_arg.startswith('-p') or vm_arg.startswith('-modulepath'):
modulepath_arguments += [vm_arg, vm_args[i + 1]]
i += 2
else:
if not any(vm_arg.startswith(elem) for elem in NativeImageVM.supported_vm_arg_prefixes()):
mx.abort('Unsupported argument ' + vm_arg + '.' +
Expand All @@ -518,7 +523,7 @@ def extract_benchmark_arguments(args):
image_vm_args.append(vm_arg)
i += 1

return executable, classpath_arguments, system_properties, image_vm_args, image_run_args, split_run
return executable, classpath_arguments, modulepath_arguments, system_properties, image_vm_args, image_run_args, split_run

class Stages:
def __init__(self, config, bench_out, bench_err, is_gate, non_zero_is_fatal, cwd):
Expand Down Expand Up @@ -910,7 +915,7 @@ def run_stage_agent(self, config, stages):
if config.image_vm_args is not None:
hotspot_vm_args += config.image_vm_args

hotspot_args = hotspot_vm_args + config.classpath_arguments + config.system_properties + config.executable + config.extra_agent_run_args
hotspot_args = hotspot_vm_args + config.classpath_arguments + config.modulepath_arguments + config.system_properties + config.executable + config.extra_agent_run_args
with stages.set_command(self.generate_java_command(hotspot_args)) as s:
s.execute_command()

Expand Down
4 changes: 2 additions & 2 deletions vm/mx.vm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
{
"name": "truffleruby",
"version": "0e3726d57db46e5c17732d8437109b72b8144f1d",
"version": "d60d4eb934b60fb6b7510d41671079f8bca4a933",
"dynamic": True,
"urls": [
{"url": "https://github.com/oracle/truffleruby.git", "kind": "git"},
]
},
{
"name": "fastr",
"version": "6c7bc86f59cd71886cee0605baca911035a52bf8",
"version": "b1a05698d4c1531264726123aeac2ab894b633de",
"dynamic": True,
"urls": [
{"url": "https://github.com/oracle/fastr.git", "kind": "git"},
Expand Down

0 comments on commit e499223

Please sign in to comment.