This commit is contained in:
Rob McKenna 2020-11-10 13:59:19 +00:00
commit 95b9ae62af
26 changed files with 362 additions and 83 deletions

View File

@ -659,6 +659,10 @@ e3f940bd3c8fcdf4ca704c6eb1ac745d155859d5 jdk-15-ga
72cddf95705e758aea928e025694e445af844d1f jdk-15.0.1+4
ac7b0cbc8dac94ff225021d2786efbad2326b037 jdk-15.0.1+5
a90f4378bf70eb17e8a8322aa0b94a4c6c923932 jdk-15.0.1+6
23fd169be90a803fef99776afefa3072189980be jdk-15.0.1+7
8dd4d8eaf0de32a79d1f48c3421e5666d75beff9 jdk-15.0.1+8
d9b7c07593100c3cae95238999f972ceb0ff067c jdk-15.0.1+9
d9b7c07593100c3cae95238999f972ceb0ff067c jdk-15.0.1-ga
1613004c47e9dc867a2c2c43d716533b1aaedc5f jdk-15.0.2+0
cc4fdb537bc14734064a9a8eadb091fd1c12b36e jdk-15.0.2+1
d24e907486b3f90691980b0dde01efca5840abc6 jdk-15.0.2+2

View File

@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
tzdata2020b
tzdata2020d

View File

@ -3244,13 +3244,40 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# From Sharef Mustafa (2019-10-18):
# Palestine summer time will end on midnight Oct 26th 2019 ...
# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948
#
# From Steffen Thorsen (2020-10-20):
# Some sources such as these say, and display on clocks, that DST ended at
# midnight last year...
# https://www.amad.ps/ar/post/320006
#
# From Tim Parenti (2020-10-20):
# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms
# a decision on (translated): "The start of the winter time in Palestine, by
# delaying the clock by sixty minutes, starting from midnight on Friday /
# Saturday corresponding to 26/10/2019."
# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948
# From Sharef Mustafa (2020-10-20):
# As per the palestinian cabinet announcement yesterday , the day light saving
# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes.
# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584
# From Tim Parenti (2020-10-20):
# Predict future fall transitions at 01:00 on the Saturday preceding October's
# last Sunday (i.e., Sat>=24). This is consistent with our predictions since
# 2016, although the time of the change differed slightly in 2019.
# From Pierre Cashon (2020-10-20):
# The summer time this year started on March 28 at 00:00.
# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ
# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284
# The winter time in 2015 started on October 23 at 01:00.
# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY
# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583
#
# From Paul Eggert (2019-04-10):
# For now, guess spring-ahead transitions are March's last Friday at 00:00.
#
# From Tim Parenti (2016-10-19):
# Predict fall transitions on October's last Saturday at 01:00 from now on.
# For now, guess spring-ahead transitions are at 00:00 on the Saturday
# preceding March's last Sunday (i.e., Sat>=24).
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
@ -3266,10 +3293,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 -
Rule Palestine 2005 only - Oct 4 2:00 0 -
Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S
Rule Palestine 2006 only - Sep 22 0:00 0 -
Rule Palestine 2007 only - Sep Thu>=8 2:00 0 -
Rule Palestine 2007 only - Sep 13 2:00 0 -
Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S
Rule Palestine 2008 only - Sep 1 0:00 0 -
Rule Palestine 2009 only - Sep Fri>=1 1:00 0 -
Rule Palestine 2009 only - Sep 4 1:00 0 -
Rule Palestine 2010 only - Mar 26 0:00 1:00 S
Rule Palestine 2010 only - Aug 11 0:00 0 -
Rule Palestine 2011 only - Apr 1 0:01 1:00 S
@ -3278,12 +3305,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S
Rule Palestine 2011 only - Sep 30 0:00 0 -
Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S
Rule Palestine 2012 only - Sep 21 1:00 0 -
Rule Palestine 2013 only - Sep Fri>=21 0:00 0 -
Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 -
Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S
Rule Palestine 2013 only - Sep 27 0:00 0 -
Rule Palestine 2014 only - Oct 24 0:00 0 -
Rule Palestine 2015 only - Mar 28 0:00 1:00 S
Rule Palestine 2015 only - Oct 23 1:00 0 -
Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S
Rule Palestine 2016 max - Oct lastSat 1:00 0 -
Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S
Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 -
Rule Palestine 2019 only - Mar 29 0:00 1:00 S
Rule Palestine 2019 only - Oct Sat>=24 0:00 0 -
Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S
Rule Palestine 2020 max - Oct Sat>=24 1:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Asia/Gaza 2:17:52 - LMT 1900 Oct

