Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Jan 6, 2024
2 parents 651ce89 + ace010b commit 8fc3e56
Show file tree
Hide file tree
Showing 15 changed files with 267 additions and 370 deletions.
86 changes: 0 additions & 86 deletions src/hotspot/cpu/x86/macroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1871,92 +1871,6 @@ void MacroAssembler::cmpoop(Register src1, jobject src2, Register rscratch) {
}
#endif

void MacroAssembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
if ((UseAVX > 0) && (dst != src)) {
xorpd(dst, dst);
}
Assembler::cvtss2sd(dst, src);
}

void MacroAssembler::cvtss2sd(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtss2sd(dst, src);
}

void MacroAssembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
if ((UseAVX > 0) && (dst != src)) {
xorps(dst, dst);
}
Assembler::cvtsd2ss(dst, src);
}

void MacroAssembler::cvtsd2ss(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsd2ss(dst, src);
}

void MacroAssembler::cvtsi2sdl(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdl(dst, src);
}

void MacroAssembler::cvtsi2sdl(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdl(dst, src);
}

void MacroAssembler::cvtsi2ssl(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssl(dst, src);
}

void MacroAssembler::cvtsi2ssl(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssl(dst, src);
}

#ifdef _LP64
void MacroAssembler::cvtsi2sdq(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdq(dst, src);
}

void MacroAssembler::cvtsi2sdq(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorpd(dst, dst);
}
Assembler::cvtsi2sdq(dst, src);
}

void MacroAssembler::cvtsi2ssq(XMMRegister dst, Register src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssq(dst, src);
}

void MacroAssembler::cvtsi2ssq(XMMRegister dst, Address src) {
if (UseAVX > 0) {
xorps(dst, dst);
}
Assembler::cvtsi2ssq(dst, src);
}
#endif // _LP64