View File

@ -404,6 +404,19 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# From Michael Deckers (2019-08-06):
# https://www.laws.gov.fj/LawsAsMade/downloadfile/848
# From Raymond Kumar (2020-10-08):
# [DST in Fiji] is from December 20th 2020, till 17th January 2021.
# From Alan Mintz (2020-10-08):
# https://www.laws.gov.fj/LawsAsMade/GetFile/1071
# From Tim Parenti (2020-10-08):
# https://www.fijivillage.com/news/Daylight-saving-from-Dec-20th-this-year-to-Jan-17th-2021-8rf4x5/
# "Minister for Employment, Parveen Bala says they had never thought of
# stopping daylight saving. He says it was just to decide on when it should
# start and end. Bala says it is a short period..."
# Since the end date is still in line with our ongoing predictions, assume for
# now that the later-than-usual start date is a one-time departure from the
# recent second Sunday in November pattern.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 -
Rule Fiji 1999 2000 - Feb lastSun 3:00 0 -
@ -415,7 +428,9 @@ Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 2018 - Nov Sun>=1 2:00 1:00 -
Rule Fiji 2015 max - Jan Sun>=12 3:00 0 -
Rule Fiji 2019 max - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2019 only - Nov Sun>=8 2:00 1:00 -
Rule Fiji 2020 only - Dec 20 2:00 1:00 -
Rule Fiji 2021 max - Nov Sun>=8 2:00 1:00 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji +12/+13

View File

@ -1052,17 +1052,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850
# Denmark, Faroe Islands, and Greenland
# From Jesper Nørgaard Welen (2005-04-26):
# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
# [introducing standard time] was in effect from 1894-01-01....
# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL
# the law [introducing standard time] was in effect from 1894-01-01....
# The page https://www.retsinformation.dk/eli/lta/1893/83
# confirms this, and states that the law was put forth 1893-03-29.
#
# The EU [actually, EEC and Euratom] treaty with effect from 1973:
# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL
# https://www.retsinformation.dk/eli/lta/1972/21100
#
# This provoked a new law from 1974 to make possible summer time changes
# in subsequent decrees with the law
# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL
# https://www.retsinformation.dk/eli/lta/1974/223
#
# It seems however that no decree was set forward until 1980. I have
# not found any decree, but in another related law, the effecting DST
@ -1074,7 +1073,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850
# The law is about the management of the extra hour, concerning
# working hours reported and effect on obligatory-rest rules (which
# was suspended on that night):
# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL
# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267
# From Jesper Nørgaard Welen (2005-06-11):
# The Herning Folkeblad (1980-09-26) reported that the night between
@ -1612,6 +1611,8 @@ Rule Hungary 1946 only - Oct 7 2:00 0 -
# https://library.hungaricana.hu/hu/view/Zala_1948_09/?pg=64
# https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=53
# https://library.hungaricana.hu/hu/view/SatoraljaujhelyiLeveltar_ZempleniNepujsag_1948/?pg=160
# https://library.hungaricana.hu/hu/view/UjSzo_1949_01-04/?pg=102
# https://library.hungaricana.hu/hu/view/KeletMagyarorszag_1949_03/?pg=96
# https://library.hungaricana.hu/hu/view/Delmagyarorszag_1949_09/?pg=94
Rule Hungary 1947 1949 - Apr Sun>=4 2:00s 1:00 S
Rule Hungary 1947 1949 - Oct Sun>=1 2:00s 0 -
@ -1627,9 +1628,10 @@ Rule Hungary 1955 only - Oct 2 3:00 0 -
# https://library.hungaricana.hu/hu/view/PestMegyeiHirlap_1957_09/?pg=143
Rule Hungary 1956 1957 - Jun Sun>=1 2:00 1:00 S
Rule Hungary 1956 1957 - Sep lastSun 3:00 0 -
# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227
# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=189
Rule Hungary 1980 only - Apr 6 0:00 1:00 S
Rule Hungary 1980 only - Sep 28 1:00 0 -
# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1980/?pg=1227
# https://library.hungaricana.hu/hu/view/Delmagyarorszag_1981_01/?pg=79
# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1982/?pg=115
# https://library.hungaricana.hu/hu/view/DTT_KOZL_TanacsokKozlonye_1983/?pg=85
@ -1640,6 +1642,7 @@ Rule Hungary 1981 1983 - Sep lastSun 1:00 0 -
Zone Europe/Budapest 1:16:20 - LMT 1890 Nov 1
1:00 C-Eur CE%sT 1918
# https://library.hungaricana.hu/hu/view/OGYK_RT_1941/?pg=1204
# https://library.hungaricana.hu/hu/view/OGYK_RT_1942/?pg=3955
1:00 Hungary CE%sT 1941 Apr 7 23:00
1:00 C-Eur CE%sT 1945
1:00 Hungary CE%sT 1984

View File

@ -282,7 +282,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_native(MacroAssembler
__ ldrb(rscratch2, gc_state);
// Check for heap in evacuation phase
__ tbz(rscratch2, ShenandoahHeap::EVACUATION_BITPOS, done);
__ tbz(rscratch2, ShenandoahHeap::HAS_FORWARDED_BITPOS, done);
__ mov(rscratch2, dst);
__ push_call_clobbered_registers();

View File

@ -1759,7 +1759,7 @@ void C2_MacroAssembler::string_indexof_char(Register str1, Register cnt1, Regist
pmovmskb(tmp, vec3);
}
bsfl(ch, tmp);
addl(result, ch);
addptr(result, ch);
bind(FOUND_SEQ_CHAR);
subptr(result, str1);

View File

@ -366,7 +366,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_native(MacroAssembler
assert_different_registers(dst, thread);
Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
__ testb(gc_state, ShenandoahHeap::EVACUATION);
__ testb(gc_state, ShenandoahHeap::HAS_FORWARDED);
#ifndef _LP64
__ pop(thread);
#endif

View File

@ -2920,6 +2920,16 @@ operand immI2()
interface(CONST_INTER);
%}
operand immU7()
%{
predicate((0 <= n->get_int()) && (n->get_int() <= 0x7F));
match(ConI);
op_cost(5);
format %{ %}
interface(CONST_INTER);
%}
operand immI8()
%{
predicate((-0x80 <= n->get_int()) && (n->get_int() < 0x80));
@ -11964,7 +11974,7 @@ instruct compB_mem_imm(rFlagsReg cr, memory mem, immI8 imm)
ins_pipe(ialu_cr_reg_mem);
%}
instruct testUB_mem_imm(rFlagsReg cr, memory mem, immU8 imm, immI0 zero)
instruct testUB_mem_imm(rFlagsReg cr, memory mem, immU7 imm, immI0 zero)
%{
match(Set cr (CmpI (AndI (LoadUB mem) imm) zero));

View File

@ -99,7 +99,9 @@ intptr_t narrow(BasicType type, intptr_t result) {
case T_DOUBLE:
case T_VOID:
return result;
default : ShouldNotReachHere();
default:
ShouldNotReachHere();
return result; // silence compiler warnings
}
}
@ -555,6 +557,9 @@ int CppInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
break;
}
if (entry->is_volatile()) {
if (support_IRIW_for_not_multiple_copy_atomic_cpu) {
OrderAccess::fence();
}
switch (entry->flag_state()) {
case ctos:
SET_LOCALS_INT(object->char_field_acquire(entry->f2_as_index()), 0);

View File

@ -436,6 +436,7 @@ extern "C" {
long long unsigned int oldval,
long long unsigned int newval) {
ShouldNotCallThis();
return 0; // silence compiler warnings
}
};
#endif // !_LP64

View File

@ -480,7 +480,7 @@ extern "C" {
long long unsigned int oldval,
long long unsigned int newval) {
ShouldNotCallThis();
return 0; // silence compiler compiler warnings
return 0; // silence compiler warnings
}
};
#endif // !_LP64