void MacroAssembler::locked_cmpxchgptr(Register reg, AddressLiteral adr, Register rscratch) {
assert(rscratch != noreg || always_reachable(adr), "missing");

Expand Down
17 changes: 0 additions & 17 deletions src/hotspot/cpu/x86/macroAssembler_x86.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,23 +800,6 @@ class MacroAssembler: public Assembler {

void cmpxchgptr(Register reg, Address adr);


// cvt instructions
void cvtss2sd(XMMRegister dst, XMMRegister src);
void cvtss2sd(XMMRegister dst, Address src);
void cvtsd2ss(XMMRegister dst, XMMRegister src);
void cvtsd2ss(XMMRegister dst, Address src);
void cvtsi2sdl(XMMRegister dst, Register src);
void cvtsi2sdl(XMMRegister dst, Address src);
void cvtsi2ssl(XMMRegister dst, Register src);
void cvtsi2ssl(XMMRegister dst, Address src);
#ifdef _LP64
void cvtsi2sdq(XMMRegister dst, Register src);
void cvtsi2sdq(XMMRegister dst, Address src);
void cvtsi2ssq(XMMRegister dst, Register src);
void cvtsi2ssq(XMMRegister dst, Address src);
#endif

void locked_cmpxchgptr(Register reg, AddressLiteral adr, Register rscratch = noreg);

void imulptr(Register dst, Register src) { LP64_ONLY(imulq(dst, src)) NOT_LP64(imull(dst, src)); }
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/x86_64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -10095,7 +10095,7 @@ instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{
instruct convF2D_reg_reg(regD dst, regF src)
%{
match(Set dst (ConvF2D src));
effect(TEMP dst);

format %{ "cvtss2sd $dst, $src" %}
ins_encode %{
__ cvtss2sd ($dst$$XMMRegister, $src$$XMMRegister);
Expand All @@ -10117,7 +10117,7 @@ instruct convF2D_reg_mem(regD dst, memory src)
instruct convD2F_reg_reg(regF dst, regD src)
%{
match(Set dst (ConvD2F src));
effect(TEMP dst);

format %{ "cvtsd2ss $dst, $src" %}
ins_encode %{
__ cvtsd2ss ($dst$$XMMRegister, $src$$XMMRegister);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void ShenandoahBarrierSet::arraycopy_work(T* src, size_t count) {
if (EVAC && obj == fwd) {
fwd = _heap->evacuate_object(obj, thread);
}
assert(obj != fwd || _heap->cancelled_gc(), "must be forwarded");
shenandoah_assert_forwarded_except(elem_ptr, obj, _heap->cancelled_gc());
ShenandoahHeap::atomic_update_oop(fwd, elem_ptr, o);
obj = fwd;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ShenandoahUpdateRefsForOopClosure: public BasicOopIterateClosure {
if (EVAC && obj == fwd) {
fwd = _heap->evacuate_object(obj, _thread);
}
assert(obj != fwd || _heap->cancelled_gc(), "must be forwarded");
shenandoah_assert_forwarded_except(p, obj, _heap->cancelled_gc());
ShenandoahHeap::atomic_update_oop(fwd, p, o);
obj = fwd;
}
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,8 @@ void ShenandoahEvacUpdateCleanupOopStorageRootsClosure::do_oop(oop* p) {
if (resolved == obj) {
resolved = _heap->evacuate_object(obj, _thread);
}
shenandoah_assert_not_in_cset_except(p, resolved, _heap->cancelled_gc());
ShenandoahHeap::atomic_update_oop(resolved, p, obj);
assert(_heap->cancelled_gc() ||
_mark_context->is_marked(resolved) && !_heap->in_collection_set(resolved),
"Sanity");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,14 @@ byte[] getFlattenedSpeculations(boolean validate) {
return result;
}

/**
* @return {@code true} if the given speculation can be performed, i.e., it never failed so far, otherwise
* return {@code false}. Note, that this method returns consistent results for any given speculation for the
* entire lifetime of the enclosing SpeculationLog object. This means that speculations failed during a
* compilation will not be updated.
*/
@Override
public boolean maySpeculate(SpeculationReason reason) {
if (failedSpeculations == null) {
collectFailedSpeculations();
}
if (failedSpeculations != null && failedSpeculations.length != 0) {
byte[] encoding = encode(reason);
return !contains(failedSpeculations, 0, encoding);
Expand Down
39 changes: 37 additions & 2 deletions src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -40,6 +40,7 @@
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
Expand Down Expand Up @@ -457,6 +458,7 @@ private Result begin(List<String> options, Iterable<? extends JavaFileObject> fi
if (haveErrors && result.isOK()) {
result = ERROR;
}
log.flush();
log.printErrorWarningCounts();
log.flush();
}
Expand Down Expand Up @@ -657,11 +659,44 @@ int consumeDocletOption(int idx, List<String> args, boolean isToolOption) throws
// check if arg is accepted by the tool before emitting error
if (!isToolOption) {
text = log.getText("main.invalid_flag", arg);
throw new OptionException(ERROR, this::showUsage, text);
throw new OptionException(ERROR, () -> reportBadOption(arg), text);
}
return m * idx;
}

private void reportBadOption(String name) {
var allOptionNames = Stream.concat(
getToolOptions().getSupportedOptions().stream()
.flatMap(o -> o.getNames().stream()),
docletOptions.stream()
.flatMap(o -> o.getNames().stream()));
record Pair(String word, double similarity) { }
final double MIN_SIMILARITY = 0.7;
var suggestions = allOptionNames
.map(t -> new Pair(t, similarity(t, name)))
.sorted(Comparator.comparingDouble(Pair::similarity).reversed() /* more similar first */)
// .peek(p -> System.out.printf("%.3f, (%s ~ %s)%n", p.similarity, p.word, name)) // debug
.takeWhile(p -> Double.compare(p.similarity, MIN_SIMILARITY) >= 0)
.map(Pair::word)
.toList();
switch (suggestions.size()) {
case 0 -> { }
case 1 -> showLinesUsingKey("main.did-you-mean", suggestions.getFirst());
default -> showLinesUsingKey("main.did-you-mean-one-of", String.join(" ", suggestions));
}
showLinesUsingKey("main.for-more-details-see-usage");
}

// a value in [0, 1] range: the closer the value is to 1, the more similar
// the strings are
private static double similarity(String a, String b) {
// Normalize the distance so that similarity between "x" and "y" is
// less than that of "ax" and "ay". Use the greater of two lengths
// as normalizer, as it's an upper bound for the distance.
return 1.0 - ((double) StringUtils.DamerauLevenshteinDistance.of(a, b))
/ Math.max(a.length(), b.length());
}

private static Set<? extends Option> getSupportedOptionsOf(Doclet doclet) {
Set<? extends Option> options = doclet.getSupportedOptions();
return options == null ? Set.of() : options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -34,6 +34,15 @@ main.usage=Usage:\n\
\ javadoc [options] [packagenames] [sourcefiles] [@files]\n\
where options include:

main.did-you-mean=\
Did you mean: {0}

main.did-you-mean-one-of=\
Did you mean one of: {0}

main.for-more-details-see-usage=\
For more details on available options, use --help or --help-extra

main.opt.at.arg=\
<file>
main.opt.at.desc=\
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -103,7 +103,7 @@ public VirtualMachine attach(Map<String,? extends Connector.Argument> args)
Properties props = vm.getAgentProperties();
address = props.getProperty("sun.jdwp.listenerAddress");
} catch (Exception x) {
throw new IOException(x.getMessage());
throw new IOException(x);
} finally {
if (vm != null) vm.detach();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -226,7 +226,7 @@ public synchronized VirtualMachine createVirtualMachine(
vm = new VirtualMachineImpl(this, connection, process,
++vmSequenceNumber);
} catch (VMDisconnectedException e) {
throw new IOException(e.getMessage());
throw new IOException(e);
}
targets.add(vm);
return vm;
Expand Down
2 changes: 2 additions & 0 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all
gc/stress/gclocker/TestGCLockerWithSerial.java 8180622 generic-all
gc/stress/gclocker/TestGCLockerWithShenandoah.java 8180622 generic-all
gc/stress/TestStressG1Humongous.java 8286554 windows-x64
gc/g1/TestSkipRebuildRemsetPhase.java 8323066 linux-aarch64

#############################################################################

Expand All @@ -112,6 +113,7 @@ runtime/StackGuardPages/TestStackGuardPagesNative.java 8303612 linux-all
runtime/ErrorHandling/TestDwarf.java#checkDecoder 8305489 linux-all
runtime/ErrorHandling/MachCodeFramesInErrorFile.java 8313315 linux-ppc64le
runtime/cds/appcds/customLoader/HelloCustom_JFR.java 8241075 linux-all,windows-x64
runtime/cds/appcds/jigsaw/modulepath/OptimizeModuleHandlingTest.java 8323032 generic-all

applications/jcstress/copy.java 8229852 linux-all

Expand Down
Loading

0 comments on commit 8fc3e56

Please sign in to comment.