View File

@ -1324,7 +1324,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
assert(val->bottom_type()->make_oopptr(), "need oop");
assert(val->bottom_type()->make_oopptr()->const_oop() == NULL, "expect non-constant");
enum { _heap_stable = 1, _not_cset, _evac_path, PATH_LIMIT };
enum { _heap_stable = 1, _evac_path, _not_cset, PATH_LIMIT };
Node* region = new RegionNode(PATH_LIMIT);
Node* val_phi = new PhiNode(region, val->bottom_type()->is_oopptr());
Node* raw_mem_phi = PhiNode::make(region, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM);
@ -1338,14 +1338,21 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
val_phi->init_req(_heap_stable, val);
raw_mem_phi->init_req(_heap_stable, raw_mem);
// Test for in-cset.
// Test for in-cset, unless it's a native-LRB. Native LRBs need to return NULL
// even for non-cset objects to prevent ressurrection of such objects.
// Wires !in_cset(obj) to slot 2 of region and phis
Node* not_cset_ctrl = NULL;
test_in_cset(ctrl, not_cset_ctrl, val, raw_mem, phase);
if (!lrb->is_native()) {
test_in_cset(ctrl, not_cset_ctrl, val, raw_mem, phase);
}
if (not_cset_ctrl != NULL) {
region->init_req(_not_cset, not_cset_ctrl);
val_phi->init_req(_not_cset, val);
raw_mem_phi->init_req(_not_cset, raw_mem);
} else {
region->del_req(_not_cset);
val_phi->del_req(_not_cset);
raw_mem_phi->del_req(_not_cset);
}
// Resolve object when orig-value is in cset.

View File

@ -819,8 +819,10 @@ bool RegionNode::optimize_trichotomy(PhaseIterGVN* igvn) {
} else if (cmp1->Opcode() == Op_CmpF || cmp1->Opcode() == Op_CmpD ||
cmp2->Opcode() == Op_CmpF || cmp2->Opcode() == Op_CmpD ||
cmp1->Opcode() == Op_CmpP || cmp1->Opcode() == Op_CmpN ||
cmp2->Opcode() == Op_CmpP || cmp2->Opcode() == Op_CmpN) {
cmp2->Opcode() == Op_CmpP || cmp2->Opcode() == Op_CmpN ||
cmp1->is_SubTypeCheck() || cmp2->is_SubTypeCheck()) {
// Floats and pointers don't exactly obey trichotomy. To be on the safe side, don't transform their tests.
// SubTypeCheck is not commutative
return false;
} else if (cmp1 != cmp2) {
if (cmp1->in(1) == cmp2->in(2) &&

View File

@ -158,41 +158,37 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics {
* setSubSystemPath based on the contents of /proc/self/cgroup
*/
private static void setSubSystemControllerPath(CgroupV1Subsystem subsystem, String[] entry) {
String controllerName;
String base;
CgroupV1SubsystemController controller = null;
CgroupV1SubsystemController controller2 = null;
String controllerName = entry[1];
String base = entry[2];
controllerName = entry[1];
base = entry[2];
if (controllerName != null && base != null) {
switch (controllerName) {
case "memory":
controller = subsystem.memoryController();
break;
case "cpuset":
controller = subsystem.cpuSetController();
break;
case "cpu,cpuacct":
case "cpuacct,cpu":
controller = subsystem.cpuController();
controller2 = subsystem.cpuAcctController();
break;
case "cpuacct":
controller = subsystem.cpuAcctController();
break;
case "cpu":
controller = subsystem.cpuController();
break;
case "blkio":
controller = subsystem.blkIOController();
break;
// Ignore subsystems that we don't support
default:
break;
for (String cName: controllerName.split(",")) {
switch (cName) {
case "memory":
setPath(subsystem, subsystem.memoryController(), base);
break;
case "cpuset":
setPath(subsystem, subsystem.cpuSetController(), base);
break;
case "cpu":
setPath(subsystem, subsystem.cpuController(), base);
break;
case "cpuacct":
setPath(subsystem, subsystem.cpuAcctController(), base);
break;
case "blkio":
setPath(subsystem, subsystem.blkIOController(), base);
break;
// Ignore subsystems that we don't support
default:
break;
}
}
}
}
private static void setPath(CgroupV1Subsystem subsystem, CgroupV1SubsystemController controller, String base) {
if (controller != null) {
controller.setPath(base);
if (controller instanceof CgroupV1MemorySubSystemController) {
@ -202,9 +198,6 @@ public class CgroupV1Subsystem implements CgroupSubsystem, CgroupV1Metrics {
}
subsystem.setActiveSubSystems();
}
if (controller2 != null) {
controller2.setPath(base);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, 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
@ -265,8 +265,7 @@ class MemoryCache<K,V> extends Cache<K,V> {
else
this.queue = null;
int buckets = (int)(maxSize / LOAD_FACTOR) + 1;
cacheMap = new LinkedHashMap<>(buckets, LOAD_FACTOR, true);
cacheMap = new LinkedHashMap<>(1, LOAD_FACTOR, true);
}
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, 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
@ -573,8 +573,12 @@ public final class ZoneInfoFile {
// we can then pass in the dom = -1, dow > 0 into ZoneInfo
//
// hacking, assume the >=24 is the result of ZRB optimization for
// "last", it works for now.
if (dom < 0 || dom >= 24) {
// "last", it works for now. From tzdata2020d this hacking
// will not work for Asia/Gaza and Asia/Hebron which follow
// Palestine DST rules.
if (dom < 0 || dom >= 24 &&
!(zoneId.equals("Asia/Gaza") ||
zoneId.equals("Asia/Hebron"))) {
params[1] = -1;
params[2] = toCalendarDOW[dow];
} else {
@ -596,7 +600,9 @@ public final class ZoneInfoFile {
params[7] = 0;
} else {
// hacking: see comment above
if (dom < 0 || dom >= 24) {
if (dom < 0 || dom >= 24 &&
!(zoneId.equals("Asia/Gaza") ||
zoneId.equals("Asia/Hebron"))) {
params[6] = -1;
params[7] = toCalendarDOW[dow];
} else {

View File

@ -79,7 +79,7 @@ public class LIRCompilerBackend {
public static <T extends CompilationResult> void emitBackEnd(StructuredGraph graph, Object stub, ResolvedJavaMethod installedCodeOwner, Backend backend, T compilationResult,
CompilationResultBuilderFactory factory, RegisterConfig registerConfig, LIRSuites lirSuites) {
DebugContext debug = graph.getDebug();
try (DebugContext.Scope s = debug.scope("BackEnd", graph.getLastSchedule()); DebugCloseable a = BackEnd.start(debug)) {
try (DebugContext.Scope s = debug.scope("BackEnd", graph, graph.getLastSchedule()); DebugCloseable a = BackEnd.start(debug)) {
LIRGenerationResult lirGen = null;
lirGen = emitLIR(backend, graph, stub, registerConfig, lirSuites);
try (DebugContext.Scope s2 = debug.scope("CodeGen", lirGen, lirGen.getLIR())) {

View File

@ -28,14 +28,15 @@ import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import org.graalvm.compiler.api.directives.GraalDirectives;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.replacements.arraycopy.ArrayCopySnippets;
import org.graalvm.compiler.nodes.DirectCallTargetNode;
import org.graalvm.compiler.nodes.Invoke;
import org.graalvm.compiler.nodes.LoweredCallTargetNode;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.replacements.arraycopy.ArrayCopySnippets;
import org.junit.Assert;
import org.junit.Test;
@ -370,4 +371,22 @@ public class ArrayCopyIntrinsificationTest extends GraalCompilerTest {
test("objectArraycopyCatchArrayStoreException", longSource, 4, integerDest, 2, 3);
test("objectArraycopyCatchArrayIndexException", new Integer[128], 0, new Integer[128], Integer.MAX_VALUE, 1);
}
@Test
public void testArraycopyDeoptWithSideEffect() {
ArgSupplier s = () -> new int[4];
int[] b = new int[]{1, 1, 1, 1};
int[] c = new int[]{2, 2, 2, 2};
test("arraycopyAndDeopt", s, b, c);
}
public static int[] arraycopyAndDeopt(int[] a, int[] b, int[] c) {
if (a[0] == 0) {
System.arraycopy(b, 0, a, 0, b.length);
GraalDirectives.deoptimize();
} else {
System.arraycopy(c, 0, a, 0, b.length);
}
return a;
}
}

View File

@ -47,6 +47,7 @@ import org.graalvm.compiler.debug.DebugContext.Description;
import org.graalvm.compiler.debug.DebugDumpScope;
import org.graalvm.compiler.debug.DebugHandlersFactory;
import org.graalvm.compiler.debug.TimerKey;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.options.OptionKey;
import org.graalvm.compiler.options.OptionValues;
import org.graalvm.compiler.printer.GraalDebugHandlersFactory;
@ -165,15 +166,17 @@ public class CompilationTask {
final CompilationPrinter printer = CompilationPrinter.begin(debug.getOptions(), compilationId, method, entryBCI);
StructuredGraph graph;
try (DebugContext.Scope s = debug.scope("Compiling", new DebugDumpScope(getIdString(), true))) {
result = compiler.compile(method, entryBCI, useProfilingInfo, shouldRetainLocalVariables, compilationId, debug);
graph = compiler.createGraph(method, entryBCI, useProfilingInfo, compilationId, debug.getOptions(), debug);
result = compiler.compile(graph, method, entryBCI, useProfilingInfo, shouldRetainLocalVariables, compilationId, debug);
} catch (Throwable e) {
throw debug.handle(e);
}
if (result != null) {
try (DebugCloseable b = CodeInstallationTime.start(debug)) {
installMethod(debug, result);
installMethod(debug, graph, result);
}
// Installation is included in compilation time and memory usage reported by printer
printer.finish(result);
@ -352,12 +355,12 @@ public class CompilationTask {
}
@SuppressWarnings("try")
private void installMethod(DebugContext debug, final CompilationResult compResult) {
private void installMethod(DebugContext debug, StructuredGraph graph, final CompilationResult compResult) {
final CodeCacheProvider codeCache = jvmciRuntime.getHostJVMCIBackend().getCodeCache();
HotSpotBackend backend = compiler.getGraalRuntime().getHostBackend();
installedCode = null;
Object[] context = {new DebugDumpScope(getIdString(), true), codeCache, getMethod(), compResult};
try (DebugContext.Scope s = debug.scope("CodeInstall", context)) {
try (DebugContext.Scope s = debug.scope("CodeInstall", context, graph)) {
HotSpotCompilationRequest request = getRequest();
installedCode = (HotSpotInstalledCode) backend.createInstalledCode(debug,
request.getMethod(),

View File

@ -235,13 +235,13 @@ public class HotSpotGraalCompiler implements GraalJVMCICompiler, Cancellable {
return result;
}
public CompilationResult compile(ResolvedJavaMethod method,
public CompilationResult compile(StructuredGraph graph,
ResolvedJavaMethod method,
int entryBCI,
boolean useProfilingInfo,
boolean shouldRetainLocalVariables,
CompilationIdentifier compilationId,
DebugContext debug) {
StructuredGraph graph = createGraph(method, entryBCI, useProfilingInfo, compilationId, debug.getOptions(), debug);
CompilationResult result = new CompilationResult(compilationId);
return compileHelper(CompilationResultBuilderFactory.Default, result, graph, method, entryBCI, useProfilingInfo, shouldRetainLocalVariables, debug.getOptions());
}

View File

@ -216,13 +216,20 @@ public class SnippetFrameStateAssignment {
afterCount++;
}
}
NodeStateAssignment selected = null;
if (invalidCount > 0) {
stateMapping.put(loop, NodeStateAssignment.INVALID);
selected = NodeStateAssignment.INVALID;
} else {
if (afterCount > 0) {
stateMapping.put(loop, NodeStateAssignment.AFTER_BCI);
selected = NodeStateAssignment.AFTER_BCI;
} else {
stateMapping.put(loop, NodeStateAssignment.BEFORE_BCI);
selected = NodeStateAssignment.BEFORE_BCI;
}
}
stateMapping.put(loop, selected);
if (selected != initialState) {
for (LoopExitNode exit : loop.loopExits()) {
loopInfo.exitStates.put(exit, selected);
}
}
return loopInfo.exitStates;

View File

@ -51,6 +51,7 @@ import org.graalvm.compiler.nodes.calc.AddNode;
import org.graalvm.compiler.nodes.calc.IntegerConvertNode;
import org.graalvm.compiler.nodes.calc.LeftShiftNode;
import org.graalvm.compiler.nodes.extended.ForeignCallNode;
import org.graalvm.compiler.nodes.memory.AbstractMemoryCheckpoint;
import org.graalvm.compiler.nodes.memory.MemoryAccess;
import org.graalvm.compiler.nodes.memory.MemoryKill;
import org.graalvm.compiler.nodes.memory.SingleMemoryKill;
@ -67,7 +68,7 @@ import jdk.vm.ci.meta.MetaAccessProvider;
import jdk.vm.ci.meta.PrimitiveConstant;
@NodeInfo(allowedUsageTypes = {Memory}, cycles = CYCLES_UNKNOWN, size = SIZE_UNKNOWN)
public final class ArrayCopyCallNode extends FixedWithNextNode implements Lowerable, SingleMemoryKill, MemoryAccess, Canonicalizable {
public final class ArrayCopyCallNode extends AbstractMemoryCheckpoint implements Lowerable, SingleMemoryKill, MemoryAccess, Canonicalizable {
public static final NodeClass<ArrayCopyCallNode> TYPE = NodeClass.create(ArrayCopyCallNode.class);
@Input protected ValueNode src;
@ -214,6 +215,11 @@ public final class ArrayCopyCallNode extends FixedWithNextNode implements Lowera
return killedLocationIdentity;
}
@Override
public boolean hasSideEffect() {
return !killedLocationIdentity.isInit();
}
@NodeIntrinsic(hasSideEffect = true)
private static native void arraycopy(Object src, int srcPos, Object dest, int destPos, int length, @ConstantNodeParameter JavaKind elementKind, @ConstantNodeParameter boolean aligned,
@ConstantNodeParameter boolean disjoint, @ConstantNodeParameter boolean uninitialized, @ConstantNodeParameter int heapWordSize);

View File

@ -0,0 +1,89 @@
/*
* Copyright (c) 2020, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8253191
*
* @library /test/lib
* @modules java.base/jdk.internal.vm.annotation
*
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation compiler.c2.TestUnsignedByteCompare1
*/
package compiler.c2;
import java.lang.invoke.*;
import jdk.internal.vm.annotation.DontInline;
import jdk.test.lib.Asserts;
public class TestUnsignedByteCompare1 {
@DontInline static boolean testByteGT0(byte[] val) { return (val[0] & mask()) > 0; }
@DontInline static boolean testByteGE0(byte[] val) { return (val[0] & mask()) >= 0; }
@DontInline static boolean testByteEQ0(byte[] val) { return (val[0] & mask()) == 0; }
@DontInline static boolean testByteNE0(byte[] val) { return (val[0] & mask()) != 0; }
@DontInline static boolean testByteLE0(byte[] val) { return (val[0] & mask()) <= 0; }
@DontInline static boolean testByteLT0(byte[] val) { return (val[0] & mask()) < 0; }
static void testValue(byte b) {
byte[] bs = new byte[] { b };
Asserts.assertEquals(((b & mask()) > 0), testByteGT0(bs), errorMessage(b, "GT0"));
Asserts.assertEquals(((b & mask()) >= 0), testByteGE0(bs), errorMessage(b, "GE0"));
Asserts.assertEquals(((b & mask()) == 0), testByteEQ0(bs), errorMessage(b, "EQ0"));
Asserts.assertEquals(((b & mask()) != 0), testByteNE0(bs), errorMessage(b, "NE0"));
Asserts.assertEquals(((b & mask()) <= 0), testByteLE0(bs), errorMessage(b, "LE0"));
Asserts.assertEquals(((b & mask()) < 0), testByteLT0(bs), errorMessage(b, "LT0"));
}
public static void main(String[] args) {
for (int mask = 0; mask <= 0xFF; mask++) {
setMask(mask);
for (int i = 0; i < 20_000; i++) {
testValue((byte) i);
}
}
System.out.println("TEST PASSED");
}
static String errorMessage(byte b, String type) {
return String.format("%s: val=0x%x mask=0x%x", type, b, mask());
}
// Mutable mask as a compile-time constant.
private static final CallSite MASK_CS = new MutableCallSite(MethodType.methodType(int.class));
private static final MethodHandle MASK_MH = MASK_CS.dynamicInvoker();
static int mask() {
try {
return (int) MASK_MH.invokeExact();
} catch (Throwable t) {
throw new InternalError(t); // should NOT happen
}
}
static void setMask(int mask) {
MethodHandle constant = MethodHandles.constant(int.class, mask);
MASK_CS.setTarget(constant);
}
}

View File

@ -0,0 +1,68 @@
/*
* Copyright (c) 2020, Red Hat, Inc. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8253566
* @summary clazz.isAssignableFrom will return false for interface implementors
* @requires vm.compiler2.enabled
*
* @run main/othervm -XX:-BackgroundCompilation TestSubTypeCheckMacroTrichotomy
*
*/
public class TestSubTypeCheckMacroTrichotomy {
public static void main(String[] args) {
for (int i = 0; i < 20_000; i++) {
final int res1 = test(A.class, B.class);
final int res2 = test(B.class, A.class);
final int res3 = test(A.class, C.class);
if (res1 != 0 || res2 != 1 || res3 != 0) {
throw new RuntimeException("test(A, B) = " + res1 + " test(B, A) = " + res2 + " test(A, C) = " + res3);
}
}
}
private static int test(Class<?> c1, Class<?> c2) {
if (c1 == null) {
}
if (c2 == null) {
}
int res = 0;
if (!c1.isAssignableFrom(c2)) {
if (c2.isAssignableFrom(c1)) {
res = 1;
}
}
return res;
}
private static class A {
}
private static class B extends A {
}
private static class C {
}
}

View File

@ -1687,6 +1687,17 @@ public class BasicDateTime extends Basic {
// Get the supported ids for GMT-08:00 (Pacific Standard Time)
String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
// With tzdata2020b, the test fails for the mentioned zones expecting
// "PST" but JDK has Zone name "MST" for JRE locale provider.
// Therefore excluding them as the test is only looking for a GMT-08:00
// time zone ID. See JDK-8254865.
final List<String> list = new ArrayList<String>();
Collections.addAll(list, ids);
list.remove("America/Dawson");
list.remove("America/WhiteHorse");
list.remove("Canada/Yukon");
ids = list.toArray(new String[list.size()]);
// Create a Pacific Standard Time time zone
SimpleTimeZone tz = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
// public GregorianCalendar(TimeZone zone, Locale aLocale);