This commit is contained in:
Coleen Phillimore 2017-11-15 08:25:28 -05:00
commit 2f84103a78
268 changed files with 6864 additions and 2275 deletions
.hgtags
make
src/hotspot
cpu
os
os_cpu
share

@ -455,3 +455,4 @@ b87d7b5d5dedc1185e5929470f945b7378cdb3ad jdk-10+27
92f08900cb3c0d694e5c529a676c1c9e5909193f jdk-10+28
a6e591e12f122768f675428e1e5a838fd0e9c7ec jdk-10+29
8fee80b92e65149f7414250fd5e34b6f35d417b4 jdk-10+30
e6278add9ff28fab70fe1cc4c1d65f7363dc9445 jdk-10+31

@ -80,8 +80,8 @@ ifneq ($(MAN_DIR), )
endif
LEGAL_NOTICES := \
$(SUPPORT_OUTPUTDIR)/modules_legal/java.base \
$(call FindModuleLegalDirs, $(MODULE)) \
$(call uniq, $(SUPPORT_OUTPUTDIR)/modules_legal/java.base \
$(call FindModuleLegalDirs, $(MODULE))) \
#
LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES))

@ -409,8 +409,10 @@ LEGAL_SUBDIRS += share/legal
# $1 - Module to find legal dirs for
FindModuleLegalDirs = \
$(strip $(wildcard \
$(addsuffix /$(strip $1), $(IMPORT_MODULES_LEGAL)) \
$(foreach sub, $(LEGAL_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
$(addsuffix /$(strip $1), $(SUPPORT_OUTPUTDIR)/modules_legal \
$(IMPORT_MODULES_LEGAL)) \
$(foreach sub, $(LEGAL_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS))) \
))
################################################################################

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

@ -49,7 +49,7 @@
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@ -241,7 +241,7 @@ Rule Egypt 2006 only - Sep 21 24:00 0 -
# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
# From Jesper Nørgaard Welen (2007-08-15): [The following agree:]
# http://www.nentjes.info/Bill/bill5.htm
# http://www.timeanddate.com/worldclock/city.html?n=53
# https://www.timeanddate.com/worldclock/city.html?n=53
# From Steffen Thorsen (2007-09-04): The official information...:
# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
@ -279,8 +279,8 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# timeanddate[2] and another site I've found[3] also support that.
#
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=492263
# [2] http://www.timeanddate.com/worldclock/clockchange.html?n=53
# [3] http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# [2] https://www.timeanddate.com/worldclock/clockchange.html?n=53
# [3] https://wwp.greenwichmeantime.com/time-zone/africa/egypt/
# From Arthur David Olson (2009-04-20):
# In 2009 (and for the next several years), Ramadan ends before the fourth
@ -290,10 +290,10 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# From Steffen Thorsen (2009-08-11):
# We have been able to confirm the August change with the Egyptian Cabinet
# Information and Decision Support Center:
# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
# https://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
#
# The Middle East News Agency
# http://www.mena.org.eg/index.aspx
# https://www.mena.org.eg/index.aspx
# also reports "Egypt starts winter time on August 21"
# today in article numbered "71, 11/08/2009 12:25 GMT."
# Only the title above is available without a subscription to their service,
@ -343,7 +343,7 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 0 -
# Thursday of April.... Clocks will still be turned back for Ramadan, but
# dates not yet announced....
# http://almogaz.com/news/weird-news/2015/04/05/1947105 ...
# http://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
# https://www.timeanddate.com/news/time/egypt-starts-dst-2015.html
# From Ahmed Nazmy (2015-04-20):
# Egypt's ministers cabinet just announced ... that it will cancel DST at
@ -470,11 +470,11 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# From Even Scharning (2012-11-10):
# Libya set their time one hour back at 02:00 on Saturday November 10.
# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
# https://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/
# Here is an official source [in Arabic]: http://ls.ly/fb6Yc
#
# Steffen Thorsen forwarded a translation (2012-11-10) in
# http://mm.icann.org/pipermail/tz/2012-November/018451.html
# https://mm.icann.org/pipermail/tz/2012-November/018451.html
#
# From Tim Parenti (2012-11-11):
# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1.
@ -485,7 +485,7 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882
# From Even Scharning (2013-10-25):
# The scheduled end of DST in Libya on Friday, October 25, 2013 was
# cancelled yesterday....
# http://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
# https://www.libyaherald.com/2013/10/24/correction-no-time-change-tomorrow/
#
# From Paul Eggert (2013-10-25):
# For now, assume they're reverting to the pre-2012 rules of permanent UT +02.
@ -538,7 +538,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
# basis....
# It seems that Mauritius observed daylight saving time from 1982-10-10 to
# 1983-03-20 as well, but that was not successful....
# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
# https://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
# From Alex Krivenyshev (2008-06-25):
# http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
@ -606,7 +606,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920
# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
#
# Our wrap-up:
# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
# https://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
# From Arthur David Olson (2009-07-11):
# The "mauritius-dst-will-not-repeat" wrapup includes this:
@ -638,7 +638,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# be one hour ahead of GMT between 1 June and 27 September, according to
# Communication Minister and Government Spokesman, Khalid Naciri...."
#
# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
# http://www.worldtimezone.com/dst_news/dst_news_morocco01.html
# http://en.afrik.com/news11892.html
# From Alex Krivenyshev (2008-05-09):
@ -651,7 +651,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# From Patrice Scattolin (2008-05-09):
# According to this article:
# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
# https://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
# (and republished here: <http://www.actu.ma/heure-dete-comment_i127896_0.html>)
# the changes occur at midnight:
#
@ -673,7 +673,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# posted in English).
#
# The following Google query will generate many relevant hits:
# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
# https://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
# From Steffen Thorsen (2008-08-27):
# Morocco will change the clocks back on the midnight between August 31
@ -684,7 +684,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
#
# We have some further details posted here:
# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
# https://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
# From Steffen Thorsen (2009-03-17):
# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
@ -694,7 +694,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# (French)
#
# Our summary:
# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
# https://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to official document from Royaume du Maroc Premier Ministre,
@ -717,7 +717,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
# (French)
# Our page:
# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
# https://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
# From Dan Abitol (2011-03-30):
# ...Rules for Africa/Casablanca are the following (24h format)
@ -734,7 +734,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# They said that the decision was already taken.
#
# More articles in the press
# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
# https://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-leve.html
# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
@ -826,7 +826,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# 1433 (18 April 2012) and the decision of the Head of Government of
# 16 N. 3-29-15 Chaaban 1435 (4 June 2015).
# Source (french):
# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
# https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/
#
# From Milamber (2015-06-09):
# http://www.mmsp.gov.ma/fr/actualites.aspx?id=863
@ -835,7 +835,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis
# [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go
# from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch....
# I think the patch is correct and the quoted text is wrong; the text in
# <http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
# <https://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/> agrees
# with the patch.
# From Paul Eggert (2015-06-08):
@ -960,9 +960,17 @@ Link Africa/Maputo Africa/Kigali # Rwanda
Link Africa/Maputo Africa/Lubumbashi # E Dem. Rep. of Congo
Link Africa/Maputo Africa/Lusaka # Zambia
# Namibia
# The 1994-04-03 transition is from Shanks & Pottenger.
# Shanks & Pottenger report no DST after 1998-04; go with IATA.
# From Arthur David Olson (2017-08-09):
# The text of the "Namibia Time Act, 1994" is available online at
# www.lac.org.na/laws/1994/811.pdf
# and includes this nugget:
# Notwithstanding the provisions of subsection (2) of section 1, the
# first winter period after the commencement of this Act shall
# commence at OOhOO on Monday 21 March 1994 and shall end at 02h00 on
# Sunday 4 September 1994.
# From Petronella Sibeene (2007-03-30):
# http://allafrica.com/stories/200703300178.html
@ -978,19 +986,30 @@ Link Africa/Maputo Africa/Lusaka # Zambia
# observes Botswana time, we have no details about historical practice.
# In the meantime people there can use Africa/Gaborone.
# See: Immanuel S. The Namibian. 2017-02-23.
# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
# https://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
# From Steffen Thorsen (2017-08-09):
# Namibia is going to change their time zone to what is now their DST:
# https://www.newera.com.na/2017/02/23/namibias-winter-time-might-be-repealed/
# This video is from the government decision:
# https://www.nbc.na/news/na-passes-namibia-time-bill-repealing-1994-namibia-time-act.8665
# We have made the assumption so far that they will change their time zone at
# the same time they would normally start DST, the first Sunday in September:
# https://www.timeanddate.com/news/time/namibia-new-time-zone.html
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Namibia 1994 max - Sep Sun>=1 2:00 1:00 S
Rule Namibia 1995 max - Apr Sun>=1 2:00 0 -
Rule Namibia 1994 only - Mar 21 0:00 0 -
Rule Namibia 1994 2016 - Sep Sun>=1 2:00 1:00 S
Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8
1:30 - +0130 1903 Mar
2:00 - SAST 1942 Sep 20 2:00
2:00 1:00 SAST 1943 Mar 21 2:00
2:00 - SAST 1990 Mar 21 # independence
2:00 - CAT 1994 Apr 3
1:00 Namibia WA%sT
2:00 - CAT 1994 Mar 21 0:00
1:00 Namibia WA%sT 2017 Sep 3 2:00
2:00 - CAT
# Niger
# See Africa/Lagos.
@ -1077,14 +1096,24 @@ Link Africa/Johannesburg Africa/Mbabane # Swaziland
# no information
# Sudan
#
# From <http://www.sunanews.net/sn13jane.html>
# Sudan News Agency (2000-01-13),
# also reported by Michaël De Beukelaer-Dossche via Steffen Thorsen:
# Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
# Saturday.... This was announced Thursday by Caretaker State Minister for
# Manpower Abdul-Rahman Nur-Eddin.
# From Ahmed Atyya, National Telecommunications Corp. (NTC), Sudan (2017-10-17):
# ... the Republic of Sudan is going to change the time zone from (GMT+3:00)
# to (GMT+ 2:00) starting from Wednesday 1 November 2017.
#
# From Paul Eggert (2017-10-18):
# A scanned copy (in Arabic) of Cabinet Resolution No. 352 for the
# year 2017 can be found as an attachment in email today from Yahia
# Abdalla of NTC, archived at:
# https://mm.icann.org/pipermail/tz/2017-October/025333.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Sudan 1970 only - May 1 0:00 1:00 S
Rule Sudan 1970 1985 - Oct 15 0:00 0 -
@ -1093,10 +1122,14 @@ Rule Sudan 1972 1985 - Apr lastSun 0:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Khartoum 2:10:08 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
3:00 - EAT
3:00 - EAT 2017 Nov 1
2:00 - CAT
# South Sudan
Link Africa/Khartoum Africa/Juba
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Juba 2:06:28 - LMT 1931
2:00 Sudan CA%sT 2000 Jan 15 12:00
3:00 - EAT
# Swaziland
# See Africa/Johannesburg.
@ -1134,11 +1167,11 @@ Link Africa/Khartoum Africa/Juba
# According to several news sources, Tunisia will not observe DST this year.
# (Arabic)
# http://www.elbashayer.com/?page=viewn&nid=42546
# http://www.babnet.net/kiwidetail-15295.asp
# https://www.babnet.net/kiwidetail-15295.asp
#
# We have also confirmed this with the US embassy in Tunisia.
# We have a wrap-up about this on the following page:
# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
# https://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
# From Alexander Krivenyshev (2009-03-17):
# Here is a link to Tunis Afrique Presse News Agency

@ -49,7 +49,7 @@
# Heard Island, McDonald Islands (uninhabited)
# previously sealers and scientific personnel wintered
# Margaret Turner reports
# http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
# https://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html
# (1999-09-30) that they're UT +05, with no DST;
# presumably this is when they have visitors.
#
@ -70,7 +70,7 @@
# http://www.aad.gov.au/default.asp?casid=37079
#
# We have more background information here:
# http://www.timeanddate.com/news/time/antarctica-new-times.html
# https://www.timeanddate.com/news/time/antarctica-new-times.html
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division: ...
@ -85,7 +85,7 @@
# - Mawson station stays on UTC+5.
#
# Background:
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
# https://www.timeanddate.com/news/time/antartica-time-changes-2010.html
# From Steffen Thorsen (2016-10-28):
# Australian Antarctica Division informed us that Casey changed time
@ -168,7 +168,7 @@ Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français
#
# year-round base in the main continent
# Dumont d'Urville, Île des Pétrels, -6640+14001, since 1956-11
# <http://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
# <https://en.wikipedia.org/wiki/Dumont_d'Urville_Station> (2005-12-05)
#
# Another base at Port-Martin, 50km east, began operation in 1947.
# It was destroyed by fire on 1952-01-14.

@ -49,7 +49,7 @@
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# For Russian data circa 1919, a source is:
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
@ -98,8 +98,8 @@ Rule E-EurAsia 1996 max - Oct lastSun 0:00 0 -
Rule RussiaAsia 1981 1984 - Apr 1 0:00 1:00 S
Rule RussiaAsia 1981 1983 - Oct 1 0:00 0 -
Rule RussiaAsia 1984 1995 - Sep lastSun 2:00s 0 -
Rule RussiaAsia 1985 2011 - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1996 2011 - Oct lastSun 2:00s 0 -
Rule RussiaAsia 1985 2010 - Mar lastSun 2:00s 1:00 S
Rule RussiaAsia 1996 2010 - Oct lastSun 2:00s 0 -
# Afghanistan
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -132,13 +132,17 @@ Zone Asia/Kabul 4:36:48 - LMT 1890
# or
# (brief)
# http://www.worldtimezone.com/dst_news/dst_news_armenia03.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 S
Rule Armenia 2011 only - Oct lastSun 2:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
3:00 - +03 1957 Mar
4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s
3:00 RussiaAsia +03/+04 1995 Sep 24 2:00s
4:00 - +04 1997
4:00 RussiaAsia +04/+05
4:00 RussiaAsia +04/+05 2011
4:00 Armenia +04/+05
# Azerbaijan
@ -150,7 +154,7 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2
# From Steffen Thorsen (2016-03-17):
# ... the Azerbaijani Cabinet of Ministers has cancelled switching to
# daylight saving time....
# http://www.azernews.az/azerbaijan/94137.html
# https://www.azernews.az/azerbaijan/94137.html
# http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html
# http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html
@ -191,11 +195,11 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2
# the 19th and 20th, and they have not set the end date yet.
#
# Some sources:
# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
# https://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
# http://bdnews24.com/details.php?id=85889&cid=2
#
# Our wrap-up:
# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
# https://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
# From A. N. M. Kamrus Saadat (2009-06-15):
# Finally we've got the official mail regarding DST start time where DST start
@ -281,9 +285,15 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
# From Paul Eggert (2017-04-20):
# Page 27 of Reed & Low (cited for Asia/Kolkata) says "Rangoon local time is
# used upon the railways and telegraphs of Burma, and is 6h. 24m. 47s. ahead
# of Greenwich." This refers to the period before Burma's transition to +0630,
# a transition for which Shanks is the only source.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Yangon 6:24:40 - LMT 1880 # or Rangoon
6:24:40 - RMT 1920 # Rangoon Mean Time?
Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon
6:24:47 - RMT 1920 # Rangoon local time
6:30 - +0630 1942 May
9:00 - +09 1945 May 3
6:30 - +0630
@ -340,7 +350,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
#
# From Jesper Nørgaard Welen (2006-07-14):
# I have investigated the timezones around 1970 on the
# http://www.astro.com/atlas site [with provinces and county
# https://www.astro.com/atlas site [with provinces and county
# boundaries summarized below].... A few other exceptions were two
# counties on the Sichuan side of the Xizang-Sichuan border,
# counties Dege and Baiyu which lies on the Sichuan side and are
@ -492,7 +502,7 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:00 D
# From David Cochrane (2014-03-26):
# Just a confirmation that Ürümqi time was implemented in Ürümqi on 1 Feb 1986:
# http://content.time.com/time/magazine/article/0,9171,960684,00.html
# https://content.time.com/time/magazine/article/0,9171,960684,00.html
# From Luther Ma (2014-04-22):
# I have interviewed numerous people of various nationalities and from
@ -649,7 +659,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
# (both in Okinawa) adopt the Western Standard Time which is based on
# 120E. The adoption began from Jan 1, 1896. The original text can be
# found on Wikisource:
# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
# ... This could be the first adoption of time zone in Taiwan, because
# during the Qing Dynasty, it seems that there was no time zone
# declared officially.
@ -662,7 +672,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
# territory, including later occupations, adopt Japan Central Time
# (UTC+9). The adoption began on Oct 1, 1937. The original text can
# be found on Wikisource:
# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
#
# That is, the time zone of Taipei switched to UTC+9 on Oct 1, 1937.
@ -798,6 +808,12 @@ Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1
# Looks like the time zone split in Cyprus went through last night.
# http://cyprus-mail.com/2016/10/30/cyprus-new-division-two-time-zones-now-reality/
# From Paul Eggert (2017-10-18):
# Northern Cyprus will reinstate winter time on October 29, thus
# staying in sync with the rest of Cyprus. See: Anastasiou A.
# Cyprus to remain united in time. Cyprus Mail 2017-10-17.
# https://cyprus-mail.com/2017/10/17/cyprus-remain-united-time/
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 -
@ -815,7 +831,8 @@ Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14
Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
2:00 Cyprus EE%sT 1998 Sep
2:00 EUAsia EE%sT 2016 Sep 8
3:00 - +03
3:00 - +03 2017 Oct 29 1:00u
2:00 EUAsia EE%sT
# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
# However, for various reasons many users expect to find it under Europe.
@ -875,7 +892,7 @@ Zone Asia/Tbilisi 2:59:11 - LMT 1880
# From João Carrascalão, brother of the former governor of East Timor, in
# East Timor may be late for its millennium
# <http://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
# <https://etan.org/et99c/december/26-31/30ETMAY.htm> (1999-12-26/31):
# Portugal tried to change the time forward in 1974 because the sun
# rises too early but the suggestion raised a lot of problems with the
# Timorese and I still don't think it would work today because it
@ -903,21 +920,62 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1
# India
# From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic
# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
# https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/
# (2015-12-22):
# In January 1906, several thousand cotton-mill workers rioted on the
# outskirts of Bombay.... They were protesting the proposed abolition of
# local time in favor of Indian Standard Time.... Journalists called this
# dispute the "Battle of the Clocks." It lasted nearly half a century.
# From Paul Eggert (2017-04-20):
# Good luck trying to nail down old timekeeping records in India.
# "... in the nineteenth century ... Madras Observatory took its magnetic
# measurements on Göttingen time, its meteorological measurements on Madras
# (local) time, dropped its time ball on Greenwich (ocean navigator's) time,
# and distributed civil (local time)." -- Bartky IR. Selling the true time:
# 19th-century timekeeping in america. Stanford U Press (2000), 247 note 19.
# "A more potent cause of resistance to the general adoption of the present
# standard time lies in the fact that it is Madras time. The citizen of
# Bombay, proud of being 'primus in Indis' and of Calcutta, equally proud of
# his city being the Capital of India, and - for a part of the year - the Seat
# of the Supreme Government, alike look down on Madras, and refuse to change
# the time they are using, for that of what they regard as a benighted
# Presidency; while Madras, having for long given the standard time to the
# rest of India, would resist the adoption of any other Indian standard in its
# place." -- Oldham RD. On Time in India: a suggestion for its improvement.
# Proceedings of the Asiatic Society of Bengal (April 1899), 49-55.
#
# "In 1870 ... Madras time - 'now used by the telegraph and regulated from the
# only government observatory' - was suggested as a standard railway time,
# first to be adopted on the Great Indian Peninsular Railway (GIPR)....
# Calcutta, Bombay, and Karachi, were to be allowed to continue with their
# local time for civil purposes." - Prasad R. Tracks of Change: Railways and
# Everyday Life in Colonial India. Cambridge University Press (2016), 145.
#
# Reed S, Low F. The Indian Year Book 1936-37. Bennett, Coleman, pp 27-8.
# https://archive.org/details/in.ernet.dli.2015.282212
# This lists +052110 as Madras local time used in railways, and says that on
# 1906-01-01 railways and telegraphs in India switched to +0530. Some
# municipalities retained their former time, and the time in Calcutta
# continued to depend on whether you were at the railway station or at
# government offices. Government time was at +055320 (according to Shanks) or
# at +0554 (according to the Indian Year Book). Railway time is more
# appropriate for our purposes, as it was better documented, it is what we do
# elsewhere (e.g., Europe/London before 1880), and after 1906 it was
# consistent in the region now identified by Asia/Kolkata. So, use railway
# time for 1870-1941. Shanks is our only (and dubious) source for the
# 1941-1945 data.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata
5:53:20 - HMT 1941 Oct # Howrah Mean Time?
6:30 - +0630 1942 May 15
Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata
5:53:20 - HMT 1870 # Howrah Mean Time?
5:21:10 - MMT 1906 Jan 1 # Madras local time
5:30 - IST 1941 Oct
5:30 1:00 +0630 1942 May 15
5:30 - IST 1942 Sep
5:30 1:00 +0630 1945 Oct 15
5:30 - IST
# The following are like Asia/Kolkata:
# Since 1970 the following are like Asia/Kolkata:
# Andaman Is
# Lakshadweep (Laccadive, Minicoy and Amindivi Is)
# Nicobar Is
@ -1059,7 +1117,7 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov
# From Reuters (2007-09-16), with a heads-up from Jesper Nørgaard Welen:
# ... the Guardian Council ... approved a law on Sunday to re-introduce
# daylight saving time ...
# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
# https://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
#
# From Roozbeh Pournader (2007-11-05):
# This is quoted from Official Gazette of the Islamic Republic of
@ -1158,7 +1216,7 @@ Zone Asia/Tehran 3:25:44 - LMT 1916
# http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
#
# We have published a short article in English about the change:
# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
# https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Iraq 1982 only - May 1 0:00 1:00 D
@ -1466,12 +1524,12 @@ Rule Japan 1950 1951 - May Sun>=1 2:00 1:00 D
# From Yu-Cheng Chuang (2013-07-12):
# ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause
# about standard time" ... The adoption began from Jan 1, 1896.
# http://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時)
#
# ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which
# means the whole Japan territory, including later occupations, adopt Japan
# Central Time (UTC+9). The adoption began on Oct 1, 1937.
# http://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
@ -1533,7 +1591,7 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u
# Official, in Arabic:
# http://www.petra.gov.jo/public_news/Nws_NewsDetails.aspx?Menu_ID=&Site_Id=2&lang=1&NewsID=133230&CatID=14
# ... Our background/permalink about it
# http://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
# https://www.timeanddate.com/news/time/jordan-reverses-dst-decision.html
# ...
# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?lang=2&site_id=1&NewsID=133313&Type=P
# ... says midnight for the coming one and 1:00 for the ones in the future
@ -1891,9 +1949,9 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2
# between 1987 and 1988 ...
# From Sanghyuk Jung (2014-10-29):
# http://mm.icann.org/pipermail/tz/2014-October/021830.html
# https://mm.icann.org/pipermail/tz/2014-October/021830.html
# According to the Korean Wikipedia
# http://ko.wikipedia.org/wiki/한국_표준시
# https://ko.wikipedia.org/wiki/한국_표준시
# [oldid=12896437 2014-09-04 08:03 UTC]
# DST in Republic of Korea was as follows.... And I checked old
# newspapers in Korean, all articles correspond with data in Wikipedia.
@ -2115,7 +2173,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Male
# +08:00 instead. Different sources appear to disagree with the tz
# database on this, e.g.:
#
# http://www.timeanddate.com/worldclock/city.html?n=1026
# https://www.timeanddate.com/worldclock/city.html?n=1026
# http://www.worldtimeserver.com/current_time_in_MN.aspx
#
# both say GMT+08:00.
@ -2245,7 +2303,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
# help reduce load shedding by approving the closure of commercial centres at
# 9pm and moving clocks forward by one hour for the next three months. ...."
#
# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
# http://www.worldtimezone.com/dst_news/dst_news_pakistan01.html
# http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
# From Arthur David Olson (2008-05-19):
@ -2311,7 +2369,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
#
# We have confirmed this year's end date with both with the Ministry of
# Water and Power and the Pakistan Electric Power Company:
# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
# https://www.timeanddate.com/news/time/pakistan-ends-dst09.html
# From Christoph Göhre (2009-10-01):
# [T]he German Consulate General in Karachi reported me today that Pakistan
@ -2493,7 +2551,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
#
# We are not sure if Gaza will do the same, last year they had a different
# end date, we will keep this page updated:
# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
# https://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
# From Alexander Krivenyshev (2009-09-02):
# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
@ -2531,7 +2589,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# the clocks were set back one hour at 2010-08-11 00:00:00 local time in
# Gaza and the West Bank.
# Some more background info:
# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
# https://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
# From Steffen Thorsen (2011-08-26):
# Gaza and the West Bank did go back to standard time in the beginning of
@ -2541,7 +2599,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
#
# http://www.maannews.net/eng/ViewDetails.aspx?ID=416217
# Additional info:
# http://www.timeanddate.com/news/time/palestine-dst-2011.html
# https://www.timeanddate.com/news/time/palestine-dst-2011.html
# From Alexander Krivenyshev (2011-08-27):
# According to the article in The Jerusalem Post:
@ -2551,7 +2609,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# The Hamas government said on Saturday that it won't observe summertime after
# the Muslim feast of Id al-Fitr, which begins on Tuesday..."
# ...
# http://www.jpost.com/MiddleEast/Article.aspx?id=235650
# https://www.jpost.com/MiddleEast/Article.aspx?id=235650
# http://www.worldtimezone.com/dst_news/dst_news_gazastrip05.html
# The rules for Egypt are stolen from the 'africa' file.
@ -2572,7 +2630,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# http://safa.ps/details/news/74352/%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-%D8%A8%D8%A7%D9%84%D8%B6%D9%81%D8%A9-%D9%88%D8%BA%D8%B2%D8%A9-%D9%84%D9%8A%D9%84%D8%A9-%D8%A7%D9%84%D8%AC%D9%85%D8%B9%D8%A9.html
#
# Our brief summary:
# http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
# https://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html
# From Steffen Thorsen (2013-03-26):
# The following news sources tells that Palestine will "start daylight saving
@ -2592,11 +2650,11 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
# From Steffen Thorsen (2015-03-03):
# Sources such as http://www.alquds.com/news/article/view/id/548257
# and http://www.raya.ps/ar/news/890705.html say Palestine areas will
# and https://www.raya.ps/ar/news/890705.html say Palestine areas will
# start DST on 2015-03-28 00:00 which is one day later than expected.
#
# From Paul Eggert (2015-03-03):
# http://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
# https://www.timeanddate.com/time/change/west-bank/ramallah?year=2014
# says that the fall 2014 transition was Oct 23 at 24:00.
# From Hannah Kreitem (2016-03-09):
@ -2620,8 +2678,8 @@ Zone Asia/Karachi 4:28:12 - LMT 1907
#
# From Paul Eggert (2016-10-19):
# It's also consistent with predictions in the following URLs today:
# http://www.timeanddate.com/time/change/gaza-strip/gaza
# http://www.timeanddate.com/time/change/west-bank/hebron
# https://www.timeanddate.com/time/change/gaza-strip/gaza
# https://www.timeanddate.com/time/change/west-bank/hebron
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EgyptAsia 1957 only - May 10 0:00 1:00 S
@ -2684,7 +2742,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
# Philippines, issued a proclamation announcing that 1844-12-30 was to
# be immediately followed by 1845-01-01; see R.H. van Gent's
# History of the International Date Line
# http://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
# https://www.staff.science.uu.nl/~gent0113/idl/idl_philippines.htm
# The rest of the data entries are from Shanks & Pottenger.
# From Jesper Nørgaard Welen (2006-04-26):
@ -2948,7 +3006,7 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# We have not found any sources saying anything about when DST ends this year.
#
# Our summary
# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
# https://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
# From Steffen Thorsen (2009-10-27):
# The Syrian Arab News Network on 2009-09-29 reported that Syria will
@ -2975,7 +3033,7 @@ Rule Syria 2007 only - Nov Fri>=1 0:00 0 -
# http://www.sana.sy/ara/2/2012/03/26/408215.htm
#
# Our brief summary:
# http://www.timeanddate.com/news/time/syria-dst-2012.html
# https://www.timeanddate.com/news/time/syria-dst-2012.html
# From Arthur David Olson (2012-03-27):
# Assume last Friday in March going forward XXX.
@ -3058,7 +3116,7 @@ Zone Asia/Tashkent 4:37:11 - LMT 1924 May 2
# is quoted verbatim in:
# http://www.thoigian.com.vn/?mPage=P80D01
# is translated by Brian Inglis in:
# http://mm.icann.org/pipermail/tz/2014-October/021654.html
# https://mm.icann.org/pipermail/tz/2014-October/021654.html
# and is the basis for the information below.
#
# The 1906 transition was effective July 1 and standardized Indochina to

@ -316,7 +316,7 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
#
# A bit more background info here:
# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
# https://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
# From Alexander Krivenyshev (2010-10-24):
# According to Radio Fiji and Fiji Times online, Fiji will end DST 3
@ -380,9 +380,12 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
# clocks go forward an hour at 2am to 3am.... Daylight Saving will
# end at 3.00am on Sunday 15th January 2017."
# From Paul Eggert (2016-10-03):
# For now, guess DST from 02:00 the first Sunday in November to
# 03:00 the third Sunday in January. Although ad hoc, it matches
# From Paul Eggert (2017-08-21):
# Dominic Fok writes (2017-08-20) that DST ends 2018-01-14, citing
# Extraordinary Government of Fiji Gazette Supplement No. 21 (2017-08-27),
# [Legal Notice No. 41] of an order of the previous day by J Usamate.
# For now, guess DST from 02:00 the first Sunday in November to 03:00
# the first Sunday on or after January 14. Although ad hoc, it matches
# transitions since late 2014 and seems more likely to match future
# practice than guessing no DST.
@ -396,7 +399,7 @@ Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 -
Rule Fiji 2014 only - Jan Sun>=18 2:00 0 -
Rule Fiji 2014 max - Nov Sun>=1 2:00 1:00 S
Rule Fiji 2015 max - Jan Sun>=15 3:00 0 -
Rule Fiji 2015 max - Jan Sun>=14 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji +12/+13
@ -580,7 +583,7 @@ Zone Pacific/Port_Moresby 9:48:40 - LMT 1880
# The World War II entries below are instead based on Arawa-Kieta.
# The Japanese occupied Kieta in July 1942,
# according to the Pacific War Online Encyclopedia
# http://pwencycl.kgbudge.com/B/o/Bougainville.htm
# https://pwencycl.kgbudge.com/B/o/Bougainville.htm
# and seem to have controlled it until their 1945-08-21 surrender.
#
# The Autonomous Region of Bougainville switched from UT +10 to +11
@ -602,7 +605,7 @@ Zone Pacific/Pitcairn -8:40:20 - LMT 1901 # Adamstown
-8:00 - -08
# American Samoa
Zone Pacific/Pago_Pago 12:37:12 - LMT 1879 Jul 5
Zone Pacific/Pago_Pago 12:37:12 - LMT 1892 Jul 5
-11:22:48 - LMT 1911
-11:00 - SST # S=Samoa
Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
@ -618,7 +621,7 @@ Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
# Sunday of April 2011."
#
# Background info:
# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
# https://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
#
# Samoa's Daylight Saving Time Act 2009 is available here, but does not
# contain any dates:
@ -682,7 +685,7 @@ Rule WS 2011 only - Sep lastSat 3:00 1 D
Rule WS 2012 max - Apr Sun>=1 4:00 0 S
Rule WS 2012 max - Sep lastSun 3:00 1 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
Zone Pacific/Apia 12:33:04 - LMT 1892 Jul 5
-11:26:56 - LMT 1911
-11:30 - -1130 1950
-11:00 WS -11/-10 2011 Dec 29 24:00
@ -709,7 +712,7 @@ Zone Pacific/Guadalcanal 10:39:48 - LMT 1912 Oct # Honiara
# From Paul Eggert (2012-07-25)
# A Google Books snippet of Appendix to the Journals of the House of
# Representatives of New Zealand, Session 1948,
# <http://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
# <https://books.google.com/books?id=ZaVCAQAAIAAJ>, page 65, says Tokelau
# was "11 hours slow on G.M.T." Go with Thorsen and assume Shanks & Pottenger
# are off by an hour starting in 1901.
@ -724,8 +727,8 @@ Rule Tonga 1999 only - Oct 7 2:00s 1:00 S
Rule Tonga 2000 only - Mar 19 2:00s 0 -
Rule Tonga 2000 2001 - Nov Sun>=1 2:00 1:00 S
Rule Tonga 2001 2002 - Jan lastSun 2:00 0 -
Rule Tonga 2016 max - Nov Sun>=1 2:00 1:00 S
Rule Tonga 2017 max - Jan Sun>=15 3:00 0 -
Rule Tonga 2016 only - Nov Sun>=1 2:00 1:00 S
Rule Tonga 2017 only - Jan Sun>=15 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Pacific/Tongatapu 12:19:20 - LMT 1901
12:20 - +1220 1941
@ -779,7 +782,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901
# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin,
# "The United States High-Altitude Test Experience: A Review Emphasizing the
# Impact on the Environment", Los Alamos LA-6405, Oct 1976.
# http://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
# https://www.fas.org/sgp/othergov/doe/lanl/docs1/00322994.pdf
# See the table on page 4 where he lists GMT and local times for the tests; a
# footnote for the JI tests reads that local time is "JI time = Hawaii Time
# Minus One Hour".
@ -845,7 +848,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
@ -992,7 +995,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# AEST ACST AWST AEDT ACDT
#
# Parliamentary Library (2008-11-10)
# http://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
# https://www.aph.gov.au/binaries/library/pubs/rp/2008-09/09rp14.pdf
# EST CST WST preferred for standard time; AEST AEDT ACST ACDT also used
#
# The Transport Safety Bureau has an extensive series of accident reports,
@ -1028,13 +1031,13 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
#
# NSW (including LHI and Broken Hill):
# Standard Time Act 1987 (updated 1995-04-04)
# http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
# https://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html
# ACT
# Standard Time and Summer Time Act 1972
# http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
# https://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html
# SA
# Standard Time Act, 1898
# http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
# https://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html
# From David Grosz (2005-06-13):
# It was announced last week that Daylight Saving would be extended by
@ -1329,7 +1332,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm
# (1999-07-22). For now, we'll wait to see if this really happens.
#
# Victoria will following NSW. See:
# Victoria will follow NSW. See:
# Vic to extend daylight saving (1999-07-28)
# http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm
#
@ -1432,7 +1435,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# the ACT for all 52 weeks of the year...
#
# We have a wrap-up here:
# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
# https://www.timeanddate.com/news/time/south-australia-extends-dst.html
###############################################################################
# New Zealand
@ -1486,7 +1489,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# From Paul Eggert (2014-07-14):
# Chatham Island time was formally standardized on 1957-01-01 by
# New Zealand's Standard Time Amendment Act 1956 (1956-10-26).
# http://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
# https://www.austlii.edu.au/nz/legis/hist_act/staa19561956n100244.pdf
# According to Google Books snippet view, a speaker in the New Zealand
# parliamentary debates in 1956 said "Clause 78 makes provision for standard
# time in the Chatham Islands. The time there is 45 minutes in advance of New
@ -1601,7 +1604,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# the Norfolk Island Museum and the Australian Bureau of Meteorology's
# Norfolk Island station, and found no record of Norfolk observing DST
# other than in 1974/5. See:
# http://www.timeanddate.com/time/australia/norfolk-island.html
# https://www.timeanddate.com/time/australia/norfolk-island.html
# Pitcairn
@ -1629,11 +1632,13 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# (Western) Samoa and American Samoa
# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
# that in 1879 the King of Samoa decided to change
# Howse writes (p 153) that after the 1879 standardization on Antipodean
# time by the British governor of Fiji, the King of Samoa decided to change
# "the date in his kingdom from the Antipodean to the American system,
# ordaining - by a masterpiece of diplomatic flattery - that
# the Fourth of July should be celebrated twice in that year."
# This happened in 1892, according to the Evening News (Sydney) of 1892-07-20.
# https://www.staff.science.uu.nl/~gent0113/idl/idl.htm
# Although Shanks & Pottenger says they both switched to UT -11:30
# in 1911, and to -11 in 1950. many earlier sources give -11
@ -1644,6 +1649,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# day in 2011. Assume also that the Samoas follow the US and New
# Zealand's "ST"/"DT" style of daylight-saving abbreviations.
# Tonga
# From Paul Eggert (1996-01-22):
@ -1738,6 +1744,15 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Assume Tonga will observe DST from the first Sunday in November at 02:00
# through the third Sunday in January at 03:00, like Fiji, for now.
# From David Wade (2017-10-18):
# In August government was disolved by the King. The current prime minister
# continued in office in care taker mode. It is easy to see that few
# decisions will be made until elections 16th November.
#
# From Paul Eggert (2017-10-18):
# For now, guess that DST is discontinued. That's what the IATA is guessing.
# Wake
# From Vernice Anderson, Personal Secretary to Philip Jessup,
@ -1750,7 +1765,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# making calculation of time in Washington difficult if not almost
# impossible.
#
# http://www.trumanlibrary.org/wake/meeting.htm
# https://www.trumanlibrary.org/oralhist/andrsonv.htm
# From Paul Eggert (2003-03-23):
# We have no other report of DST in Wake Island, so omit this info for now.
@ -1778,7 +1793,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# an international standard, there are some places on the high seas where the
# correct date is ambiguous.
# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
# From Wikipedia <https://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
# Before 1920, all ships kept local apparent time on the high seas by setting
# their clocks at night or at the morning sight so that, given the ship's
# speed and direction, it would be 12 o'clock when the Sun crossed the ship's

@ -84,7 +84,9 @@ Link America/Sao_Paulo Brazil/East
Link America/Manaus Brazil/West
Link America/Halifax Canada/Atlantic
Link America/Winnipeg Canada/Central
Link America/Regina Canada/East-Saskatchewan
# This line is commented out, as the name exceeded the 14-character limit
# and was an unused misnomer.
#Link America/Regina Canada/East-Saskatchewan
Link America/Toronto Canada/Eastern
Link America/Edmonton Canada/Mountain
Link America/St_Johns Canada/Newfoundland

@ -60,14 +60,14 @@
# [PDF] (1914-03)
#
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>. He writes:
# <https://www.jstor.org/stable/1774359>. He writes:
# "It is requested that corrections and additions to these tables
# may be sent to Mr. John Milne, Royal Geographical Society,
# Savile Row, London." Nowadays please email them to tz@iana.org.
#
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
# This Russian-language source was consulted by Vladimir Karpinsky; see
# http://mm.icann.org/pipermail/tz/2014-August/021320.html
# https://mm.icann.org/pipermail/tz/2014-August/021320.html
# The full Russian citation is:
# Бялокоз, Евгений Людвигович. Новый счет времени в течении суток
# введенный декретом Совета народных комиссаров для всей России с 1-го
@ -210,7 +210,7 @@
# foundations of civilization throughout the world.
# -- "A Silent Toast to William Willett", Pictorial Weekly;
# republished in Finest Hour (Spring 2002) 1(114):26
# http://www.winstonchurchill.org/images/finesthour/Vol.01%20No.114.pdf
# https://www.winstonchurchill.org/publications/finest-hour/finest-hour-114/a-silent-toast-to-william-willett-by-winston-s-churchill
# From Paul Eggert (2015-08-08):
# The OED Supplement says that the English originally said "Daylight Saving"
@ -248,8 +248,8 @@
# official designation; the reply of the 21st was that there wasn't
# but he couldn't think of anything better than the "Double British
# Summer Time" that the BBC had been using informally.
# http://www.polyomino.org.uk/british-time/bbc-19410418.png
# http://www.polyomino.org.uk/british-time/ho-19410421.png
# https://www.polyomino.org.uk/british-time/bbc-19410418.png
# https://www.polyomino.org.uk/british-time/ho-19410421.png
# From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
# [N]o official designation has as far as I know been adopted for the time
@ -266,13 +266,13 @@
# the history of summer time legislation in the United Kingdom.
# Since 1998 Joseph S. Myers has been updating
# and extending this list, which can be found in
# http://www.polyomino.org.uk/british-time/
# https://www.polyomino.org.uk/british-time/
# From Joseph S. Myers (1998-01-06):
#
# The legal time in the UK outside of summer time is definitely GMT, not UTC;
# see Lord Tanlaw's speech
# http://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
# https://www.publications.parliament.uk/pa/ld199798/ldhansrd/vo970611/text/70611-10.htm#70611-10_head0
# (Lords Hansard 11 June 1997 columns 964 to 976).
# From Paul Eggert (2006-03-22):
@ -318,7 +318,7 @@
# Irish 'public feeling (was) outraged by forcing of English time on us'."
# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising.
# Irish Times 2014-10-27.
# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
# https://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411
# From Joseph S. Myers (2005-01-26):
# Irish laws are available online at <http://www.irishstatutebook.ie>.
@ -371,6 +371,12 @@
# Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
# "Irish Summer Time", abbreviated to "IST".
# Michael Deckers (2017-06-01) gave the following URLs for Ireland's
# Summer Time Act, 1925 and Summer Time Orders, 1926 and 1947:
# http://www.irishstatutebook.ie/eli/1925/act/8/enacted/en/print.html
# http://www.irishstatutebook.ie/eli/1926/sro/919/made/en/print.html
# http://www.irishstatutebook.ie/eli/1947/sro/71/made/en/print.html
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
# Summer Time Act, 1916
Rule GB-Eire 1916 only - May 21 2:00s 1:00 BST
@ -495,14 +501,14 @@ Link Europe/London Europe/Isle_of_Man
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2
-0:25:21 - DMT 1916 May 21 2:00 # Dublin MT
-0:25:21 - DMT 1916 May 21 2:00s # Dublin MT
-0:25:21 1:00 IST 1916 Oct 1 2:00s
0:00 GB-Eire %s 1921 Dec 6 # independence
0:00 GB-Eire GMT/IST 1940 Feb 25 2:00
0:00 1:00 IST 1946 Oct 6 2:00
0:00 - GMT 1947 Mar 16 2:00
0:00 1:00 IST 1947 Nov 2 2:00
0:00 - GMT 1948 Apr 18 2:00
0:00 GB-Eire GMT/IST 1940 Feb 25 2:00s
0:00 1:00 IST 1946 Oct 6 2:00s
0:00 - GMT 1947 Mar 16 2:00s
0:00 1:00 IST 1947 Nov 2 2:00s
0:00 - GMT 1948 Apr 18 2:00s
0:00 GB-Eire GMT/IST 1968 Oct 27
1:00 - IST 1971 Oct 31 2:00u
0:00 GB-Eire GMT/IST 1996
@ -648,7 +654,7 @@ Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# Council of Ministers of the USSR from 1989-03-14 No. 227.
#
# I did not find full texts of these acts. For the 1989 one we have
# title at http://base.garant.ru/70754136/ :
# title at https://base.garant.ru/70754136/ :
# "About change in calculation of time on the territories of
# Lithuanian SSR, Latvian SSR and Estonian SSR, Astrakhan,
# Kaliningrad, Kirov, Kuybyshev, Ulyanovsk and Uralsk oblasts".
@ -679,7 +685,7 @@ Rule Russia 1996 2010 - Oct lastSun 2:00s 0 -
# http://bmockbe.ru/events/?ID=7583
#
# Medvedev signed a law on the calculation of the time (in russian):
# http://www.regnum.ru/news/polit/1413906.html
# https://www.regnum.ru/news/polit/1413906.html
# From Arthur David Olson (2011-06-15):
# Take "abolishing daylight saving time" to mean that time is now considered
@ -806,7 +812,7 @@ Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
# Sources (Russian language):
# http://www.belta.by/ru/all_news/society/V-Belarusi-otmenjaetsja-perexod-na-sezonnoe-vremja_i_572952.html
# http://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/
# http://news.tut.by/society/250578.html
# https://news.tut.by/society/250578.html
#
# From Alexander Bokovoy (2014-10-09):
# Belarussian government decided against changing to winter time....
@ -1127,7 +1133,7 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base
# for their standard and summer times. He says no, they use "suveaeg"
# (summer time) and "talveaeg" (winter time).
# From The Baltic Times <http://www.baltictimes.com/> (1999-09-09)
# From The Baltic Times <https://www.baltictimes.com/> (1999-09-09)
# via Steffen Thorsen:
# This year will mark the last time Estonia shifts to summer time,
# a council of the ruling coalition announced Sept. 6....
@ -1179,7 +1185,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
# This is documented in Heikki Oja: Aikakirja 2007, published by The Almanac
# Office of University of Helsinki, ISBN 952-10-3221-9, available online (in
# Finnish) at
# http://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
# https://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
#
# Page 105 (56 in PDF version) has a handy table of all past daylight savings
# transitions. It is easy enough to interpret without Finnish skills.
@ -1192,7 +1198,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
# From Konstantin Hyppönen (2014-06-13):
# [Heikki Oja's book Aikakirja 2013]
# http://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
# https://almanakka.helsinki.fi/images/aikakirja/Aikakirja2013kokonaan.pdf
# pages 104-105, including a scan from a newspaper published on Apr 2 1942
# say that ... [o]n Apr 2 1942, 24 o'clock (which means Apr 3 1942,
# 00:00), clocks were moved one hour forward. The newspaper
@ -1322,7 +1328,7 @@ Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15 0:01
# From Jörg Schilling (2002-10-23):
# In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
# http://www.dhm.de/lemo/html/biografien/BersarinNikolai/
# https://www.dhm.de/lemo/html/biografien/BersarinNikolai/
# General [Nikolai] Bersarin.
# From Paul Eggert (2003-03-08):
@ -1547,7 +1553,7 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908
# From Paul Eggert (2016-10-27):
# Go with INRiM for DST rules, except as corrected by Inglis for 1944
# for the Kingdom of Italy. This is consistent with Renzo Baldini.
# Model Rome's occupation by using using C-Eur rules from 1943-09-10
# Model Rome's occupation by using C-Eur rules from 1943-09-10
# to 1944-06-04; although Rome was an open city during this period, it
# was effectively controlled by Germany.
#
@ -1862,14 +1868,14 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
# Following Moldova and neighboring Ukraine- Transnistria (Pridnestrovie)-
# Tiraspol will go back to winter time on October 30, 2011.
# News from Moldova (in russian):
# http://ru.publika.md/link_317061.html
# https://ru.publika.md/link_317061.html
# From Roman Tudos (2015-07-02):
# http://lex.justice.md/index.php?action=view&view=doc&lang=1&id=355077
# From Paul Eggert (2015-07-01):
# The abovementioned official link to IGO1445-868/2014 states that
# 2014-10-26's fallback transition occurred at 03:00 local time. Also,
# http://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
# https://www.trm.md/en/social/la-30-martie-vom-trece-la-ora-de-vara
# says the 2014-03-30 spring-forward transition was at 02:00 local time.
# Guess that since 1997 Moldova has switched one hour before the EU.
@ -1941,7 +1947,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
# Amsterdam mean time.
# The data entries before 1945 are taken from
# http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
# https://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
@ -2022,7 +2028,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
# so it must have diverged from Oslo time during the war, as Oslo was
# keeping Berlin time.
#
# <http://home.no.net/janmayen/history.htm> says that the meteorologists
# <https://www.jan-mayen.no/history.htm> says that the meteorologists
# burned down their station in 1940 and left the island, but returned in
# 1941 with a small Norwegian garrison and continued operations despite
# frequent air attacks from Germans. In 1943 the Americans established a
@ -2060,7 +2066,7 @@ Rule Poland 1945 only - Apr 29 0:00 1:00 S
Rule Poland 1945 only - Nov 1 0:00 0 -
# For 1946 on the source is Kazimierz Borkowski,
# Toruń Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
# http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
# https://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1
# Thanks to Przemysław Augustyniak (2005-05-28) for this reference.
# He also gives these further references:
# Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
@ -2094,7 +2100,7 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
#
# From Paul Eggert (2014-08-11), after a heads-up from Stephen Colebourne:
# According to a Portuguese decree (1911-05-26)
# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
# https://dre.pt/application/dir/pdf1sdip/1911/05/12500/23132313.pdf
# Lisbon was at -0:36:44.68, but switched to GMT on 1912-01-01 at 00:00.
# Round the old offset to -0:36:45. This agrees with Willett but disagrees
# with Shanks, who says the transition occurred on 1911-05-24 at 00:00 for
@ -2276,7 +2282,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# 2011 No. 725" and contains no other dates or "effective date" information.
#
# Another source is
# http://www.rg.ru/2011/09/06/chas-zona-dok.html
# https://rg.ru/2011/09/06/chas-zona-dok.html
# which, according to translate.google.com, begins "Resolution of the
# Government of the Russian Federation on August 31, 2011 N 725" and also
# contains "Date first official publication: September 6, 2011 Posted on:
@ -2284,7 +2290,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# does not contain any "effective date" information.
#
# Another source is
# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
# https://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
# which, in note 8, contains "Resolution No. 725 of August 31, 2011...
# Effective as of after 7 days following the day of the official publication"
# but which does not contain any reference to September 6, 2011.
@ -2320,7 +2326,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# http://itar-tass.com/obschestvo/1333711
# http://www.pravo.gov.ru:8080/page.aspx?111660
# http://www.kremlin.ru/acts/46279
# From October 26, 2014 the new Russian time zone map will looks like this:
# From October 26, 2014 the new Russian time zone map will look like this:
# http://www.worldtimezone.com/dst_news/dst_news_russia-map-2014-07.html
# From Paul Eggert (2006-03-22):
@ -2367,7 +2373,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# with maintenance only and represent our best guesses as to which regions
# are covered by each zone. They are not meant to be taken as an authoritative
# listing. The region codes listed come from
# http://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
# https://en.wikipedia.org/w/?title=Federal_subjects_of_Russia&oldid=611810498
# and are used for convenience only; no guarantees are made regarding their
# future stability. ISO 3166-2:RU codes are also listed for first-level
# divisions where available.
@ -2532,7 +2538,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1893 Apr
# http://www.kaliningradka.ru/site_pc/cherez/index.php?ELEMENT_ID=40091
# says that Kaliningrad decided not to be an exception 2 days before the
# 1991-03-31 switch and one person at
# http://izhevsk.ru/forum_light_message/50/682597-m8369040.html
# https://izhevsk.ru/forum_light_message/50/682597-m8369040.html
# says he remembers that Samara opted out of the 1992-01-19 exception
# 2 days before the switch.
#
@ -2604,7 +2610,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880
3:00 - MSK 1997 Mar lastSun 1:00u
# From Alexander Krivenyshev (2014-03-17):
# time change at 2:00 (2am) on March 30, 2014
# http://vz.ru/news/2014/3/17/677464.html
# https://vz.ru/news/2014/3/17/677464.html
# From Paul Eggert (2014-03-30):
# Simferopol and Sevastopol reportedly changed their central town clocks
# late the previous day, but this appears to have been ceremonial
@ -2787,7 +2793,7 @@ Zone Asia/Omsk 4:53:30 - LMT 1919 Nov 14
# suggests that Altai Republic transitioned to Moscow+3 on
# 1995-05-28.
#
# http://regnum.ru/news/society/1957270.html
# https://regnum.ru/news/society/1957270.html
# has some historical data for Altai Krai:
# before 1957: west part on UTC+6, east on UTC+7
# after 1957: UTC+7
@ -3161,8 +3167,8 @@ Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
# districts, but have very similar populations. In fact, Wikipedia currently
# lists them both as having 3528 people, exactly 1668 males and 1860 females
# each! (Yikes!)
# http://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
# http://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
# https://en.wikipedia.org/w/?title=Srednekolymsky_District&oldid=603435276
# https://en.wikipedia.org/w/?title=Verkhnekolymsky_District&oldid=594378493
# Assume this is a mistake, albeit an amusing one.
#
# Looking at censuses, the populations of the two municipalities seem to have
@ -3483,7 +3489,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1
#
# From Alois Treindl (2013-09-11):
# The Federal regulations say
# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html
# https://www.admin.ch/opc/de/classified-compilation/20071096/index.html
# ... the meridian for Bern mean time ... is 7 degrees 26' 22.50".
# Expressed in time, it is 0h29m45.5s.
@ -3560,9 +3566,9 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment.
# According to the articles linked below, Turkey will change into summer
# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
# This change is due to a nationwide exam on 27th.
# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
# https://www.worldbulletin.net/?aType=haber&ArticleID=70872
# Turkish:
# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
# https://www.hurriyet.com.tr/yaz-saati-uygulamasi-bir-gun-ileri-alindi-17230464
# From Faruk Pasin (2014-02-14):
# The DST for Turkey has been changed for this year because of the
@ -3698,7 +3704,7 @@ Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# http://www.segodnya.ua/news/14290482.html
#
# Deputies cancelled the winter time (in Russian)
# http://www.pravda.com.ua/rus/news/2011/09/20/6600616/
# https://www.pravda.com.ua/rus/news/2011/09/20/6600616/
#
# From Philip Pizzey (2011-10-18):
# Today my Ukrainian colleagues have informed me that the

@ -26,19 +26,18 @@
# This file is in the public domain.
# This file is generated automatically from the data in the public-domain
# leap-seconds.list file available from most NIST time servers.
# If the URL <ftp://time.nist.gov/pub/leap-seconds.list> does not work,
# you should be able to pick up leap-seconds.list from a secondary NIST server.
# See <http://tf.nist.gov/tf-cgi/servers.cgi> for a list of secondary servers.
# leap-seconds.list file, which is copied from:
# ftp://ftp.nist.gov/pub/time/leap-seconds.list
# For more about leap-seconds.list, please see
# The NTP Timescale and Leap Seconds
# http://www.eecis.udel.edu/~mills/leap.html
# https://www.eecis.udel.edu/~mills/leap.html
# The International Earth Rotation and Reference Systems Service
# periodically uses leap seconds to keep UTC to within 0.9 s of UT1
# (which measures the true angular orientation of the earth in space); see
# Terry J Quinn, The BIPM and the accurate measure of time,
# Proc IEEE 79, 7 (July 1991), 894-905 <http://dx.doi.org/10.1109/5.84965>.
# Levine J. Coordinated Universal Time and the leap second.
# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995
# http://ieeexplore.ieee.org/document/7909995/
# There were no leap seconds before 1972, because the official mechanism
# accounting for the discrepancy between atomic time and the earth's rotation
# did not exist until the early 1970s.
@ -81,5 +80,5 @@ Leap 2012 Jun 30 23:59:60 + S
Leap 2015 Jun 30 23:59:60 + S
Leap 2016 Dec 31 23:59:60 + S
# Updated through IERS Bulletin C53
# File expires on: 28 December 2017
# Updated through IERS Bulletin C54
# File expires on: 28 June 2018

@ -128,10 +128,13 @@
# Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
# In the introduction, Oboler spoke of "Eastern Peace Time."
# An AltaVista search turned up:
# http://rowayton.org/rhs/hstaug45.html
# https://web.archive.org/web/20000926032210/http://rowayton.org/rhs/hstaug45.html
# "When the time is announced over the radio now, it is 'Eastern Peace
# Time' instead of the old familiar 'Eastern War Time.' Peace is wonderful."
# (August 1945) by way of confirmation.
#
# From Paul Eggert (2017-09-23):
# This was the V-J Day issue of the Clamdigger, a Rowayton, CT newsletter.
# From Joseph Gallant citing
# George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
@ -280,7 +283,7 @@ Zone PST8PDT -8:00 US P%sT
# HST and HDT are standardized abbreviations for Hawaii-Aleutian
# standard and daylight times. See section 9.47 (p 234) of the
# U.S. Government Printing Office Style Manual (2008)
# http://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
# https://www.gpo.gov/fdsys/pkg/GPO-STYLEMANUAL-2008/pdf/GPO-STYLEMANUAL-2008.pdf
# From Arthur David Olson, 2005-08-09
# The following was signed into law on 2005-08-08.
@ -369,7 +372,7 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
# western Tennessee, most of Texas, Wisconsin
# From Larry M. Smith (2006-04-26) re Wisconsin:
# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
# https://docs.legis.wisconsin.gov/statutes/statutes/175.pdf
# is currently enforced at the 01:00 time of change. Because the local
# "bar time" in the state corresponds to 02:00, a number of citations
# are issued for the "sale of class 'B' alcohol after prohibited
@ -378,7 +381,7 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58
# From Douglas R. Bomberg (2007-03-12):
# Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
# Statue 175 closer in synch with the US Congress' intent....
# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
# https://docs.legis.wisconsin.gov/2007/related/acts/3
# From an email administrator of the City of Fort Pierre, SD (2015-12-21):
# Fort Pierre is technically located in the Mountain time zone as is
@ -425,7 +428,7 @@ Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
# ...it appears that Mercer County, North Dakota, changed from the
# mountain time zone to the central time zone at the last transition from
# daylight-saving to standard time (on Nov. 7, 2010):
# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
# https://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
# From Andy Lipscomb (2011-01-24):
@ -476,7 +479,7 @@ Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
# legal time, and is not part of the data here.) See:
# Ross SA. An energy crisis from the past: Northern California in 1948.
# Working Paper No. 8, Institute of Governmental Studies, UC Berkeley,
# 1973-11. http://escholarship.org/uc/item/8x22k30c
# 1973-11. https://escholarship.org/uc/item/8x22k30c
#
# In another measure to save electricity, DST was instituted from 1948-03-14
# at 02:01 to 1949-01-16 at 02:00, with the governor having the option to move
@ -497,8 +500,8 @@ Zone America/Denver -6:59:56 - LMT 1883 Nov 18 12:00:04
# which established DST from April's last Sunday at 01:00 until September's
# last Sunday at 02:00. This was amended by 1962's Proposition 6, which changed
# the fall-back date to October's last Sunday. See:
# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
# http://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1501&context=ca_ballot_props
# https://repository.uchastings.edu/cgi/viewcontent.cgi?article=1636&context=ca_ballot_props
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
Rule CA 1948 only - Mar 14 2:01 1:00 D
@ -515,20 +518,31 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# Alaska
# AK%sT is the modern abbreviation for -09 per USNO.
#
# From Paul Eggert (2001-05-30):
# From Paul Eggert (2017-06-15):
# Howse writes that Alaska switched from the Julian to the Gregorian calendar,
# and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
# also a Friday. Include only the time zone part of this transition,
# ignoring the switch from Julian to Gregorian, since we can't represent
# the Julian calendar.
# On Friday, 1867-10-18 (Gregorian), at precisely 15:30 local time, the
# Russian forts and fleet at Sitka fired salutes to mark the ceremony of
# formal transfer. See the Sacramento Daily Union (1867-11-14), p 3, col 2.
# https://cdnc.ucr.edu/cgi-bin/cdnc?a=d&d=SDU18671114.2.12.1
# Sitka workers did not change their calendars until Sunday, 1867-10-20,
# and so celebrated two Sundays that week. See: Ahllund T (tr Hallamaa P).
# From the memoirs of a Finnish workman. Alaska History. 2006 Fall;21(2):1-25.
# http://alaskahistoricalsociety.org/wp-content/uploads/2016/12/Ahllund-2006-Memoirs-of-a-Finnish-Workman.pdf
# Include only the time zone part of this transition, ignoring the switch
# from Julian to Gregorian, since we can't represent the Julian calendar.
#
# As far as we know, none of the exact locations mentioned below were
# As far as we know, of the locations mentioned below only Sitka was
# permanently inhabited in 1867 by anyone using either calendar.
# (Yakutat was colonized by the Russians in 1799, but the settlement
# was destroyed in 1805 by a Yakutat-kon war party.) However, there
# were nearby inhabitants in some cases and for our purposes perhaps
# it's best to simply use the official transition.
# (Yakutat was colonized by the Russians in 1799, but the settlement was
# destroyed in 1805 by a Yakutat-kon war party.) Many of Alaska's inhabitants
# were unaware of the US acquisition of Alaska, much less of any calendar or
# time change. However, the Russian-influenced part of Alaska did observe
# Russian time, and it is more accurate to model this than to ignore it.
# The database format requires an exact transition time; use the Russian
# salute as a somewhat-arbitrary time for the formal transfer of control for
# all of Alaska. Sitka's UTC offset is -9:01:13; adjust its 15:30 to the
# local times of other Alaskan locations so that they change simultaneously.
# From Paul Eggert (2014-07-18):
# One opinion of the early-1980s turmoil in Alaska over time zones and
@ -581,10 +595,10 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02
# It seems Metlakatla did go off PST on Sunday, November 1, changing
# their time to AKST and are going to follow Alaska's DST, switching
# between AKST and AKDT from now on....
# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
# https://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
Zone America/Juneau 15:02:19 - LMT 1867 Oct 19 15:33:32
-8:57:41 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
@ -594,7 +608,7 @@ Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Sitka 14:58:47 - LMT 1867 Oct 18
Zone America/Sitka 14:58:47 - LMT 1867 Oct 19 15:30
-9:01:13 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
@ -602,7 +616,7 @@ Zone America/Sitka 14:58:47 - LMT 1867 Oct 18
-8:00 US P%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 19 15:44:55
-8:46:18 - LMT 1900 Aug 20 12:00
-8:00 - PST 1942
-8:00 US P%sT 1946
@ -610,14 +624,14 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
-8:00 US P%sT 1983 Oct 30 2:00
-8:00 - PST 2015 Nov 1 2:00
-9:00 US AK%sT
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18
Zone America/Yakutat 14:41:05 - LMT 1867 Oct 19 15:12:18
-9:18:55 - LMT 1900 Aug 20 12:00
-9:00 - YST 1942
-9:00 US Y%sT 1946
-9:00 - YST 1969
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Anchorage 14:00:24 - LMT 1867 Oct 18
Zone America/Anchorage 14:00:24 - LMT 1867 Oct 19 14:31:37
-9:59:36 - LMT 1900 Aug 20 12:00
-10:00 - AST 1942
-10:00 US A%sT 1967 Apr
@ -625,7 +639,7 @@ Zone America/Anchorage 14:00:24 - LMT 1867 Oct 18
-10:00 US AH%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Nome 12:58:21 - LMT 1867 Oct 18
Zone America/Nome 12:58:22 - LMT 1867 Oct 19 13:29:35
-11:01:38 - LMT 1900 Aug 20 12:00
-11:00 - NST 1942
-11:00 US N%sT 1946
@ -634,7 +648,7 @@ Zone America/Nome 12:58:21 - LMT 1867 Oct 18
-11:00 US B%sT 1983 Oct 30 2:00
-9:00 US Y%sT 1983 Nov 30
-9:00 US AK%sT
Zone America/Adak 12:13:21 - LMT 1867 Oct 18
Zone America/Adak 12:13:22 - LMT 1867 Oct 19 12:44:35
-11:46:38 - LMT 1900 Aug 20 12:00
-11:00 - NST 1942
-11:00 US N%sT 1946
@ -670,7 +684,7 @@ Zone America/Adak 12:13:21 - LMT 1867 Oct 18
# "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
# of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
# the article is available at
# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
# https://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
# and indicates that standard time was adopted effective noon, January
# 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
# saving for the period between the last Sunday of each April and the
@ -769,7 +783,7 @@ Zone America/Boise -7:44:49 - LMT 1883 Nov 18 12:15:11
# Indiana
#
# For a map of Indiana's time zone regions, see:
# http://en.wikipedia.org/wiki/Time_in_Indiana
# https://en.wikipedia.org/wiki/Time_in_Indiana
#
# From Paul Eggert (2007-08-17):
# Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
@ -996,7 +1010,7 @@ Zone America/Kentucky/Louisville -5:43:02 - LMT 1883 Nov 18 12:16:58
# From Paul Eggert (2001-07-16):
# The final rule was published in the
# Federal Register 65, 160 (2000-08-17), pp 50154-50158.
# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22
# https://www.gpo.gov/fdsys/pkg/FR-2000-08-17/html/00-20854.htm
#
Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
-6:00 US C%sT 1946
@ -1022,7 +1036,7 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
# West Wendover, NV officially switched from Pacific to mountain time on
# 1999-10-31. See the
# Federal Register 64, 203 (1999-10-21), pp 56705-56707.
# http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15
# https://www.gpo.gov/fdsys/pkg/FR-1999-10-21/html/99-27240.htm
# However, the Federal Register says that West Wendover already operated
# on mountain time, and the rule merely made this official;
# hence a separate tz entry is not needed.
@ -1052,12 +1066,23 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT 1883 Nov 18 12:20:36
# one hour in 1914." This change is not in Shanks. We have no more
# info, so omit this for now.
#
# From Paul Eggert (2017-07-26):
# Although Shanks says Detroit observed DST in 1967 from 06-14 00:01
# until 10-29 00:01, I now see multiple reports that this is incorrect.
# For example, according to a 50-year anniversary report about the 1967
# Detroit riots and a major-league doubleheader on 1967-07-23, "By the time
# the last fly ball of the doubleheader settled into the glove of leftfielder
# Lenny Green, it was after 7 p.m. Detroit did not observe daylight saving
# time, so light was already starting to fail. Twilight was made even deeper
# by billowing columns of smoke that ascended in an unbroken wall north of the
# ballpark." See: Dow B. Detroit '67: As violence unfolded, Tigers played two
# at home vs. Yankees. Detroit Free Press 2017-07-23.
# https://www.freep.com/story/sports/mlb/tigers/2017/07/23/detroit-tigers-1967-riot-new-york-yankees/499951001/
#
# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
Rule Detroit 1948 only - Apr lastSun 2:00 1:00 D
Rule Detroit 1948 only - Sep lastSun 2:00 0 S
Rule Detroit 1967 only - Jun 14 2:00 1:00 D
Rule Detroit 1967 only - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Detroit -5:32:11 - LMT 1905
-6:00 - CST 1915 May 15 2:00
@ -1121,7 +1146,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# [PDF] (1914-03)
#
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
# <http://www.jstor.org/stable/1774359>.
# <https://www.jstor.org/stable/1774359>.
#
# See the 'europe' file for Greenland.
@ -1167,19 +1192,19 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# The British Columbia government announced yesterday that it will
# adjust daylight savings next year to align with changes in the
# U.S. and the rest of Canada....
# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
# https://archive.news.gov.bc.ca/releases/news_releases_2005-2009/2006AG0014-000330.htm
# ...
# Nova Scotia
# Daylight saving time will be extended by four weeks starting in 2007....
# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
# https://www.novascotia.ca/just/regulations/rg2/2006/ma1206.pdf
#
# [For New Brunswick] the new legislation dictates that the time change is to
# be done at 02:00 instead of 00:01.
# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
# https://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
# ...
# Manitoba has traditionally changed the clock every fall at 03:00.
# As of 2006, the transition is to take place one hour earlier at 02:00.
# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
# https://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
# ...
# [Alberta, Ontario, Quebec] will follow US rules.
# http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
@ -1193,7 +1218,7 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
# ...
# Yukon
# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
# https://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
# ...
# N.W.T. will follow US rules. Whoever maintains the government web site
# does not seem to believe in bookmarks. To see the news release, click the
@ -1214,8 +1239,8 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# time and daylight saving time arrangements in Canada circa 1998.
#
# National Research Council Canada maintains info about time zones and DST.
# http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
# http://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
# https://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html
# https://www.nrc-cnrc.gc.ca/eng/services/time/faq/index.html#Q5
# Its unofficial information is often taken from Matthews and Vincent.
# From Paul Eggert (2006-06-27):
@ -1252,11 +1277,13 @@ Rule Canada 2007 max - Nov Sun>=1 2:00 0 S
# Newfoundland and Labrador
# From Paul Eggert (2000-10-02):
# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
# but the only part of Labrador that follows the rules is the
# southeast corner, including Port Hope Simpson and Mary's Harbour,
# but excluding, say, Black Tickle.
# From Paul Eggert (2017-10-14):
# Legally Labrador should observe Newfoundland time; see:
# McLeod J. Labrador time - legal or not? St. John's Telegram, 2017-10-07
# http://www.thetelegram.com/news/local/labrador-time--legal-or-not-154860/
# Matthews and Vincent (1998) write that the only part of Labrador
# that follows the rules is the southeast corner, including Port Hope
# Simpson and Mary's Harbour, but excluding, say, Black Tickle.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule StJohns 1917 only - Apr 8 2:00 1:00 D
@ -1456,7 +1483,7 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9
# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
# that the coastal strip from just east of Natashquan to Blanc-Sablon
# observes Atlantic standard time all year round.
# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
# https://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
# says this common practice was codified into law as of 2007.
# For lack of better info, guess this practice began around 1970, contra to
# Shanks & Pottenger who have this region observing AST/ADT.
@ -1488,6 +1515,11 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884
# earlier in June).
#
# Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
#
# From Paul Eggert (2017-07-08):
# For more on Orillia, see: Daubs K. Bold attempt at daylight saving
# time became a comic failure in Orillia. Toronto Star 2017-07-08.
# https://www.thestar.com/news/insight/2017/07/08/bold-attempt-at-daylight-saving-time-became-a-comic-failure-in-orillia.html
# From Paul Eggert (1997-10-17):
# Mark Brader writes that an article in the 1997-10-14 Toronto Star
@ -1979,7 +2011,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# * 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
# c. 7 defines Yukon standard time as UTC-9....
# see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
# [http://canlii.ca/t/7vhg]
# [https://www.canlii.org/en/ca/laws/stat/rsc-1985-c-i-21/latest/rsc-1985-c-i-21.html]
# * C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
# * O.I.C. 1980/02 established DST.
# * O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
@ -2044,7 +2076,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# hours behind Greenwich Time.
#
# * Yukon Standard Time defined as Pacific Standard Time, YCO 1973/214
# http://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
# https://www.canlii.org/en/yk/laws/regu/yco-1973-214/latest/yco-1973-214.html
# C.O. 1973/214 INTERPRETATION ACT ...
#
# 1. Effective October 28, 1973 Commissioner's Order 1967/59 is hereby
@ -2059,7 +2091,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# http://? - no online source found
#
# * Yukon Daylight Saving Time, YOIC 1987/56
# http://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
# https://www.canlii.org/en/yk/laws/regu/yoic-1987-56/latest/yoic-1987-56.html
# O.I.C. 1987/056 INTERPRETATION ACT ...
#
# In every year between
@ -2071,7 +2103,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# Dated ... 9th day of March, A.D., 1987.
#
# * Yukon Daylight Saving Time 2006, YOIC 2006/127
# http://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
# https://www.canlii.org/en/yk/laws/regu/yoic-2006-127/latest/yoic-2006-127.html
# O.I.C. 2006/127 INTERPRETATION ACT ...
#
# 1. In Yukon each year the time for general purposes shall be 7 hours
@ -2085,7 +2117,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# 3. This order comes into force January 1, 2007.
#
# * Interpretation Act, RSY 2002, c 125
# http://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
# https://www.canlii.org/en/yk/laws/stat/rsy-2002-c-125/latest/rsy-2002-c-125.html
# From Rives McDow (1999-09-04):
# Nunavut ... moved ... to incorporate the whole territory into one time zone.
@ -2128,7 +2160,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# From Michaela Rodrigue, writing in the
# Nunatsiaq News (1999-11-19):
# http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html
# http://www.nunatsiaqonline.ca/archives/nunavut991130/nvt91119_17.html
# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
# central - or Nunavut time - for government offices, and eastern time
# for municipal offices and schools.... Igloolik [was similar but then]
@ -2146,7 +2178,7 @@ Zone America/Creston -7:46:04 - LMT 1884
# Central Time and Southampton Island [in the Central zone] is not
# required to use daylight savings.
# From <http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html>
# From <http://www.nunatsiaqonline.ca/archives/nunavut001130/nvt21110_02.html>
# Nunavut now has two time zones (2000-11-10):
# The Nunavut government would allow its employees in Kugluktuk and
# Cambridge Bay to operate on central time year-round, putting them
@ -2477,7 +2509,7 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html
#
# Our page:
# http://www.timeanddate.com/news/time/north-mexico-dst-change.html
# https://www.timeanddate.com/news/time/north-mexico-dst-change.html
# From Arthur David Olson (2010-01-20):
# The page
@ -2896,7 +2928,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
#
# Some more background information is posted here:
# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
# https://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
#
# The article also says that Cuba has been observing DST since 1963,
# while Shanks (and tzdata) has 1965 as the first date (except in the
@ -2943,7 +2975,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://granma.co.cu/2011/03/08/nacional/artic01.html
#
# Our info:
# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
# https://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
#
# From Steffen Thorsen (2011-10-30)
# Cuba will end DST two weeks later this year. Instead of going back
@ -2953,7 +2985,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://www.radioangulo.cu/noticias/cuba/17105-cuba-restablecera-el-horario-del-meridiano-de-greenwich.html
#
# Our page:
# http://www.timeanddate.com/news/time/cuba-time-changes-2011.html
# https://www.timeanddate.com/news/time/cuba-time-changes-2011.html
#
# From Steffen Thorsen (2012-03-01)
# According to Radio Reloj, Cuba will start DST on Midnight between March
@ -2963,7 +2995,7 @@ Zone America/Costa_Rica -5:36:13 - LMT 1890 # San José
# http://www.radioreloj.cu/index.php/noticias-radio-reloj/71-miscelaneas/7529-cuba-aplicara-el-horario-de-verano-desde-el-1-de-abril
#
# Our info on it:
# http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
# https://www.timeanddate.com/news/time/cuba-starts-dst-2012.html
# From Steffen Thorsen (2012-11-03):
# Radio Reloj and many other sources report that Cuba is changing back
@ -3158,8 +3190,8 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# From Steffen Thorsen (2016-03-12):
# Jean Antoine, editor of www.haiti-reference.com informed us that Haiti
# are not going on DST this year. Several other resources confirm this: ...
# http://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
# http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
# https://www.radiotelevisioncaraibes.com/presse/heure_d_t_pas_de_changement_d_heure_pr_vu_pour_cet_ann_e.html
# https://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
# http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
# From Steffen Thorsen (2017-03-12):
@ -3358,7 +3390,7 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# Turks and Caicos
#
# From Chris Dunn in
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007
# https://bugs.debian.org/415007
# (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
# daylight saving dates for time changes have been adjusted to match
# the recent U.S. change of dates.
@ -3380,12 +3412,25 @@ Zone America/Miquelon -3:44:40 - LMT 1911 May 15 # St Pierre
# "permanent daylight saving time" by one year....
# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm
#
# From the Turks & Caicos Cabinet (2017-07-20), heads-up from Steffen Thorsen:
# ... agreed to the reintroduction in TCI of Daylight Saving Time (DST)
# during the summer months and Standard Time, also known as Local
# Time, during the winter months with effect from April 2018 ...
# https://www.gov.uk/government/news/turks-and-caicos-post-cabinet-meeting-statement--3
#
# From Paul Eggert (2017-08-26):
# The date of effect of the spring 2018 change appears to be March 11,
# which makes more sense. See: Hamilton D. Time change back
# by March 2018 for TCI. Magnetic Media. 2017-08-25.
# http://magneticmediatv.com/2017/08/time-change-back-by-march-2018-for-tci/
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Grand_Turk -4:44:32 - LMT 1890
-5:07:11 - KMT 1912 Feb # Kingston Mean Time
-5:00 - EST 1979
-5:00 US E%sT 2015 Nov Sun>=1 2:00
-4:00 - AST
-4:00 - AST 2018 Mar 11 3:00
-5:00 US E%sT
# British Virgin Is
# Virgin Is

@ -45,7 +45,7 @@
#
# For data circa 1899, a common source is:
# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
# http://www.jstor.org/stable/1774359
# https://www.jstor.org/stable/1774359
#
# These tables use numeric abbreviations like -03 and -0330 for
# integer hour and minute UTC offsets. Although earlier editions used
@ -288,8 +288,8 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
#
# Es inminente que en San Luis atrasen una hora los relojes
# (It is imminent in San Luis clocks one hour delay)
# http://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
# https://www.lagaceta.com.ar/nota/253414/Economia/Es-inminente-que-en-San-Luis-atrasen-una-hora-los-relojes.html
# http://www.worldtimezone.com/dst_news/dst_news_argentina02.html
# From Jesper Nørgaard Welen (2008-01-18):
# The page of the San Luis provincial government
@ -408,7 +408,7 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# Perhaps San Luis operates on the legal fiction that it is at -04
# with perpetual summer time, but ordinary usage typically seems to
# just say it's at -03; see, for example,
# http://es.wikipedia.org/wiki/Hora_oficial_argentina
# https://es.wikipedia.org/wiki/Hora_oficial_argentina
# We've documented similar situations as being plain changes to
# standard time, so let's do that here too. This does not change UTC
# offsets, only tm_isdst and the time zone abbreviations. One minor
@ -739,7 +739,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# (Portuguese)
#
# We have a written a short article about it as well:
# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
# https://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
#
# From Alexander Krivenyshev (2011-10-04):
# State Bahia will return to Daylight savings time this year after 8 years off.
@ -748,7 +748,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# In Portuguese:
# http://g1.globo.com/bahia/noticia/2011/10/governador-jaques-wagner-confirma-horario-de-verao-na-bahia.html
# http://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
# https://noticias.terra.com.br/brasil/noticias/0,,OI5390887-EI8139,00-Bahia+volta+a+ter+horario+de+verao+apos+oito+anos.html
# From Guilherme Bernardes Rodrigues (2011-10-07):
# There is news in the media, however there is still no decree about it.
@ -774,16 +774,16 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Rodrigo Severo (2012-10-16):
# Tocantins state will have DST.
# http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
# https://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
# From Steffen Thorsen (2013-09-20):
# Tocantins in Brazil is very likely not to observe DST from October....
# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
# We will keep this article updated when this is confirmed:
# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
# https://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
# From Steffen Thorsen (2013-10-17):
# http://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
# https://www.timeanddate.com/news/time/acre-amazonas-change-time-zone.html
# Senator Jorge Viana announced that Acre will change time zone on November 10.
# He did not specify the time of the change, nor if western parts of Amazonas
# will change as well.
@ -1099,18 +1099,18 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# the following source, cited by Oscar van Vlijmen (2006-10-08):
# [1] Chile Law
# http://www.webexhibits.org/daylightsaving/chile.html
# This contains a copy of a this official table:
# This contains a copy of this official table:
# Cambios en la hora oficial de Chile desde 1900 (retrieved 2008-03-30)
# http://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
# https://web.archive.org/web/20080330200901/http://www.horaoficial.cl/cambio.htm
# [1] needs several corrections, though.
#
# The first set of corrections is from:
# [2] History of the Official Time of Chile
# http://www.horaoficial.cl/ing/horaof_ing.html (retrieved 2012-03-06). See:
# http://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
# https://web.archive.org/web/20120306042032/http://www.horaoficial.cl/ing/horaof_ing.html
# This is an English translation of:
# Historia de la hora oficial de Chile (retrieved 2012-10-24). See:
# http://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
# https://web.archive.org/web/20121024234627/http://www.horaoficial.cl/horaof.htm
# A fancier Spanish version (requiring mouse-clicking) is at:
# http://www.horaoficial.cl/historia_hora.html
# Conflicts between [1] and [2] were resolved as follows:
@ -1386,10 +1386,10 @@ Link America/Curacao America/Kralendijk # Caribbean Netherlands
# Milne says the Central and South American Telegraph Company used -5:24:15.
#
# From Alois Treindl (2016-12-15):
# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
# https://www.elcomercio.com/actualidad/hora-sixto-1993.html
# ... Whether the law applied also to Galápagos, I do not know.
# From Paul Eggert (2016-12-15):
# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
# https://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
# This says President Sixto Durán Ballén signed decree No. 285, which
# established DST from 1992-11-28 to 1993-02-05; it does not give transition
# times. The people called it "hora de Sixto" ("Sixto hour"). The change did
@ -1801,7 +1801,7 @@ Zone America/Montevideo -3:44:44 - LMT 1898 Jun 28
# hours of presidential broadcasts, hours of lines,' quipped comedian
# Jean Mary Curró ...". See: Cawthorne A, Kai D. Venezuela scraps
# half-hour time difference set by Chavez. Reuters 2016-04-15 14:50 -0400
# http://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
# https://www.reuters.com/article/us-venezuela-timezone-idUSKCN0XC2BE
#
# From Matt Johnson (2016-04-20):
# ... published in the official Gazette [2016-04-18], here:

@ -209,7 +209,7 @@ GB +513030-0000731 Europe/London
GD +1203-06145 America/Grenada
GE +4143+04449 Asia/Tbilisi
GF +0456-05220 America/Cayenne
GG +4927-00232 Europe/Guernsey
GG +492717-0023210 Europe/Guernsey
GH +0533-00013 Africa/Accra
GI +3608-00521 Europe/Gibraltar
GL +6411-05144 America/Godthab Greenland (most areas)
@ -244,7 +244,7 @@ IQ +3321+04425 Asia/Baghdad
IR +3540+05126 Asia/Tehran
IS +6409-02151 Atlantic/Reykjavik
IT +4154+01229 Europe/Rome
JE +4912-00207 Europe/Jersey
JE +491101-0020624 Europe/Jersey
JM +175805-0764736 America/Jamaica
JO +3157+03556 Asia/Amman
JP +353916+1394441 Asia/Tokyo

@ -153,7 +153,7 @@ ifeq ($(call check-jvm-feature, link-time-opt), true)
# like the old build, but it's probably not right.
JVM_OPTIMIZATION :=
JVM_CFLAGS_FEATURES += -O3 -flto
JVM_LDFLAGS_FEATURES += -O3 -flto -fwhole-program -fno-strict-aliasing
JVM_LDFLAGS_FEATURES += -O3 -flto -fuse-linker-plugin -fno-strict-aliasing
endif
ifeq ($(call check-jvm-feature, minimal), true)

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2017, 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
@ -35,7 +35,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
SRC := $(TOPDIR)/src/jdk.net/solaris/native/libextnet, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.net, \
MAPFILE := $(TOPDIR)/make/mapfiles/libextnet/mapfile-vers, \
MAPFILE := $(TOPDIR)/make/mapfiles/libextnet/mapfile-solaris, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := -lsocket -lc -ljava, \
@ -48,4 +48,25 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
endif
ifeq ($(OPENJDK_TARGET_OS), linux)
$(eval $(call SetupNativeCompilation, BUILD_LIBEXTNET, \
LIBRARY := extnet, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
SRC := $(TOPDIR)/src/jdk.net/linux/native/libextnet, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/jdk.net, \
MAPFILE := $(TOPDIR)/make/mapfiles/libextnet/mapfile-linux, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := -ljvm -ljava -lc, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libextnet, \
))
$(BUILD_LIBEXTNET): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBEXTNET)
endif
################################################################################

@ -0,0 +1,33 @@
#
# Copyright (c) 2017, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
SUNWprivate_1.1 {
global:
Java_jdk_net_LinuxSocketOptions_setQuickAck0;
Java_jdk_net_LinuxSocketOptions_getQuickAck0;
Java_jdk_net_LinuxSocketOptions_quickAckSupported0;
local:
*;
};

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 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

@ -60,6 +60,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC += \
$(TOPDIR)/test/hotspot/jtreg/runtime/SameObject \
$(TOPDIR)/test/hotspot/jtreg/runtime/BoolReturn \
$(TOPDIR)/test/hotspot/jtreg/runtime/noClassDefFoundMsg \
$(TOPDIR)/test/hotspot/jtreg/runtime/handshake \
$(TOPDIR)/test/hotspot/jtreg/runtime/RedefineTests \
$(TOPDIR)/test/hotspot/jtreg/compiler/floatingpoint/ \
$(TOPDIR)/test/hotspot/jtreg/compiler/calls \
@ -108,6 +109,7 @@ ifeq ($(TOOLCHAIN_TYPE), solstudio)
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMAAThreadStart := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libAllowedFunctions := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libRedefineDoubleDelete := -lc
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libHandshakeTransitionTest := -lc
endif
ifeq ($(OPENJDK_TARGET_OS), linux)

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -79,6 +79,8 @@ define_pd_global(bool, CompactStrings, true);
// Clear short arrays bigger than one word in an arch-specific way
define_pd_global(intx, InitArrayShortSize, BytesPerLong);
define_pd_global(bool, ThreadLocalHandshakes, false);
#if defined(COMPILER1) || defined(COMPILER2)
define_pd_global(intx, InlineSmallCode, 1000);
#endif

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2017, 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
@ -79,6 +79,8 @@ define_pd_global(bool, CompactStrings, false);
define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
define_pd_global(bool, ThreadLocalHandshakes, false);
#define ARCH_FLAGS(develop, \
product, \
diagnostic, \

@ -83,6 +83,8 @@ define_pd_global(bool, CompactStrings, true);
// 2x unrolled loop is shorter with more than 9 HeapWords.
define_pd_global(intx, InitArrayShortSize, 9*BytesPerLong);
define_pd_global(bool, ThreadLocalHandshakes, false);
// Platform dependent flag handling: flags only defined on this platform.
#define ARCH_FLAGS(develop, \
product, \

@ -85,6 +85,8 @@ define_pd_global(bool, CompactStrings, true);
// 8146801 (Short Array Allocation): No performance work done here yet.
define_pd_global(intx, InitArrayShortSize, 1*BytesPerLong);
define_pd_global(bool, ThreadLocalHandshakes, false);
#define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct, range, constraint, writeable) \
\
/* Reoptimize code-sequences of calls at runtime, e.g. replace an */ \

@ -35,6 +35,7 @@
#include "gc/shared/collectedHeap.hpp"
#include "nativeInst_sparc.hpp"
#include "oops/objArrayKlass.hpp"
#include "runtime/safepointMechanism.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#define __ _masm->
@ -1415,7 +1416,11 @@ void LIR_Assembler::return_op(LIR_Opr result) {
if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
__ reserved_stack_check();
}
__ set((intptr_t)os::get_polling_page(), L0);
if (SafepointMechanism::uses_thread_local_poll()) {
__ ld_ptr(Address(G2_thread, Thread::polling_page_offset()), L0);
} else {
__ set((intptr_t)os::get_polling_page(), L0);
}
__ relocate(relocInfo::poll_return_type);
__ ld_ptr(L0, 0, G0);
__ ret();
@ -1424,11 +1429,16 @@ void LIR_Assembler::return_op(LIR_Opr result) {
int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
__ set((intptr_t)os::get_polling_page(), tmp->as_register());
if (SafepointMechanism::uses_thread_local_poll()) {
__ ld_ptr(Address(G2_thread, Thread::polling_page_offset()), tmp->as_register());
} else {
__ set((intptr_t)os::get_polling_page(), tmp->as_register());
}
if (info != NULL) {
add_debug_info_for_branch(info);
}
int offset = __ offset();
__ relocate(relocInfo::poll_type);
__ ld_ptr(tmp->as_register(), 0, G0);
return offset;

@ -33,6 +33,7 @@
#include "ci/ciArray.hpp"
#include "ci/ciObjArrayKlass.hpp"
#include "ci/ciTypeArrayKlass.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "vmreg_sparc.inline.hpp"
@ -1304,7 +1305,7 @@ void LIRGenerator::do_If(If* x) {
if (x->is_safepoint()) {
// increment backedge counter if needed
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
__ safepoint(new_register(T_INT), state_for(x, x->state_before()));
__ safepoint(safepoint_poll_register(), state_for(x, x->state_before()));
}
__ cmp(lir_cond(cond), left, right);

@ -52,4 +52,7 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
#define SUPPORT_RESERVED_STACK_AREA
#endif
// SPARC have implemented the local polling
#define THREAD_LOCAL_POLL
#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP

@ -87,6 +87,8 @@ define_pd_global(bool, CompactStrings, true);
define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
define_pd_global(bool, ThreadLocalHandshakes, true);
#define ARCH_FLAGS(develop, \
product, \
diagnostic, \

@ -36,6 +36,7 @@
#include "prims/jvmtiThreadState.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/thread.inline.hpp"
#include "utilities/align.hpp"
@ -95,12 +96,11 @@ void InterpreterMacroAssembler::dispatch_epilog(TosState state, int bcp_incr) {
else delayed()->nop();
}
void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr) {
void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr, bool generate_poll) {
// %%%% consider branching to a single shared dispatch stub (for each bcp_incr)
assert_not_delayed();
ldub( Lbcp, bcp_incr, Lbyte_code); // load next bytecode
dispatch_Lbyte_code(state, Interpreter::dispatch_table(state), bcp_incr);
dispatch_Lbyte_code(state, Interpreter::dispatch_table(state), bcp_incr, true, generate_poll);
}
@ -261,15 +261,34 @@ void InterpreterMacroAssembler::dispatch_only(TosState state) {
// common code to dispatch and dispatch_only
// dispatch value in Lbyte_code and increment Lbcp
void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, address* table, int bcp_incr, bool verify) {
void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, address* table, int bcp_incr, bool verify, bool generate_poll) {
verify_FPU(1, state);
// %%%%% maybe implement +VerifyActivationFrameSize here
//verify_thread(); //too slow; we will just verify on method entry & exit
if (verify) interp_verify_oop(Otos_i, state, __FILE__, __LINE__);
// dispatch table to use
AddressLiteral tbl(table);
sll(Lbyte_code, LogBytesPerWord, Lbyte_code); // multiply by wordSize
Label dispatch;
if (SafepointMechanism::uses_thread_local_poll() && generate_poll) {
AddressLiteral sfpt_tbl(Interpreter::safept_table(state));
Label no_safepoint;
if (tbl.value() != sfpt_tbl.value()) {
ldx(Address(G2_thread, Thread::polling_page_offset()), G3_scratch, 0);
// Armed page has poll_bit set, if poll bit is cleared just continue.
and3(G3_scratch, SafepointMechanism::poll_bit(), G3_scratch);
br_null_short(G3_scratch, Assembler::pt, no_safepoint);
set(sfpt_tbl, G3_scratch);
ba_short(dispatch);
}
bind(no_safepoint);
}
set(tbl, G3_scratch); // compute addr of table
bind(dispatch);
sll(Lbyte_code, LogBytesPerWord, Lbyte_code); // multiply by wordSize
ld_ptr(G3_scratch, Lbyte_code, G3_scratch); // get entry addr
jmp( G3_scratch, 0 );
if (bcp_incr != 0) delayed()->inc(Lbcp, bcp_incr);

@ -98,7 +98,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
void dispatch_epilog(TosState state, int step = 0);
void dispatch_only(TosState state);
void dispatch_normal(TosState state);
void dispatch_next(TosState state, int step = 0);
void dispatch_next(TosState state, int step = 0, bool generate_poll = false);
void dispatch_next_noverify_oop(TosState state, int step = 0);
void dispatch_via (TosState state, address* table);
@ -113,7 +113,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
bool install_monitor_exception = true);
protected:
void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true);
void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true, bool generate_poll = false);
public:
// Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls

@ -37,6 +37,8 @@
#include "runtime/interfaceSupport.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/align.hpp"
@ -236,6 +238,20 @@ void MacroAssembler::serialize_memory(Register thread, Register tmp1, Register t
}
void MacroAssembler::safepoint_poll(Label& slow_path, bool a, Register thread_reg, Register temp_reg) {
if (SafepointMechanism::uses_thread_local_poll()) {
ldx(Address(thread_reg, Thread::polling_page_offset()), temp_reg, 0);
// Armed page has poll bit set.
and3(temp_reg, SafepointMechanism::poll_bit(), temp_reg);
br_notnull(temp_reg, a, Assembler::pn, slow_path);
} else {
AddressLiteral sync_state(SafepointSynchronize::address_of_state());
load_contents(sync_state, temp_reg);
cmp(temp_reg, SafepointSynchronize::_not_synchronized);
br(Assembler::notEqual, a, Assembler::pn, slow_path);
}
}
void MacroAssembler::enter() {
Unimplemented();

@ -986,6 +986,8 @@ public:
// Support for serializing memory accesses between threads
void serialize_memory(Register thread, Register tmp1, Register tmp2);
void safepoint_poll(Label& slow_path, bool a, Register thread_reg, Register temp_reg);
// Stack frame creation/removal
void enter();
void leave();

@ -2359,7 +2359,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// Block, if necessary, before resuming in _thread_in_Java state.
// In order for GC to work, don't clear the last_Java_sp until after blocking.
{ Label no_block;
AddressLiteral sync_state(SafepointSynchronize::address_of_state());
// Switch thread to "native transition" state before reading the synchronization state.
// This additional state is necessary because reading and testing the synchronization
@ -2382,12 +2381,10 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
__ serialize_memory(G2_thread, G1_scratch, G3_scratch);
}
}
__ load_contents(sync_state, G3_scratch);
__ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
Label L;
Address suspend_state(G2_thread, JavaThread::suspend_flags_offset());
__ br(Assembler::notEqual, false, Assembler::pn, L);
__ safepoint_poll(L, false, G2_thread, G3_scratch);
__ delayed()->ld(suspend_state, G3_scratch);
__ cmp_and_br_short(G3_scratch, 0, Assembler::equal, Assembler::pt, no_block);
__ bind(L);
@ -3118,7 +3115,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
} else {
// Make it look like we were called via the poll
// so that frame constructor always sees a valid return address
__ ld_ptr(G2_thread, in_bytes(JavaThread::saved_exception_pc_offset()), O7);
__ ld_ptr(Address(G2_thread, JavaThread::saved_exception_pc_offset()), O7);
__ sub(O7, frame::pc_return_offset, O7);
}
@ -3127,6 +3124,15 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
// setup last_Java_sp (blows G4)
__ set_last_Java_frame(SP, noreg);
Register saved_O7 = O7->after_save();
if (!cause_return && SafepointMechanism::uses_thread_local_poll()) {
// Keep a copy of the return pc in L0 to detect if it gets modified
__ mov(saved_O7, L0);
// Adjust and keep a copy of our npc saved by the signal handler
__ ld_ptr(Address(G2_thread, JavaThread::saved_exception_npc_offset()), L1);
__ sub(L1, frame::pc_return_offset, L1);
}
// call into the runtime to handle illegal instructions exception
// Do not use call_VM_leaf, because we need to make a GC map at this call site.
__ mov(G2_thread, O0);
@ -3150,6 +3156,12 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
__ ld_ptr(G2_thread, in_bytes(Thread::pending_exception_offset()), O1);
__ br_notnull_short(O1, Assembler::pn, pending);
if (!cause_return && SafepointMechanism::uses_thread_local_poll()) {
// If nobody modified our return pc then we must return to the npc which he saved in L1
__ cmp(saved_O7, L0);
__ movcc(Assembler::equal, false, Assembler::ptr_cc, L1, saved_O7);
}
RegisterSaver::restore_live_registers(masm);
// We are back the the original state on entry and ready to go.

@ -1206,7 +1206,11 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
Compile* C = ra_->C;
if(do_polling() && ra_->C->is_method_compilation()) {
st->print("SETHI #PollAddr,L0\t! Load Polling address\n\t");
if (SafepointMechanism::uses_global_page_poll()) {
st->print("SETHI #PollAddr,L0\t! Load Polling address\n\t");
} else {
st->print("LDX [R_G2 + #poll_offset],L0\t! Load local polling address\n\t");
}
st->print("LDX [L0],G0\t!Poll for Safepointing\n\t");
}
@ -1233,8 +1237,12 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
// If this does safepoint polling, then do it here
if(do_polling() && ra_->C->is_method_compilation()) {
AddressLiteral polling_page(os::get_polling_page());
__ sethi(polling_page, L0);
if (SafepointMechanism::uses_thread_local_poll()) {
__ ld_ptr(Address(G2_thread, Thread::polling_page_offset()), L0);
} else {
AddressLiteral polling_page(os::get_polling_page());
__ sethi(polling_page, L0);
}
__ relocate(relocInfo::poll_return_type);
__ ld_ptr(L0, 0, G0);
}
@ -1266,6 +1274,7 @@ const Pipeline * MachEpilogNode::pipeline() const {
}
int MachEpilogNode::safepoint_offset() const {
assert(SafepointMechanism::uses_global_page_poll(), "sanity");
assert( do_polling(), "no return for this epilog node");
return MacroAssembler::insts_for_sethi(os::get_polling_page()) * BytesPerInstWord;
}

@ -912,10 +912,8 @@ address TemplateInterpreterGenerator::generate_CRC32_update_entry() {
Label L_slow_path;
// If we need a safepoint check, generate full interpreter entry.
ExternalAddress state(SafepointSynchronize::address_of_state());
__ set(ExternalAddress(SafepointSynchronize::address_of_state()), O2);
__ set(SafepointSynchronize::_not_synchronized, O3);
__ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pt, L_slow_path);
__ safepoint_poll(L_slow_path, false, G2_thread, O2);
__ delayed()->nop();
// Load parameters
const Register crc = O0; // initial crc
@ -956,10 +954,9 @@ address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractI
Label L_slow_path;
// If we need a safepoint check, generate full interpreter entry.
ExternalAddress state(SafepointSynchronize::address_of_state());
__ set(ExternalAddress(SafepointSynchronize::address_of_state()), O2);
__ set(SafepointSynchronize::_not_synchronized, O3);
__ cmp_and_br_short(O2, O3, Assembler::notEqual, Assembler::pt, L_slow_path);
__ safepoint_poll(L_slow_path, false, G2_thread, O2);
__ delayed()->nop();
// Load parameters from the stack
const Register crc = O0; // initial crc
@ -1397,7 +1394,6 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// Block, if necessary, before resuming in _thread_in_Java state.
// In order for GC to work, don't clear the last_Java_sp until after blocking.
{ Label no_block;
AddressLiteral sync_state(SafepointSynchronize::address_of_state());
// Switch thread to "native transition" state before reading the synchronization state.
// This additional state is necessary because reading and testing the synchronization
@ -1420,11 +1416,9 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
__ serialize_memory(G2_thread, G1_scratch, G3_scratch);
}
}
__ load_contents(sync_state, G3_scratch);
__ cmp(G3_scratch, SafepointSynchronize::_not_synchronized);
Label L;
__ br(Assembler::notEqual, false, Assembler::pn, L);
__ safepoint_poll(L, false, G2_thread, G3_scratch);
__ delayed()->ld(G2_thread, JavaThread::suspend_flags_offset(), G3_scratch);
__ cmp_and_br_short(G3_scratch, 0, Assembler::equal, Assembler::pt, no_block);
__ bind(L);

@ -1499,7 +1499,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
// Push returnAddress for "ret" on stack
__ push_ptr(Otos_i);
// And away we go!
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
return;
}
@ -1607,7 +1607,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
// continue with bytecode @ target
// %%%%% Like Intel, could speed things up by moving bytecode fetch to code above,
// %%%%% and changing dispatch_next to dispatch_only
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
@ -1676,7 +1676,7 @@ void TemplateTable::ret() {
__ ld_ptr(Lmethod, Method::const_offset(), G3_scratch);
__ add(G3_scratch, Otos_i, G3_scratch);
__ add(G3_scratch, in_bytes(ConstMethod::codes_offset()), Lbcp);
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
@ -1691,7 +1691,7 @@ void TemplateTable::wide_ret() {
__ ld_ptr(Lmethod, Method::const_offset(), G3_scratch);
__ add(G3_scratch, Otos_i, G3_scratch);
__ add(G3_scratch, in_bytes(ConstMethod::codes_offset()), Lbcp);
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
@ -1727,7 +1727,7 @@ void TemplateTable::tableswitch() {
// continue execution
__ bind(continue_execution);
__ add(Lbcp, O2, Lbcp);
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
@ -1779,7 +1779,7 @@ void TemplateTable::fast_linearswitch() {
__ bind(continue_execution);
}
__ add(Lbcp, O4, Lbcp);
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
@ -1888,7 +1888,7 @@ void TemplateTable::fast_binaryswitch() {
__ bind(continue_execution);
__ add( Lbcp, Rj, Lbcp );
__ dispatch_next( vtos );
__ dispatch_next(vtos, 0, true);
}
@ -1914,6 +1914,18 @@ void TemplateTable::_return(TosState state) {
__ bind(skip_register_finalizer);
}
if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
Label no_safepoint;
__ ldx(Address(G2_thread, Thread::polling_page_offset()), G3_scratch, 0);
__ btst(SafepointMechanism::poll_bit(), G3_scratch);
__ br(Assembler::zero, false, Assembler::pt, no_safepoint);
__ delayed()->nop();
__ push(state);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint));
__ pop(state);
__ bind(no_safepoint);
}
// Narrow result if state is itos but result type is smaller.
// Need to narrow in the return bytecode rather than in generate_return_entry
// since compiled code callers expect the result to already be narrowed.

@ -526,32 +526,57 @@ void LIR_Assembler::return_op(LIR_Opr result) {
// Note: we do not need to round double result; float result has the right precision
// the poll sets the condition code, but no data registers
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
if (Assembler::is_polling_page_far()) {
__ lea(rscratch1, polling_page);
if (SafepointMechanism::uses_thread_local_poll()) {
#ifdef _LP64
__ movptr(rscratch1, Address(r15_thread, Thread::polling_page_offset()));
__ relocate(relocInfo::poll_return_type);
__ testl(rax, Address(rscratch1, 0));
#else
ShouldNotReachHere();
#endif
} else {
__ testl(rax, polling_page);
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
if (Assembler::is_polling_page_far()) {
__ lea(rscratch1, polling_page);
__ relocate(relocInfo::poll_return_type);
__ testl(rax, Address(rscratch1, 0));
} else {
__ testl(rax, polling_page);
}
}
__ ret(0);
}
int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
guarantee(info != NULL, "Shouldn't be NULL");
int offset = __ offset();
if (Assembler::is_polling_page_far()) {
__ lea(rscratch1, polling_page);
offset = __ offset();
if (SafepointMechanism::uses_thread_local_poll()) {
#ifdef _LP64
__ movptr(rscratch1, Address(r15_thread, Thread::polling_page_offset()));
add_debug_info_for_branch(info);
__ relocate(relocInfo::poll_type);
address pre_pc = __ pc();
__ testl(rax, Address(rscratch1, 0));
address post_pc = __ pc();
guarantee(pointer_delta(post_pc, pre_pc, 1) == 3, "must be exact length");
#else
ShouldNotReachHere();
#endif
} else {
add_debug_info_for_branch(info);
__ testl(rax, polling_page);
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
if (Assembler::is_polling_page_far()) {
__ lea(rscratch1, polling_page);
offset = __ offset();
add_debug_info_for_branch(info);
__ relocate(relocInfo::poll_type);
__ testl(rax, Address(rscratch1, 0));
} else {
add_debug_info_for_branch(info);
__ testl(rax, polling_page);
}
}
return offset;
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, 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
@ -65,4 +65,9 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
#define SUPPORT_RESERVED_STACK_AREA
#endif
#ifdef _LP64
// X64 have implemented the local polling
#define THREAD_LOCAL_POLL
#endif
#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP

@ -97,6 +97,12 @@ define_pd_global(bool, PreserveFramePointer, false);
define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
#ifdef _LP64
define_pd_global(bool, ThreadLocalHandshakes, true);
#else
define_pd_global(bool, ThreadLocalHandshakes, false);
#endif
#define ARCH_FLAGS(develop, \
product, \
diagnostic, \

@ -35,6 +35,7 @@
#include "prims/jvmtiThreadState.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/thread.inline.hpp"
@ -809,7 +810,8 @@ void InterpreterMacroAssembler::dispatch_epilog(TosState state, int step) {
void InterpreterMacroAssembler::dispatch_base(TosState state,
address* table,
bool verifyoop) {
bool verifyoop,
bool generate_poll) {
verify_FPU(1, state);
if (VerifyActivationFrameSize) {
Label L;
@ -827,8 +829,24 @@ void InterpreterMacroAssembler::dispatch_base(TosState state,
verify_oop(rax, state);
}
#ifdef _LP64
Label no_safepoint, dispatch;
address* const safepoint_table = Interpreter::safept_table(state);
if (SafepointMechanism::uses_thread_local_poll() && table != safepoint_table && generate_poll) {
NOT_PRODUCT(block_comment("Thread-local Safepoint poll"));
testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
jccb(Assembler::zero, no_safepoint);
lea(rscratch1, ExternalAddress((address)safepoint_table));
jmpb(dispatch);
}
bind(no_safepoint);
lea(rscratch1, ExternalAddress((address)table));
bind(dispatch);
jmp(Address(rscratch1, rbx, Address::times_8));
#else
Address index(noreg, rbx, Address::times_ptr);
ExternalAddress tbl((address)table);
@ -837,8 +855,8 @@ void InterpreterMacroAssembler::dispatch_base(TosState state,
#endif // _LP64
}
void InterpreterMacroAssembler::dispatch_only(TosState state) {
dispatch_base(state, Interpreter::dispatch_table(state));
void InterpreterMacroAssembler::dispatch_only(TosState state, bool generate_poll) {
dispatch_base(state, Interpreter::dispatch_table(state), true, generate_poll);
}
void InterpreterMacroAssembler::dispatch_only_normal(TosState state) {
@ -850,12 +868,12 @@ void InterpreterMacroAssembler::dispatch_only_noverify(TosState state) {
}
void InterpreterMacroAssembler::dispatch_next(TosState state, int step) {
void InterpreterMacroAssembler::dispatch_next(TosState state, int step, bool generate_poll) {
// load next bytecode (load before advancing _bcp_register to prevent AGI)
load_unsigned_byte(rbx, Address(_bcp_register, step));
// advance _bcp_register
increment(_bcp_register, step);
dispatch_base(state, Interpreter::dispatch_table(state));
dispatch_base(state, Interpreter::dispatch_table(state), true, generate_poll);
}
void InterpreterMacroAssembler::dispatch_via(TosState state, address* table) {

@ -49,7 +49,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
bool check_exceptions);
// base routine for all dispatches
void dispatch_base(TosState state, address* table, bool verifyoop = true);
void dispatch_base(TosState state, address* table, bool verifyoop = true, bool generate_poll = false);
public:
InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code),
@ -184,12 +184,12 @@ class InterpreterMacroAssembler: public MacroAssembler {
void dispatch_prolog(TosState state, int step = 0);
void dispatch_epilog(TosState state, int step = 0);
// dispatch via rbx (assume rbx is loaded already)
void dispatch_only(TosState state);
void dispatch_only(TosState state, bool generate_poll = false);
// dispatch normal table via rbx (assume rbx is loaded already)
void dispatch_only_normal(TosState state);
void dispatch_only_noverify(TosState state);
// load rbx from [_bcp_register + step] and dispatch via rbx
void dispatch_next(TosState state, int step = 0);
void dispatch_next(TosState state, int step = 0, bool generate_poll = false);
// load rbx from [_bcp_register] and dispatch via rbx and table
void dispatch_via (TosState state, address* table);

@ -38,6 +38,8 @@
#include "runtime/interfaceSupport.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/os.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.hpp"
@ -3759,6 +3761,25 @@ void MacroAssembler::serialize_memory(Register thread, Register tmp) {
movl(as_Address(ArrayAddress(page, index)), tmp);
}
#ifdef _LP64
void MacroAssembler::safepoint_poll(Label& slow_path, Register thread_reg, Register temp_reg) {
if (SafepointMechanism::uses_thread_local_poll()) {
testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
jcc(Assembler::notZero, slow_path); // handshake bit set implies poll
} else {
cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
SafepointSynchronize::_not_synchronized);
jcc(Assembler::notEqual, slow_path);
}
}
#else
void MacroAssembler::safepoint_poll(Label& slow_path) {
cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
SafepointSynchronize::_not_synchronized);
jcc(Assembler::notEqual, slow_path);
}
#endif
// Calls to C land
//
// When entering C land, the rbp, & rsp of the last Java frame have to be recorded

@ -656,6 +656,12 @@ class MacroAssembler: public Assembler {
// Support for serializing memory accesses between threads
void serialize_memory(Register thread, Register tmp);
#ifdef _LP64
void safepoint_poll(Label& slow_path, Register thread_reg, Register temp_reg);
#else
void safepoint_poll(Label& slow_path);
#endif
void verify_tlab();
// Biased locking support

@ -29,6 +29,7 @@
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointMechanism.hpp"
// We have interfaces for the following instructions:
// - NativeInstruction
@ -678,6 +679,7 @@ class NativeTstRegMem: public NativeInstruction {
enum Intel_specific_constants {
instruction_rex_prefix_mask = 0xF0,
instruction_rex_prefix = Assembler::REX,
instruction_rex_b_prefix = Assembler::REX_B,
instruction_code_memXregl = 0x85,
modrm_mask = 0x38, // select reg from the ModRM byte
modrm_reg = 0x00 // rax
@ -703,6 +705,16 @@ inline bool NativeInstruction::is_cond_jump() { return (int_at(0) & 0xF0FF) =
(ubyte_at(0) & 0xF0) == 0x70; /* short jump */ }
inline bool NativeInstruction::is_safepoint_poll() {
#ifdef AMD64
if (SafepointMechanism::uses_thread_local_poll()) {
// We know that the poll must have a REX_B prefix since we enforce its source to be
// a rex-register and the destination to be rax.
const bool has_rex_prefix = ubyte_at(0) == NativeTstRegMem::instruction_rex_b_prefix;
const bool is_test_opcode = ubyte_at(1) == NativeTstRegMem::instruction_code_memXregl;
const bool is_rax_target = (ubyte_at(2) & NativeTstRegMem::modrm_mask) == NativeTstRegMem::modrm_reg;
if (has_rex_prefix && is_test_opcode && is_rax_target) {
return true;
}
}
// Try decoding a near safepoint first:
if (ubyte_at(0) == NativeTstRegMem::instruction_code_memXregl &&
ubyte_at(1) == 0x05) { // 00 rax 101

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2017, 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
@ -29,6 +29,7 @@
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointMechanism.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
@ -183,9 +184,12 @@ void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffe
typedef Assembler::WhichOperand WhichOperand;
WhichOperand which = (WhichOperand) format();
#if !INCLUDE_JVMCI
assert((which == Assembler::disp32_operand) == !Assembler::is_polling_page_far(), "format not set correctly");
if (SafepointMechanism::uses_global_page_poll()) {
assert((which == Assembler::disp32_operand) == !Assembler::is_polling_page_far(), "format not set correctly");
}
#endif
if (which == Assembler::disp32_operand) {
assert(SafepointMechanism::uses_global_page_poll(), "should only have generated such a poll if global polling enabled");
address orig_addr = old_addr_for(addr(), src, dest);
NativeInstruction* oni = nativeInstruction_at(orig_addr);
int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which);

@ -30,6 +30,7 @@
#include "asm/macroAssembler.inline.hpp"
#include "code/debugInfoRec.hpp"
#include "code/icBuffer.hpp"
#include "code/nativeInst.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
@ -2474,15 +2475,13 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// check for safepoint operation in progress and/or pending suspend requests
{
Label Continue;
Label slow_path;
__ cmp32(ExternalAddress((address)SafepointSynchronize::address_of_state()),
SafepointSynchronize::_not_synchronized);
__ safepoint_poll(slow_path, r15_thread, rscratch1);
Label L;
__ jcc(Assembler::notEqual, L);
__ cmpl(Address(r15_thread, JavaThread::suspend_flags_offset()), 0);
__ jcc(Assembler::equal, Continue);
__ bind(L);
__ bind(slow_path);
// Don't use call_VM as it will see a possible pending exception and forward it
// and never return here preventing us from clearing _last_native_pc down below.
@ -3355,9 +3354,11 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
// sees an invalid pc.
if (!cause_return) {
// overwrite the dummy value we pushed on entry
__ movptr(c_rarg0, Address(r15_thread, JavaThread::saved_exception_pc_offset()));
__ movptr(Address(rbp, wordSize), c_rarg0);
// Get the return pc saved by the signal handler and stash it in its appropriate place on the stack.
// Additionally, rbx is a callee saved register and we can look at it later to determine
// if someone changed the return address for us!
__ movptr(rbx, Address(r15_thread, JavaThread::saved_exception_pc_offset()));
__ movptr(Address(rbp, wordSize), rbx);
}
// Do the call
@ -3387,11 +3388,38 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
// No exception case
__ bind(noException);
Label no_adjust, bail;
if (SafepointMechanism::uses_thread_local_poll() && !cause_return) {
// If our stashed return pc was modified by the runtime we avoid touching it
__ cmpptr(rbx, Address(rbp, wordSize));
__ jccb(Assembler::notEqual, no_adjust);
#ifdef ASSERT
// Verify the correct encoding of the poll we're about to skip.
// See NativeInstruction::is_safepoint_poll()
__ cmpb(Address(rbx, 0), NativeTstRegMem::instruction_rex_b_prefix);
__ jcc(Assembler::notEqual, bail);
__ cmpb(Address(rbx, 1), NativeTstRegMem::instruction_code_memXregl);
__ jcc(Assembler::notEqual, bail);
// Mask out the modrm bits
__ testb(Address(rbx, 2), NativeTstRegMem::modrm_mask);
// rax encodes to 0, so if the bits are nonzero it's incorrect
__ jcc(Assembler::notZero, bail);
#endif
// Adjust return pc forward to step over the safepoint poll instruction
__ addptr(Address(rbp, wordSize), 3);
}
__ bind(no_adjust);
// Normal exit, restore registers and exit.
RegisterSaver::restore_live_registers(masm, save_vectors);
__ ret(0);
#ifdef ASSERT
__ bind(bail);
__ stop("Attempting to adjust pc to skip safepoint poll but the return point is not what we expected");
#endif
// Make sure all code is generated
masm->flush();

@ -1141,14 +1141,17 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// check for safepoint operation in progress and/or pending suspend requests
{
Label Continue;
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
SafepointSynchronize::_not_synchronized);
Label slow_path;
#ifndef _LP64
__ safepoint_poll(slow_path);
#else
__ safepoint_poll(slow_path, r15_thread, rscratch1);
#endif
Label L;
__ jcc(Assembler::notEqual, L);
__ cmpl(Address(thread, JavaThread::suspend_flags_offset()), 0);
__ jcc(Assembler::equal, Continue);
__ bind(L);
__ bind(slow_path);
// Don't use call_VM as it will see a possible pending exception
// and forward it and never return here preventing us from

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2017, 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
@ -190,11 +190,7 @@ address TemplateInterpreterGenerator::generate_CRC32_update_entry() {
// c_rarg1: scratch (rsi on non-Win64, rdx on Win64)
Label slow_path;
// If we need a safepoint check, generate full interpreter entry.
ExternalAddress state(SafepointSynchronize::address_of_state());
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
SafepointSynchronize::_not_synchronized);
__ jcc(Assembler::notEqual, slow_path);
__ safepoint_poll(slow_path, r15_thread, rscratch1);
// We don't generate local frame and don't align stack because
// we call stub code and there is no safepoint on this path.
@ -240,11 +236,7 @@ address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractI
// r13: senderSP must preserved for slow path, set SP to it on fast path
Label slow_path;
// If we need a safepoint check, generate full interpreter entry.
ExternalAddress state(SafepointSynchronize::address_of_state());
__ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
SafepointSynchronize::_not_synchronized);
__ jcc(Assembler::notEqual, slow_path);
__ safepoint_poll(slow_path, r15_thread, rscratch1);
// We don't generate local frame and don't align stack because
// we call stub code and there is no safepoint on this path.

@ -2084,7 +2084,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
__ addptr(rbcp, rdx);
// jsr returns atos that is not an oop
__ push_i(rax);
__ dispatch_only(vtos);
__ dispatch_only(vtos, true);
return;
}
@ -2203,7 +2203,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
// rax: return bci for jsr's, unused otherwise
// rbx: target bytecode
// r13: target bcp
__ dispatch_only(vtos);
__ dispatch_only(vtos, true);
if (UseLoopCounter) {
if (ProfileInterpreter) {
@ -2332,7 +2332,7 @@ void TemplateTable::ret() {
__ movptr(rbcp, Address(rax, Method::const_offset()));
__ lea(rbcp, Address(rbcp, rbx, Address::times_1,
ConstMethod::codes_offset()));
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
void TemplateTable::wide_ret() {
@ -2343,7 +2343,7 @@ void TemplateTable::wide_ret() {
__ get_method(rax);
__ movptr(rbcp, Address(rax, Method::const_offset()));
__ lea(rbcp, Address(rbcp, rbx, Address::times_1, ConstMethod::codes_offset()));
__ dispatch_next(vtos);
__ dispatch_next(vtos, 0, true);
}
void TemplateTable::tableswitch() {
@ -2373,7 +2373,7 @@ void TemplateTable::tableswitch() {
LP64_ONLY(__ movl2ptr(rdx, rdx));
__ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1));
__ addptr(rbcp, rdx);
__ dispatch_only(vtos);
__ dispatch_only(vtos, true);
// handle default
__ bind(default_case);
__ profile_switch_default(rax);
@ -2421,7 +2421,7 @@ void TemplateTable::fast_linearswitch() {
__ movl2ptr(rdx, rdx);
__ load_unsigned_byte(rbx, Address(rbcp, rdx, Address::times_1));
__ addptr(rbcp, rdx);
__ dispatch_only(vtos);
__ dispatch_only(vtos, true);
}
void TemplateTable::fast_binaryswitch() {
@ -2525,7 +2525,7 @@ void TemplateTable::fast_binaryswitch() {
__ load_unsigned_byte(rbx, Address(rbcp, j, Address::times_1));
__ addptr(rbcp, j);
__ dispatch_only(vtos);
__ dispatch_only(vtos, true);
// default case -> j = default offset
__ bind(default_case);
@ -2539,7 +2539,7 @@ void TemplateTable::fast_binaryswitch() {
__ load_unsigned_byte(rbx, Address(rbcp, j, Address::times_1));
__ addptr(rbcp, j);
__ dispatch_only(vtos);
__ dispatch_only(vtos, true);
}
void TemplateTable::_return(TosState state) {
@ -2570,6 +2570,20 @@ void TemplateTable::_return(TosState state) {
}
#endif
#ifdef _LP64
if (SafepointMechanism::uses_thread_local_poll() && _desc->bytecode() != Bytecodes::_return_register_finalizer) {
Label no_safepoint;
NOT_PRODUCT(__ block_comment("Thread-local Safepoint poll"));
__ testb(Address(r15_thread, Thread::polling_page_offset()), SafepointMechanism::poll_bit());
__ jcc(Assembler::zero, no_safepoint);
__ push(state);
__ call_VM(noreg, CAST_FROM_FN_PTR(address,
InterpreterRuntime::at_safepoint));
__ pop(state);
__ bind(no_safepoint);
}
#endif
// Narrow result if state is itos but result type is smaller.
// Need to narrow in the return bytecode rather than in generate_return_entry
// since compiled code callers expect the result to already be narrowed.

@ -317,6 +317,18 @@ reg_class ptr_rsp_reg(RSP, RSP_H);
// Singleton class for TLS pointer
reg_class ptr_r15_reg(R15, R15_H);
// The registers which can be used for
// a thread local safepoint poll
// * R12 is reserved for heap base
// * R13 cannot be encoded for addressing without an offset byte
// * R15 is reserved for the JavaThread
reg_class ptr_rex_reg(R8, R8_H,
R9, R9_H,
R10, R10_H,
R11, R11_H,
R14, R14_H);
// Class for all long registers (excluding RSP)
reg_class long_reg_with_rbp(RAX, RAX_H,
RDX, RDX_H,
@ -566,7 +578,7 @@ int MachCallRuntimeNode::ret_addr_offset() {
// it does if the polling page is more than disp32 away.
bool SafePointNode::needs_polling_address_input()
{
return Assembler::is_polling_page_far();
return SafepointMechanism::uses_thread_local_poll() || Assembler::is_polling_page_far();
}
//
@ -938,7 +950,11 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const
st->print_cr("popq rbp");
if (do_polling() && C->is_method_compilation()) {
st->print("\t");
if (Assembler::is_polling_page_far()) {
if (SafepointMechanism::uses_thread_local_poll()) {
st->print_cr("movq rscratch1, poll_offset[r15_thread] #polling_page_address\n\t"
"testl rax, [rscratch1]\t"
"# Safepoint: poll for GC");
} else if (Assembler::is_polling_page_far()) {
st->print_cr("movq rscratch1, #polling_page_address\n\t"
"testl rax, [rscratch1]\t"
"# Safepoint: poll for GC");
@ -989,13 +1005,19 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
if (do_polling() && C->is_method_compilation()) {
MacroAssembler _masm(&cbuf);
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
if (Assembler::is_polling_page_far()) {
__ lea(rscratch1, polling_page);
if (SafepointMechanism::uses_thread_local_poll()) {
__ movq(rscratch1, Address(r15_thread, Thread::polling_page_offset()));
__ relocate(relocInfo::poll_return_type);
__ testl(rax, Address(rscratch1, 0));
} else {
__ testl(rax, polling_page);
AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
if (Assembler::is_polling_page_far()) {
__ lea(rscratch1, polling_page);
__ relocate(relocInfo::poll_return_type);
__ testl(rax, Address(rscratch1, 0));
} else {
__ testl(rax, polling_page);
}
}
}
}
@ -3511,6 +3533,16 @@ operand r15_RegP()
interface(REG_INTER);
%}
operand rex_RegP()
%{
constraint(ALLOC_IN_RC(ptr_rex_reg));
match(RegP);
match(rRegP);
format %{ %}
interface(REG_INTER);
%}
operand rRegL()
%{
constraint(ALLOC_IN_RC(long_reg));
@ -12060,7 +12092,7 @@ instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
// Safepoint Instructions
instruct safePoint_poll(rFlagsReg cr)
%{
predicate(!Assembler::is_polling_page_far());
predicate(!Assembler::is_polling_page_far() && SafepointMechanism::uses_global_page_poll());
match(SafePoint);
effect(KILL cr);
@ -12076,7 +12108,7 @@ instruct safePoint_poll(rFlagsReg cr)
instruct safePoint_poll_far(rFlagsReg cr, rRegP poll)
%{
predicate(Assembler::is_polling_page_far());
predicate(Assembler::is_polling_page_far() && SafepointMechanism::uses_global_page_poll());
match(SafePoint poll);
effect(KILL cr, USE poll);
@ -12090,6 +12122,26 @@ instruct safePoint_poll_far(rFlagsReg cr, rRegP poll)
ins_pipe(ialu_reg_mem);
%}
instruct safePoint_poll_tls(rFlagsReg cr, rex_RegP poll)
%{
predicate(SafepointMechanism::uses_thread_local_poll());
match(SafePoint poll);
effect(KILL cr, USE poll);
format %{ "testl rax, [$poll]\t"
"# Safepoint: poll for GC" %}
ins_cost(125);
size(3); /* setting an explicit size will cause debug builds to assert if size is incorrect */
ins_encode %{
__ relocate(relocInfo::poll_type);
address pre_pc = __ pc();
__ testl(rax, Address($poll$$Register, 0));
address post_pc = __ pc();
guarantee(pre_pc[0] == 0x41 && pre_pc[1] == 0x85, "must emit #rex test-ax [reg]");
%}
ins_pipe(ialu_reg_mem);
%}
// ============================================================================
// Procedure Call/Return Instructions
// Call Java Static Instruction

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -81,6 +81,8 @@ define_pd_global(bool, PreserveFramePointer, false);
// No performance work done here yet.
define_pd_global(bool, CompactStrings, false);
define_pd_global(bool, ThreadLocalHandshakes, false);
#define ARCH_FLAGS(develop, \
product, \
diagnostic, \

@ -3477,75 +3477,6 @@ jint os::init_2(void) {
LoadedLibraries::print(tty);
}
const int page_size = Aix::page_size();
const int map_size = page_size;
address map_address = (address) MAP_FAILED;
const int prot = PROT_READ;
const int flags = MAP_PRIVATE|MAP_ANONYMOUS;
// Use optimized addresses for the polling page,
// e.g. map it to a special 32-bit address.
if (OptimizePollingPageLocation) {
// architecture-specific list of address wishes:
address address_wishes[] = {
// AIX: addresses lower than 0x30000000 don't seem to work on AIX.
// PPC64: all address wishes are non-negative 32 bit values where
// the lower 16 bits are all zero. we can load these addresses
// with a single ppc_lis instruction.
(address) 0x30000000, (address) 0x31000000,
(address) 0x32000000, (address) 0x33000000,
(address) 0x40000000, (address) 0x41000000,
(address) 0x42000000, (address) 0x43000000,
(address) 0x50000000, (address) 0x51000000,
(address) 0x52000000, (address) 0x53000000,
(address) 0x60000000, (address) 0x61000000,
(address) 0x62000000, (address) 0x63000000
};
int address_wishes_length = sizeof(address_wishes)/sizeof(address);
// iterate over the list of address wishes:
for (int i=0; i<address_wishes_length; i++) {
// Try to map with current address wish.
// AIX: AIX needs MAP_FIXED if we provide an address and mmap will
// fail if the address is already mapped.
map_address = (address) ::mmap(address_wishes[i] - (ssize_t)page_size,
map_size, prot,
flags | MAP_FIXED,
-1, 0);
trcVerbose("SafePoint Polling Page address: %p (wish) => %p",
address_wishes[i], map_address + (ssize_t)page_size);
if (map_address + (ssize_t)page_size == address_wishes[i]) {
// Map succeeded and map_address is at wished address, exit loop.
break;
}
if (map_address != (address) MAP_FAILED) {
// Map succeeded, but polling_page is not at wished address, unmap and continue.
::munmap(map_address, map_size);
map_address = (address) MAP_FAILED;
}
// Map failed, continue loop.
}
} // end OptimizePollingPageLocation
if (map_address == (address) MAP_FAILED) {
map_address = (address) ::mmap(NULL, map_size, prot, flags, -1, 0);
}
guarantee(map_address != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page(map_address);
if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Aix::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(mem_serialize_page != NULL, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
trcVerbose("Memory Serialize Page address: %p - %p, size %IX (%IB)",
mem_serialize_page, mem_serialize_page + Aix::page_size(),
Aix::page_size(), Aix::page_size());
}
// initialize suspend/resume support - must do this before signal_sets_init()
if (SR_initialize() != 0) {
perror("SR_initialize failed");

@ -0,0 +1,85 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/globals.hpp"
#include "runtime/os.hpp"
#include "runtime/safepointMechanism.hpp"
#include <sys/mman.h>
void SafepointMechanism::pd_initialize() {
char* map_address = (char*)MAP_FAILED;
const size_t page_size = os::vm_page_size();
// Use optimized addresses for the polling page,
// e.g. map it to a special 32-bit address.
if (OptimizePollingPageLocation) {
// architecture-specific list of address wishes:
char* address_wishes[] = {
// AIX: addresses lower than 0x30000000 don't seem to work on AIX.
// PPC64: all address wishes are non-negative 32 bit values where
// the lower 16 bits are all zero. we can load these addresses
// with a single ppc_lis instruction.
(char*) 0x30000000, (char*) 0x31000000,
(char*) 0x32000000, (char*) 0x33000000,
(char*) 0x40000000, (char*) 0x41000000,
(char*) 0x42000000, (char*) 0x43000000,
(char*) 0x50000000, (char*) 0x51000000,
(char*) 0x52000000, (char*) 0x53000000,
(char*) 0x60000000, (char*) 0x61000000,
(char*) 0x62000000, (char*) 0x63000000
};
int address_wishes_length = sizeof(address_wishes)/sizeof(char*);
// iterate over the list of address wishes:
for (int i = 0; i < address_wishes_length; i++) {
// Try to map with current address wish.
// AIX: AIX needs MAP_FIXED if we provide an address and mmap will
// fail if the address is already mapped.
map_address = (char*) ::mmap(address_wishes[i] - (ssize_t)page_size,
page_size, PROT_READ,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
-1, 0);
log_debug(os)("SafePoint Polling Page address: %p (wish) => %p",
address_wishes[i], map_address + (ssize_t)page_size);
if (map_address + (ssize_t)page_size == address_wishes[i]) {
// Map succeeded and map_address is at wished address, exit loop.
break;
}
if (map_address != (char*)MAP_FAILED) {
// Map succeeded, but polling_page is not at wished address, unmap and continue.
::munmap(map_address, page_size);
map_address = (char*)MAP_FAILED;
}
// Map failed, continue loop.
}
}
if (map_address == (char*)MAP_FAILED) {
map_address = os::reserve_memory(page_size, NULL, page_size);
}
guarantee(map_address != (char*)MAP_FAILED, "SafepointMechanism::pd_initialize: failed to allocate polling page");
os::set_polling_page((address)(map_address));
}

@ -3391,20 +3391,6 @@ jint os::init_2(void) {
os::Posix::init_2();
// Allocate a single page and mark it as readable for safepoint polling
address polling_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
}
// initialize suspend/resume support - must do this before signal_sets_init()
if (SR_initialize() != 0) {
perror("SR_initialize failed");

@ -4805,20 +4805,6 @@ jint os::init_2(void) {
Linux::fast_thread_clock_init();
// Allocate a single page and mark it as readable for safepoint polling
address polling_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
}
// initialize suspend/resume support - must do this before signal_sets_init()
if (SR_initialize() != 0) {
perror("SR_initialize failed");

@ -2190,10 +2190,6 @@ int os::signal_wait() {
static int page_size = -1;
// The mmap MAP_ALIGN flag is supported on Solaris 9 and later. init_2() will
// clear this var if support is not available.
static bool has_map_align = true;
int os::vm_page_size() {
assert(page_size != -1, "must call os::init");
return page_size;
@ -2560,7 +2556,7 @@ char* os::Solaris::anon_mmap(char* requested_addr, size_t bytes,
if (fixed) {
flags |= MAP_FIXED;
} else if (has_map_align && (alignment_hint > (size_t) vm_page_size())) {
} else if (alignment_hint > (size_t) vm_page_size()) {
flags |= MAP_ALIGN;
addr = (char*) alignment_hint;
}
@ -4222,28 +4218,6 @@ jint os::init_2(void) {
// try to enable extended file IO ASAP, see 6431278
os::Solaris::try_enable_extended_io();
// Allocate a single page and mark it as readable for safepoint polling. Also
// use this first mmap call to check support for MAP_ALIGN.
address polling_page = (address)Solaris::mmap_chunk((char*)page_size,
page_size,
MAP_PRIVATE | MAP_ALIGN,
PROT_READ);
if (polling_page == NULL) {
has_map_align = false;
polling_page = (address)Solaris::mmap_chunk(NULL, page_size, MAP_PRIVATE,
PROT_READ);
}
os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
if (!UseMembar) {
address mem_serialize_page = (address)Solaris::mmap_chunk(NULL, page_size, MAP_PRIVATE, PROT_READ | PROT_WRITE);
guarantee(mem_serialize_page != NULL, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
}
// Check and sets minimum stack sizes against command line options
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
return JNI_ERR;

@ -2487,6 +2487,20 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
} // /EXCEPTION_ACCESS_VIOLATION
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (exception_code == EXCEPTION_IN_PAGE_ERROR) {
CompiledMethod* nm = NULL;
JavaThread* thread = (JavaThread*)t;
if (in_java) {
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
}
if ((thread->thread_state() == _thread_in_vm &&
thread->doing_unsafe_access()) ||
(nm != NULL && nm->has_unsafe_access())) {
return Handle_Exception(exceptionInfo, SharedRuntime::handle_unsafe_access(thread, (address)Assembler::locate_next_instruction(pc)));
}
}
if (in_java) {
switch (exception_code) {
case EXCEPTION_INT_DIVIDE_BY_ZERO:
@ -3911,27 +3925,6 @@ static jint initSock();
// this is called _after_ the global arguments have been parsed
jint os::init_2(void) {
// Allocate a single page and mark it as readable for safepoint polling
address polling_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READONLY);
guarantee(polling_page != NULL, "Reserve Failed for polling page");
address return_page = (address)VirtualAlloc(polling_page, os::vm_page_size(), MEM_COMMIT, PAGE_READONLY);
guarantee(return_page != NULL, "Commit Failed for polling page");
os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
if (!UseMembar) {
address mem_serialize_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READWRITE);
guarantee(mem_serialize_page != NULL, "Reserve Failed for memory serialize page");
return_page = (address)VirtualAlloc(mem_serialize_page, os::vm_page_size(), MEM_COMMIT, PAGE_READWRITE);
guarantee(return_page != NULL, "Commit Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
}
// Setup Windows Exceptions
// for debugging float code generation bugs

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2017, 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
@ -68,7 +68,7 @@ public:
address o_reg_temps(int i) { return (address)&_o_reg_temps[i]; }
#endif
static int saved_exception_npc_offset_in_bytes() { return offset_of(JavaThread,_saved_exception_npc); }
static ByteSize saved_exception_npc_offset() { return byte_offset_of(JavaThread,_saved_exception_npc); }
address saved_exception_npc() { return _saved_exception_npc; }
void set_saved_exception_npc(address a) { _saved_exception_npc = a; }

@ -447,7 +447,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
// a fault inside compiled code, the interpreter, or a stub
// Support Safepoint Polling
if ( sig == SIGSEGV && (address)info->si_addr == os::get_polling_page() ) {
if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
stub = SharedRuntime::get_poll_stub(pc);
}

@ -63,7 +63,7 @@ public:
static int o_reg_temps_offset_in_bytes() { return offset_of(JavaThread, _o_reg_temps); }
static int saved_exception_npc_offset_in_bytes() { return offset_of(JavaThread,_saved_exception_npc); }
static ByteSize saved_exception_npc_offset() { return byte_offset_of(JavaThread,_saved_exception_npc); }
address saved_exception_npc() { return _saved_exception_npc; }
void set_saved_exception_npc(address a) { _saved_exception_npc = a; }

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, 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
@ -187,10 +187,6 @@ private:
}
}
void ensure_metadata_alive(ciMetadata* m) {
_factory->ensure_metadata_alive(m);
}
ciInstance* get_instance(oop o) {
if (o == NULL) return NULL;
return get_object(o)->as_instance();

@ -34,12 +34,36 @@
#include "oops/oop.inline.hpp"
#include "oops/fieldStreams.hpp"
#include "runtime/fieldDescriptor.hpp"
#if INCLUDE_ALL_GCS
# include "gc/g1/g1SATBCardTableModRefBS.hpp"
#endif
// ciInstanceKlass
//
// This class represents a Klass* in the HotSpot virtual machine
// whose Klass part in an InstanceKlass.
// ------------------------------------------------------------------
// ensure_metadata_alive
//
// Ensure that the metadata wrapped by the ciMetadata is kept alive by GC.
// This is primarily useful for metadata which is considered as weak roots
// by the GC but need to be strong roots if reachable from a current compilation.
// InstanceKlass are created for both weak and strong metadata. Ensuring this metadata
// alive covers the cases where there are weak roots without performance cost.
//
static void ensure_metadata_alive(oop metadata_holder) {
#if INCLUDE_ALL_GCS
if (!UseG1GC) {
return;
}
if (metadata_holder != NULL) {
G1SATBCardTableModRefBS::enqueue(metadata_holder);
}
#endif
}
// ------------------------------------------------------------------
// ciInstanceKlass::ciInstanceKlass
//
@ -64,6 +88,18 @@ ciInstanceKlass::ciInstanceKlass(Klass* k) :
_has_injected_fields = -1;
_implementor = NULL; // we will fill these lazily
oop holder = ik->klass_holder();
ensure_metadata_alive(holder);
if (ik->is_anonymous()) {
// Though ciInstanceKlass records class loader oop, it's not enough to keep
// VM anonymous classes alive (loader == NULL). Klass holder should be used instead.
// It is enough to record a ciObject, since cached elements are never removed
// during ciObjectFactory lifetime. ciObjectFactory itself is created for
// every compilation and lives for the whole duration of the compilation.
assert(holder != NULL, "holder of anonymous class is the mirror which is never null");
(void)CURRENT_ENV->get_object(holder);
}
Thread *thread = Thread::current();
if (ciObjectFactory::is_initialized()) {
_loader = JNIHandles::make_local(thread, ik->class_loader());

@ -188,7 +188,6 @@ void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
Klass* k = data->as_ReceiverTypeData()->receiver(row);
if (k != NULL) {
ciKlass* klass = CURRENT_ENV->get_klass(k);
CURRENT_ENV->ensure_metadata_alive(klass);
set_receiver(row, klass);
}
}
@ -210,7 +209,6 @@ void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) {
void ciSpeculativeTrapData::translate_from(const ProfileData* data) {
Method* m = data->as_SpeculativeTrapData()->method();
ciMethod* ci_m = CURRENT_ENV->get_method(m);
CURRENT_ENV->ensure_metadata_alive(ci_m);
set_method(ci_m);
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2017, 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
@ -70,7 +70,6 @@ protected:
Klass* v = TypeEntries::valid_klass(k);
if (v != NULL) {
ciKlass* klass = CURRENT_ENV->get_klass(v);
CURRENT_ENV->ensure_metadata_alive(klass);
return with_status(klass, k);
}
return with_status(NULL, k);

@ -47,9 +47,6 @@
#include "oops/oop.inline.hpp"
#include "runtime/fieldType.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
# include "gc/g1/g1SATBCardTableModRefBS.hpp"
#endif
// ciObjectFactory
//
@ -363,19 +360,6 @@ ciObject* ciObjectFactory::create_new_object(oop o) {
ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
EXCEPTION_CONTEXT;
// Hold metadata from unloading by keeping it's holder alive.
if (_initialized && o->is_klass()) {
Klass* holder = ((Klass*)o);
if (holder->is_instance_klass() && InstanceKlass::cast(holder)->is_anonymous()) {
// Though ciInstanceKlass records class loader oop, it's not enough to keep
// VM anonymous classes alive (loader == NULL). Klass holder should be used instead.
// It is enough to record a ciObject, since cached elements are never removed
// during ciObjectFactory lifetime. ciObjectFactory itself is created for
// every compilation and lives for the whole duration of the compilation.
ciObject* h = get(holder->klass_holder());
}
}
if (o->is_klass()) {
Klass* k = (Klass*)o;
if (k->is_instance_klass()) {
@ -401,38 +385,6 @@ ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
return NULL;
}
// ------------------------------------------------------------------
// ciObjectFactory::ensure_metadata_alive
//
// Ensure that the metadata wrapped by the ciMetadata is kept alive by GC.
// This is primarily useful for metadata which is considered as weak roots
// by the GC but need to be strong roots if reachable from a current compilation.
//
void ciObjectFactory::ensure_metadata_alive(ciMetadata* m) {
ASSERT_IN_VM; // We're handling raw oops here.
#if INCLUDE_ALL_GCS
if (!UseG1GC) {
return;
}
Klass* metadata_owner_klass;
if (m->is_klass()) {
metadata_owner_klass = m->as_klass()->get_Klass();
} else if (m->is_method()) {
metadata_owner_klass = m->as_method()->get_Method()->constants()->pool_holder();
} else {
fatal("Not implemented for other types of metadata");
return;
}
oop metadata_holder = metadata_owner_klass->klass_holder();
if (metadata_holder != NULL) {
G1SATBCardTableModRefBS::enqueue(metadata_holder);
}
#endif
}
//------------------------------------------------------------------
// ciObjectFactory::get_unloaded_method
//

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2017, 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
@ -73,8 +73,6 @@ private:
ciObject* create_new_object(oop o);
ciMetadata* create_new_metadata(Metadata* o);
void ensure_metadata_alive(ciMetadata* m);
static bool is_equal(NonPermObject* p, oop key) {
return p->object()->get_oop() == key;
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2017, 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
@ -247,8 +247,8 @@ public:
_g1(G1CollectedHeap::heap()), _hrclaimer(n_workers) {}
void work(uint worker_id) {
ParKnownGarbageHRClosure parKnownGarbageCl(_hrSorted, _chunk_size);
_g1->heap_region_par_iterate(&parKnownGarbageCl, worker_id, &_hrclaimer);
ParKnownGarbageHRClosure par_known_garbage_cl(_hrSorted, _chunk_size);
_g1->heap_region_par_iterate_from_worker_offset(&par_known_garbage_cl, &_hrclaimer, worker_id);
}
};

@ -314,7 +314,7 @@ public:
G1CollectedHeap* g1h = G1CollectedHeap::heap();
G1ConcurrentMark* cm = g1h->concurrent_mark();
G1CreateLiveDataClosure cl(g1h, cm, cm->next_mark_bitmap(), _live_data);
g1h->heap_region_par_iterate(&cl, worker_id, &_hr_claimer);
g1h->heap_region_par_iterate_from_worker_offset(&cl, &_hr_claimer, worker_id);
}
};
@ -381,7 +381,7 @@ public:
void work(uint worker_id) {
G1FinalizeCardLiveDataClosure cl(G1CollectedHeap::heap(), _bitmap, _live_data);
G1CollectedHeap::heap()->heap_region_par_iterate(&cl, worker_id, &_hr_claimer);
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&cl, &_hr_claimer, worker_id);
}
};
@ -560,7 +560,7 @@ public:
_mark_bitmap,
_act_live_data,
&_exp_live_data);
_g1h->heap_region_par_iterate(&cl, worker_id, &_hr_claimer);
_g1h->heap_region_par_iterate_from_worker_offset(&cl, &_hr_claimer, worker_id);
Atomic::add(cl.failures(), &_failures);
}

@ -38,6 +38,7 @@
#include "gc/g1/g1ConcurrentRefine.hpp"
#include "gc/g1/g1ConcurrentRefineThread.hpp"
#include "gc/g1/g1EvacStats.inline.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
#include "gc/g1/g1HeapSizingPolicy.hpp"
@ -48,10 +49,9 @@
#include "gc/g1/g1ParScanThreadState.inline.hpp"
#include "gc/g1/g1Policy.hpp"
#include "gc/g1/g1RegionToSpaceMapper.hpp"
#include "gc/g1/g1RemSet.inline.hpp"
#include "gc/g1/g1RemSet.hpp"
#include "gc/g1/g1RootClosures.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/g1SerialFullCollector.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/g1YCTypes.hpp"
#include "gc/g1/g1YoungRemSetSamplingThread.hpp"
@ -143,6 +143,12 @@ void G1RegionMappingChangedListener::on_commit(uint start_idx, size_t num_region
reset_from_card_cache(start_idx, num_regions);
}
HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index,
MemRegion mr) {
return new HeapRegion(hrs_index, bot(), mr);
}
// Private methods.
HeapRegion*
@ -1155,7 +1161,6 @@ void G1CollectedHeap::prepare_heap_for_mutators() {
void G1CollectedHeap::abort_refinement() {
if (_hot_card_cache->use_cache()) {
_hot_card_cache->reset_card_counts();
_hot_card_cache->reset_hot_cache();
}
@ -1199,6 +1204,10 @@ void G1CollectedHeap::verify_after_full_collection() {
}
void G1CollectedHeap::print_heap_after_full_collection(G1HeapTransition* heap_transition) {
// Post collection logging.
// We should do this after we potentially resize the heap so
// that all the COMMIT / UNCOMMIT events are generated before
// the compaction events.
print_hrm_post_compaction();
heap_transition->print();
print_heap_after_gc();
@ -1221,23 +1230,18 @@ void G1CollectedHeap::do_full_collection_inner(G1FullGCScope* scope) {
gc_prologue(true);
prepare_heap_for_full_collection();
G1SerialFullCollector serial(scope, ref_processor_stw());
serial.prepare_collection();
serial.collect();
serial.complete_collection();
G1FullCollector collector(scope, ref_processor_stw(), concurrent_mark()->next_mark_bitmap(), workers()->active_workers());
collector.prepare_collection();
collector.collect();
collector.complete_collection();
prepare_heap_for_mutators();
g1_policy()->record_full_collection_end();
gc_epilogue(true);
// Post collection verification.
verify_after_full_collection();
// Post collection logging.
// We should do this after we potentially resize the heap so
// that all the COMMIT / UNCOMMIT events are generated before
// the compaction events.
print_heap_after_full_collection(scope->heap_transition());
}
@ -1269,10 +1273,10 @@ void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) {
}
void G1CollectedHeap::resize_if_necessary_after_full_collection() {
// Include bytes that will be pre-allocated to support collections, as "used".
const size_t used_after_gc = used();
// Capacity, free and used after the GC counted as full regions to
// include the waste in the following calculations.
const size_t capacity_after_gc = capacity();
const size_t free_after_gc = capacity_after_gc - used_after_gc;
const size_t used_after_gc = capacity_after_gc - unused_committed_regions_in_bytes();
// This is enforced in arguments.cpp.
assert(MinHeapFreeRatio <= MaxHeapFreeRatio,
@ -1326,8 +1330,9 @@ void G1CollectedHeap::resize_if_necessary_after_full_collection() {
size_t expand_bytes = minimum_desired_capacity - capacity_after_gc;
log_debug(gc, ergo, heap)("Attempt heap expansion (capacity lower than min desired capacity after Full GC). "
"Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)",
capacity_after_gc, used_after_gc, minimum_desired_capacity, MinHeapFreeRatio);
"Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B live: " SIZE_FORMAT "B "
"min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)",
capacity_after_gc, used_after_gc, used(), minimum_desired_capacity, MinHeapFreeRatio);
expand(expand_bytes, _workers);
@ -1337,8 +1342,9 @@ void G1CollectedHeap::resize_if_necessary_after_full_collection() {
size_t shrink_bytes = capacity_after_gc - maximum_desired_capacity;
log_debug(gc, ergo, heap)("Attempt heap shrinking (capacity higher than max desired capacity after Full GC). "
"Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)",
capacity_after_gc, used_after_gc, minimum_desired_capacity, MinHeapFreeRatio);
"Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B live: " SIZE_FORMAT "B "
"maximum_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)",
capacity_after_gc, used_after_gc, used(), maximum_desired_capacity, MaxHeapFreeRatio);
shrink(shrink_bytes);
}
@ -1959,6 +1965,10 @@ size_t G1CollectedHeap::capacity() const {
return _hrm.length() * HeapRegion::GrainBytes;
}
size_t G1CollectedHeap::unused_committed_regions_in_bytes() const {
return _hrm.total_free_bytes();
}
void G1CollectedHeap::reset_gc_time_stamps(HeapRegion* hr) {
hr->reset_gc_time_stamp();
}
@ -2262,10 +2272,15 @@ void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
_hrm.iterate(cl);
}
void G1CollectedHeap::heap_region_par_iterate(HeapRegionClosure* cl,
uint worker_id,
HeapRegionClaimer *hrclaimer) const {
_hrm.par_iterate(cl, worker_id, hrclaimer);
void G1CollectedHeap::heap_region_par_iterate_from_worker_offset(HeapRegionClosure* cl,
HeapRegionClaimer *hrclaimer,
uint worker_id) const {
_hrm.par_iterate(cl, hrclaimer, hrclaimer->offset_for_worker(worker_id));
}
void G1CollectedHeap::heap_region_par_iterate_from_start(HeapRegionClosure* cl,
HeapRegionClaimer *hrclaimer) const {
_hrm.par_iterate(cl, hrclaimer, 0);
}
void G1CollectedHeap::collection_set_iterate(HeapRegionClosure* cl) {
@ -2276,14 +2291,6 @@ void G1CollectedHeap::collection_set_iterate_from(HeapRegionClosure *cl, uint wo
_collection_set.iterate_from(cl, worker_id, workers()->active_workers());
}
HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const {
HeapRegion* result = _hrm.next_region_in_heap(from);
while (result != NULL && result->is_pinned()) {
result = _hrm.next_region_in_heap(result);
}
return result;
}
HeapWord* G1CollectedHeap::block_start(const void* addr) const {
HeapRegion* hr = heap_region_containing(addr);
return hr->block_start(addr);
@ -2375,7 +2382,7 @@ bool G1CollectedHeap::is_obj_dead_cond(const oop obj,
switch (vo) {
case VerifyOption_G1UsePrevMarking: return is_obj_dead(obj, hr);
case VerifyOption_G1UseNextMarking: return is_obj_ill(obj, hr);
case VerifyOption_G1UseMarkWord: return !obj->is_gc_marked() && !hr->is_archive();
case VerifyOption_G1UseFullMarking: return is_obj_dead_full(obj, hr);
default: ShouldNotReachHere();
}
return false; // keep some compilers happy
@ -2386,10 +2393,7 @@ bool G1CollectedHeap::is_obj_dead_cond(const oop obj,
switch (vo) {
case VerifyOption_G1UsePrevMarking: return is_obj_dead(obj);
case VerifyOption_G1UseNextMarking: return is_obj_ill(obj);
case VerifyOption_G1UseMarkWord: {
HeapRegion* hr = _hrm.addr_to_region((HeapWord*)obj);
return !obj->is_gc_marked() && !hr->is_archive();
}
case VerifyOption_G1UseFullMarking: return is_obj_dead_full(obj);
default: ShouldNotReachHere();
}
return false; // keep some compilers happy

@ -1046,6 +1046,7 @@ public:
// The Concurrent Marking reference processor...
ReferenceProcessor* ref_processor_cm() const { return _ref_processor_cm; }
size_t unused_committed_regions_in_bytes() const;
virtual size_t capacity() const;
virtual size_t used() const;
// This should be called when we're not holding the heap lock. The
@ -1181,6 +1182,8 @@ public:
return barrier_set_cast<G1SATBCardTableLoggingModRefBS>(barrier_set());
}
G1HotCardCache* g1_hot_card_cache() const { return _hot_card_cache; }
// Iteration functions.
// Iterate over all objects, calling "cl.do_object" on each.
@ -1207,15 +1210,18 @@ public:
inline HeapWord* bottom_addr_for_region(uint index) const;
// Iterate over the heap regions in parallel. Assumes that this will be called
// in parallel by a number of worker threads with distinct worker ids
// in the range passed to the HeapRegionClaimer. Applies "blk->doHeapRegion"
// to each of the regions, by attempting to claim the region using the
// HeapRegionClaimer and, if successful, applying the closure to the claimed
// region.
void heap_region_par_iterate(HeapRegionClosure* cl,
uint worker_id,
HeapRegionClaimer* hrclaimer) const;
// Two functions to iterate over the heap regions in parallel. Threads
// compete using the HeapRegionClaimer to claim the regions before
// applying the closure on them.
// The _from_worker_offset version uses the HeapRegionClaimer and
// the worker id to calculate a start offset to prevent all workers to
// start from the point.
void heap_region_par_iterate_from_worker_offset(HeapRegionClosure* cl,
HeapRegionClaimer* hrclaimer,
uint worker_id) const;
void heap_region_par_iterate_from_start(HeapRegionClosure* cl,
HeapRegionClaimer* hrclaimer) const;
// Iterate over the regions (if any) in the current collection set.
void collection_set_iterate(HeapRegionClosure* blk);
@ -1226,8 +1232,6 @@ public:
// collection set regions.
void collection_set_iterate_from(HeapRegionClosure *blk, uint worker_id);
HeapRegion* next_compaction_region(const HeapRegion* from) const;
// Returns the HeapRegion that contains addr. addr must not be NULL.
template <class T>
inline HeapRegion* heap_region_containing(const T addr) const;
@ -1391,6 +1395,9 @@ public:
inline bool is_obj_ill(const oop obj) const;
inline bool is_obj_dead_full(const oop obj, const HeapRegion* hr) const;
inline bool is_obj_dead_full(const oop obj) const;
G1ConcurrentMark* concurrent_mark() const { return _cm; }
// Refinement
@ -1435,9 +1442,9 @@ public:
// Perform verification.
// vo == UsePrevMarking -> use "prev" marking information,
// vo == UsePrevMarking -> use "prev" marking information,
// vo == UseNextMarking -> use "next" marking information
// vo == UseMarkWord -> use the mark word in the object header
// vo == UseFullMarking -> use "next" marking bitmap but no TAMS
//
// NOTE: Only the "prev" marking information is guaranteed to be
// consistent most of the time, so most calls to this should use
@ -1446,7 +1453,7 @@ public:
// vo == UseNextMarking, which is to verify the "next" marking
// information at the end of remark.
// Currently there is only one place where this is called with
// vo == UseMarkWord, which is to verify the marking during a
// vo == UseFullMarking, which is to verify the marking during a
// full GC.
void verify(VerifyOption vo);

@ -264,6 +264,14 @@ inline bool G1CollectedHeap::is_obj_ill(const oop obj) const {
return is_obj_ill(obj, heap_region_containing(obj));
}
inline bool G1CollectedHeap::is_obj_dead_full(const oop obj, const HeapRegion* hr) const {
return !isMarkedNext(obj) && !hr->is_archive();
}
inline bool G1CollectedHeap::is_obj_dead_full(const oop obj) const {
return is_obj_dead_full(obj, heap_region_containing(obj));
}
inline void G1CollectedHeap::set_humongous_reclaim_candidate(uint region, bool value) {
assert(_hrm.at(region)->is_starts_humongous(), "Must start a humongous object");
_humongous_reclaim_candidates.set_candidate(region, value);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, 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
@ -37,11 +37,6 @@ bool G1CollectedHeap::copy_allocation_context_stats(const jint* contexts,
return false;
}
HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index,
MemRegion mr) {
return new HeapRegion(hrs_index, bot(), mr);
}
G1Policy* G1CollectedHeap::create_g1_policy(STWGCTimer* gc_timer) {
return new G1DefaultPolicy(gc_timer);
}

@ -634,7 +634,7 @@ public:
void work(uint worker_id) {
SuspendibleThreadSetJoiner sts_join(_suspendible);
G1CollectedHeap::heap()->heap_region_par_iterate(&_cl, worker_id, &_hr_claimer);
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&_cl, &_hr_claimer, worker_id);
}
bool is_complete() {
@ -1140,7 +1140,7 @@ public:
HRRSCleanupTask hrrs_cleanup_task;
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,
&hrrs_cleanup_task);
_g1h->heap_region_par_iterate(&g1_note_end, worker_id, &_hrclaimer);
_g1h->heap_region_par_iterate_from_worker_offset(&g1_note_end, &_hrclaimer, worker_id);
assert(g1_note_end.complete(), "Shouldn't have yielded!");
// Now update the lists

@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/heapRegion.hpp"
#include "memory/virtualspace.hpp"
void G1CMBitMap::print_on_error(outputStream* st, const char* prefix) const {
@ -65,3 +66,10 @@ void G1CMBitMap::clear_range(MemRegion mr) {
_bm.at_put_range(addr_to_offset(intersection.start()),
addr_to_offset(intersection.end()), false);
}
void G1CMBitMap::clear_region(HeapRegion* region) {
if (!region->is_empty()) {
MemRegion mr(region->bottom(), region->top());
clear_range(mr);
}
}

@ -28,6 +28,7 @@
#include "gc/g1/g1RegionToSpaceMapper.hpp"
#include "memory/allocation.hpp"
#include "memory/memRegion.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/bitMap.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
@ -35,6 +36,7 @@
class G1CMBitMap;
class G1CMTask;
class G1ConcurrentMark;
class HeapRegion;
// Closure for iteration over bitmaps
class G1CMBitMapClosure VALUE_OBJ_CLASS_SPEC {
@ -96,6 +98,7 @@ public:
void initialize(MemRegion heap, G1RegionToSpaceMapper* storage);
// Read marks
bool is_marked(oop obj) const;
bool is_marked(HeapWord* addr) const {
assert(_covered.contains(addr),
"Address " PTR_FORMAT " is outside underlying space from " PTR_FORMAT " to " PTR_FORMAT,
@ -120,9 +123,12 @@ public:
// Write marks.
inline void mark(HeapWord* addr);
inline void clear(HeapWord* addr);
inline void clear(oop obj);
inline bool par_mark(HeapWord* addr);
inline bool par_mark(oop obj);
void clear_range(MemRegion mr);
void clear_region(HeapRegion* hr);
};
#endif // SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP

@ -83,4 +83,16 @@ inline bool G1CMBitMap::par_mark(HeapWord* addr) {
return _bm.par_set_bit(addr_to_offset(addr));
}
inline bool G1CMBitMap::par_mark(oop obj) {
return par_mark((HeapWord*) obj);
}
inline bool G1CMBitMap::is_marked(oop obj) const{
return is_marked((HeapWord*) obj);
}
inline void G1CMBitMap::clear(oop obj) {
clear((HeapWord*) obj);
}
#endif // SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_INLINE_HPP

@ -0,0 +1,245 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "code/codeCache.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCAdjustTask.hpp"
#include "gc/g1/g1FullGCCompactTask.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
#include "gc/g1/g1FullGCMarkTask.hpp"
#include "gc/g1/g1FullGCPrepareTask.hpp"
#include "gc/g1/g1FullGCReferenceProcessorExecutor.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1OopClosures.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/preservedMarks.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/weakProcessor.hpp"
#include "logging/log.hpp"
#include "runtime/biasedLocking.hpp"
#include "utilities/debug.hpp"
static void clear_and_activate_derived_pointers() {
#if COMPILER2_OR_JVMCI
DerivedPointerTable::clear();
#endif
}
static void deactivate_derived_pointers() {
#if COMPILER2_OR_JVMCI
DerivedPointerTable::set_active(false);
#endif
}
static void update_derived_pointers() {
#if COMPILER2_OR_JVMCI
DerivedPointerTable::update_pointers();
#endif
}
G1FullCollector::G1FullCollector(G1FullGCScope* scope,
ReferenceProcessor* reference_processor,
G1CMBitMap* bitmap,
uint workers) :
_scope(scope),
_num_workers(workers),
_mark_bitmap(bitmap),
_oop_queue_set(_num_workers),
_array_queue_set(_num_workers),
_preserved_marks_set(true),
_reference_processor(reference_processor),
_serial_compaction_point(),
_is_alive(_mark_bitmap),
_is_alive_mutator(_reference_processor, &_is_alive) {
assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
_preserved_marks_set.init(_num_workers);
_markers = NEW_C_HEAP_ARRAY(G1FullGCMarker*, _num_workers, mtGC);
_compaction_points = NEW_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _num_workers, mtGC);
for (uint i = 0; i < _num_workers; i++) {
_markers[i] = new G1FullGCMarker(i, _preserved_marks_set.get(i), mark_bitmap());
_compaction_points[i] = new G1FullGCCompactionPoint();
_oop_queue_set.register_queue(i, marker(i)->oop_stack());
_array_queue_set.register_queue(i, marker(i)->objarray_stack());
}
}
G1FullCollector::~G1FullCollector() {
for (uint i = 0; i < _num_workers; i++) {
delete _markers[i];
delete _compaction_points[i];
}
FREE_C_HEAP_ARRAY(G1FullGCMarker*, _markers);
FREE_C_HEAP_ARRAY(G1FullGCCompactionPoint*, _compaction_points);
}
void G1FullCollector::prepare_collection() {
_reference_processor->enable_discovery();
_reference_processor->setup_policy(scope()->should_clear_soft_refs());
// When collecting the permanent generation Method*s may be moving,
// so we either have to flush all bcp data or convert it into bci.
CodeCache::gc_prologue();
// We should save the marks of the currently locked biased monitors.
// The marking doesn't preserve the marks of biased objects.
BiasedLocking::preserve_marks();
// Clear and activate derived pointer collection.
clear_and_activate_derived_pointers();
}
void G1FullCollector::collect() {
phase1_mark_live_objects();
verify_after_marking();
// Don't add any more derived pointers during later phases
deactivate_derived_pointers();
phase2_prepare_compaction();
phase3_adjust_pointers();
phase4_do_compaction();
}
void G1FullCollector::complete_collection() {
// Restore all marks.
restore_marks();
// When the pointers have been adjusted and moved, we can
// update the derived pointer table.
update_derived_pointers();
BiasedLocking::restore_marks();
CodeCache::gc_epilogue();
JvmtiExport::gc_epilogue();
}
void G1FullCollector::phase1_mark_live_objects() {
// Recursively traverse all live objects and mark them.
GCTraceTime(Info, gc, phases) info("Phase 1: Mark live objects", scope()->timer());
// Do the actual marking.
G1FullGCMarkTask marking_task(this);
run_task(&marking_task);
// Process references discovered during marking.
G1FullGCReferenceProcessingExecutor reference_processing(this);
reference_processing.execute(scope()->timer(), scope()->tracer());
// Weak oops cleanup.
{
GCTraceTime(Debug, gc, phases) trace("Phase 1: Weak Processing", scope()->timer());
WeakProcessor::weak_oops_do(&_is_alive, &do_nothing_cl);
}
// Class unloading and cleanup.
if (ClassUnloading) {
GCTraceTime(Debug, gc, phases) debug("Phase 1: Class Unloading and Cleanup", scope()->timer());
// Unload classes and purge the SystemDictionary.
bool purged_class = SystemDictionary::do_unloading(&_is_alive, scope()->timer());
G1CollectedHeap::heap()->complete_cleaning(&_is_alive, purged_class);
} else {
GCTraceTime(Debug, gc, phases) debug("Phase 1: String and Symbol Tables Cleanup", scope()->timer());
// If no class unloading just clean out strings and symbols.
G1CollectedHeap::heap()->partial_cleaning(&_is_alive, true, true, G1StringDedup::is_enabled());
}
scope()->tracer()->report_object_count_after_gc(&_is_alive);
}
void G1FullCollector::prepare_compaction_common() {
G1FullGCPrepareTask task(this);
run_task(&task);
// To avoid OOM when there is memory left.
if (!task.has_freed_regions()) {
task.prepare_serial_compaction();
}
}
void G1FullCollector::phase2_prepare_compaction() {
GCTraceTime(Info, gc, phases) info("Phase 2: Prepare for compaction", scope()->timer());
prepare_compaction_ext(); // Will call prepare_compaction_common() above.
}
void G1FullCollector::phase3_adjust_pointers() {
// Adjust the pointers to reflect the new locations
GCTraceTime(Info, gc, phases) info("Phase 3: Adjust pointers and remembered sets", scope()->timer());
G1FullGCAdjustTask task(this);
run_task(&task);
}
void G1FullCollector::phase4_do_compaction() {
// Compact the heap using the compaction queues created in phase 2.
GCTraceTime(Info, gc, phases) info("Phase 4: Compact heap", scope()->timer());
G1FullGCCompactTask task(this);
run_task(&task);
// Serial compact to avoid OOM when very few free regions.
if (serial_compaction_point()->has_regions()) {
task.serial_compaction();
}
}
void G1FullCollector::restore_marks() {
SharedRestorePreservedMarksTaskExecutor task_executor(G1CollectedHeap::heap()->workers());
_preserved_marks_set.restore(&task_executor);
_preserved_marks_set.reclaim();
}
void G1FullCollector::run_task(AbstractGangTask* task) {
G1CollectedHeap::heap()->workers()->run_task(task, _num_workers);
}
void G1FullCollector::verify_after_marking() {
if (!VerifyDuringGC) {
//Only do verification if VerifyDuringGC is set.
return;
}
HandleMark hm; // handle scope
#if COMPILER2_OR_JVMCI
DerivedPointerTableDeactivate dpt_deact;
#endif
G1CollectedHeap::heap()->prepare_for_verify();
// Note: we can verify only the heap here. When an object is
// marked, the previous value of the mark word (including
// identity hash values, ages, etc) is preserved, and the mark
// word is set to markOop::marked_value - effectively removing
// any hash values from the mark word. These hash values are
// used when verifying the dictionaries and so removing them
// from the mark word can make verification of the dictionaries
// fail. At the end of the GC, the original mark word values
// (including hash values) are restored to the appropriate
// objects.
GCTraceTime(Info, gc, verify)("During GC (full)");
G1CollectedHeap::heap()->verify(VerifyOption_G1UseFullMarking);
}

@ -0,0 +1,98 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLCOLLECTOR_HPP
#define SHARE_GC_G1_G1FULLCOLLECTOR_HPP
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1FullGCOopClosures.hpp"
#include "gc/shared/preservedMarks.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/taskqueue.hpp"
#include "memory/allocation.hpp"
class AbstractGangTask;
class G1CMBitMap;
class G1FullGCMarker;
class G1FullGCScope;
class G1FullGCCompactionPoint;
class ReferenceProcessor;
// The G1FullCollector holds data associated with the current Full GC.
class G1FullCollector : StackObj {
G1FullGCScope* _scope;
uint _num_workers;
G1FullGCMarker** _markers;
G1FullGCCompactionPoint** _compaction_points;
G1CMBitMap* _mark_bitmap;
OopQueueSet _oop_queue_set;
ObjArrayTaskQueueSet _array_queue_set;
PreservedMarksSet _preserved_marks_set;
ReferenceProcessor* _reference_processor;
G1FullGCCompactionPoint _serial_compaction_point;
G1IsAliveClosure _is_alive;
ReferenceProcessorIsAliveMutator _is_alive_mutator;
public:
G1FullCollector(G1FullGCScope* scope,
ReferenceProcessor* reference_processor,
G1CMBitMap* mark_bitmap,
uint workers);
~G1FullCollector();
void prepare_collection();
void collect();
void complete_collection();
G1FullGCScope* scope() { return _scope; }
uint workers() { return _num_workers; }
G1FullGCMarker* marker(uint id) { return _markers[id]; }
G1FullGCCompactionPoint* compaction_point(uint id) { return _compaction_points[id]; }
G1CMBitMap* mark_bitmap() { return _mark_bitmap; }
OopQueueSet* oop_queue_set() { return &_oop_queue_set; }
ObjArrayTaskQueueSet* array_queue_set() { return &_array_queue_set; }
PreservedMarksSet* preserved_mark_set() { return &_preserved_marks_set; }
ReferenceProcessor* reference_processor() { return _reference_processor; }
G1FullGCCompactionPoint* serial_compaction_point() { return &_serial_compaction_point; }
private:
void phase1_mark_live_objects();
void phase2_prepare_compaction();
void phase3_adjust_pointers();
void phase4_do_compaction();
void restore_marks();
void verify_after_marking();
void run_task(AbstractGangTask* task);
// Prepare compaction extension support.
void prepare_compaction_ext();
void prepare_compaction_common();
};
#endif // SHARE_GC_G1_G1FULLCOLLECTOR_HPP

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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
@ -23,9 +23,8 @@
*/
#include "precompiled.hpp"
#include "gc/g1/g1MarkSweep.hpp"
#include "gc/g1/g1FullCollector.hpp"
void G1MarkSweep::prepare_compaction() {
G1PrepareCompactClosure blk;
G1MarkSweep::prepare_compaction_work(&blk);
void G1FullCollector::prepare_compaction_ext() {
prepare_compaction_common();
}

@ -0,0 +1,119 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCAdjustTask.hpp"
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "logging/log.hpp"
#include "utilities/ticks.inline.hpp"
class G1AdjustLiveClosure : public StackObj {
G1AdjustAndRebuildClosure* _adjust_closure;
public:
G1AdjustLiveClosure(G1AdjustAndRebuildClosure* cl) :
_adjust_closure(cl) { }
size_t apply(oop object) {
_adjust_closure->update_compaction_delta(object);
return object->oop_iterate_size(_adjust_closure);
}
};
class G1AdjustRegionClosure : public HeapRegionClosure {
G1CMBitMap* _bitmap;
uint _worker_id;
public:
G1AdjustRegionClosure(G1CMBitMap* bitmap, uint worker_id) :
_bitmap(bitmap),
_worker_id(worker_id) { }
bool doHeapRegion(HeapRegion* r) {
G1AdjustAndRebuildClosure cl(_worker_id);
if (r->is_humongous()) {
oop obj = oop(r->humongous_start_region()->bottom());
cl.update_compaction_delta(obj);
obj->oop_iterate(&cl, MemRegion(r->bottom(), r->top()));
} else if (r->is_open_archive()) {
// Only adjust the open archive regions, the closed ones
// never change.
G1AdjustLiveClosure adjust(&cl);
r->apply_to_marked_objects(_bitmap, &adjust);
// Open archive regions will not be compacted and the marking information is
// no longer needed. Clear it here to avoid having to do it later.
_bitmap->clear_region(r);
} else {
G1AdjustLiveClosure adjust(&cl);
r->apply_to_marked_objects(_bitmap, &adjust);
}
return false;
}
};
G1FullGCAdjustTask::G1FullGCAdjustTask(G1FullCollector* collector) :
G1FullGCTask("G1 Adjust and Rebuild", collector),
_root_processor(G1CollectedHeap::heap(), collector->workers()),
_hrclaimer(collector->workers()),
_adjust(),
_adjust_string_dedup(NULL, &_adjust, G1StringDedup::is_enabled()) {
// Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
}
void G1FullGCAdjustTask::work(uint worker_id) {
Ticks start = Ticks::now();
ResourceMark rm;
// Adjust preserved marks first since they are not balanced.
G1FullGCMarker* marker = collector()->marker(worker_id);
marker->preserved_stack()->adjust_during_full_gc();
// Adjust the weak_roots.
CLDToOopClosure adjust_cld(&_adjust);
CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
_root_processor.process_full_gc_weak_roots(&_adjust);
// Needs to be last, process_all_roots calls all_tasks_completed(...).
_root_processor.process_all_roots(
&_adjust,
&adjust_cld,
&adjust_code);
// Adjust string dedup if enabled.
if (G1StringDedup::is_enabled()) {
G1StringDedup::parallel_unlink(&_adjust_string_dedup, worker_id);
}
// Now adjust pointers region by region
G1AdjustRegionClosure blk(collector()->mark_bitmap(), worker_id);
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
log_task("Adjust and Rebuild task", worker_id, start);
}

@ -22,28 +22,27 @@
*
*/
#ifndef SHARE_VM_GC_G1_G1SERIALCOLLECTOR_HPP
#define SHARE_VM_GC_G1_G1SERIALCOLLECTOR_HPP
#ifndef SHARE_GC_G1_G1FULLGCADJUSTTASK_HPP
#define SHARE_GC_G1_G1FULLGCADJUSTTASK_HPP
#include "memory/allocation.hpp"
#include "gc/g1/g1FullGCOopClosures.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/heapRegionManager.hpp"
#include "utilities/ticks.hpp"
class G1FullGCScope;
class ReferenceProcessor;
class G1CollectedHeap;
class G1SerialFullCollector : StackObj {
G1FullGCScope* _scope;
ReferenceProcessor* _reference_processor;
ReferenceProcessorIsAliveMutator _is_alive_mutator;
ReferenceProcessorMTDiscoveryMutator _mt_discovery_mutator;
void rebuild_remembered_sets();
class G1FullGCAdjustTask : public G1FullGCTask {
G1RootProcessor _root_processor;
HeapRegionClaimer _hrclaimer;
G1AdjustClosure _adjust;
G1StringDedupUnlinkOrOopsDoClosure _adjust_string_dedup;
public:
G1SerialFullCollector(G1FullGCScope* scope, ReferenceProcessor* reference_processor);
void prepare_collection();
void collect();
void complete_collection();
G1FullGCAdjustTask(G1FullCollector* collector);
void work(uint worker_id);
};
#endif // SHARE_VM_GC_G1_G1SERIALCOLLECTOR_HPP
#endif // SHARE_GC_G1_G1FULLGCADJUSTTASK_HPP

@ -0,0 +1,111 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCCompactTask.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "logging/log.hpp"
#include "utilities/ticks.inline.hpp"
class G1ResetHumongousClosure : public HeapRegionClosure {
G1CMBitMap* _bitmap;
public:
G1ResetHumongousClosure(G1CMBitMap* bitmap) :
_bitmap(bitmap) { }
bool doHeapRegion(HeapRegion* current) {
if (current->is_humongous()) {
if (current->is_starts_humongous()) {
oop obj = oop(current->bottom());
if (_bitmap->is_marked(obj)) {
// Clear bitmap and fix mark word.
_bitmap->clear(obj);
obj->init_mark();
} else {
assert(current->is_empty(), "Should have been cleared in phase 2.");
}
}
current->reset_during_compaction();
}
return false;
}
};
size_t G1FullGCCompactTask::G1CompactRegionClosure::apply(oop obj) {
size_t size = obj->size();
HeapWord* destination = (HeapWord*)obj->forwardee();
if (destination == NULL) {
// Object not moving
return size;
}
// copy object and reinit its mark
HeapWord* obj_addr = (HeapWord*) obj;
assert(obj_addr != destination, "everything in this pass should be moving");
Copy::aligned_conjoint_words(obj_addr, destination, size);
oop(destination)->init_mark();
assert(oop(destination)->klass() != NULL, "should have a class");
return size;
}
void G1FullGCCompactTask::compact_region(HeapRegion* hr) {
assert(!hr->is_humongous(), "Should be no humongous regions in compaction queue");
G1CompactRegionClosure compact(collector()->mark_bitmap());
hr->apply_to_marked_objects(collector()->mark_bitmap(), &compact);
// Once all objects have been moved the liveness information
// needs be cleared.
collector()->mark_bitmap()->clear_region(hr);
hr->complete_compaction();
}
void G1FullGCCompactTask::work(uint worker_id) {
Ticks start = Ticks::now();
GrowableArray<HeapRegion*>* compaction_queue = collector()->compaction_point(worker_id)->regions();
for (GrowableArrayIterator<HeapRegion*> it = compaction_queue->begin();
it != compaction_queue->end();
++it) {
compact_region(*it);
}
G1ResetHumongousClosure hc(collector()->mark_bitmap());
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&hc, &_claimer, worker_id);
log_task("Compaction task", worker_id, start);
}
void G1FullGCCompactTask::serial_compaction() {
GCTraceTime(Debug, gc, phases) tm("Phase 4: Serial Compaction", collector()->scope()->timer());
GrowableArray<HeapRegion*>* compaction_queue = collector()->serial_compaction_point()->regions();
for (GrowableArrayIterator<HeapRegion*> it = compaction_queue->begin();
it != compaction_queue->end();
++it) {
compact_region(*it);
}
}

@ -0,0 +1,62 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCCOMPACTTASK_HPP
#define SHARE_GC_G1_G1FULLGCCOMPACTTASK_HPP
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/heapRegionManager.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "utilities/ticks.hpp"
class G1CollectedHeap;
class G1CMBitMap;
class G1FullGCCompactTask : public G1FullGCTask {
protected:
HeapRegionClaimer _claimer;
private:
void compact_region(HeapRegion* hr);
public:
G1FullGCCompactTask(G1FullCollector* collector) :
G1FullGCTask("G1 Compact Task", collector),
_claimer(collector->workers()) { }
void work(uint worker_id);
void serial_compaction();
class G1CompactRegionClosure : public StackObj {
G1CMBitMap* _bitmap;
public:
G1CompactRegionClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) { }
size_t apply(oop object);
};
};
#endif // SHARE_GC_G1_G1FULLGCCOMPACTTASK_HPP

@ -0,0 +1,145 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/heapRegion.hpp"
#include "oops/oop.inline.hpp"
#include "utilities/debug.hpp"
G1FullGCCompactionPoint::G1FullGCCompactionPoint() :
_current_region(NULL),
_threshold(NULL),
_compaction_top(NULL) {
_compaction_regions = new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapRegion*>(32, true, mtGC);
_compaction_region_iterator = _compaction_regions->begin();
}
G1FullGCCompactionPoint::~G1FullGCCompactionPoint() {
delete _compaction_regions;
}
void G1FullGCCompactionPoint::update() {
if (is_initialized()) {
_current_region->set_compaction_top(_compaction_top);
}
}
void G1FullGCCompactionPoint::initialize_values(bool init_threshold) {
_compaction_top = _current_region->compaction_top();
if (init_threshold) {
_threshold = _current_region->initialize_threshold();
}
}
bool G1FullGCCompactionPoint::has_regions() {
return !_compaction_regions->is_empty();
}
bool G1FullGCCompactionPoint::is_initialized() {
return _current_region != NULL;
}
void G1FullGCCompactionPoint::initialize(HeapRegion* hr, bool init_threshold) {
_current_region = hr;
initialize_values(init_threshold);
}
HeapRegion* G1FullGCCompactionPoint::current_region() {
return *_compaction_region_iterator;
}
HeapRegion* G1FullGCCompactionPoint::next_region() {
HeapRegion* next = *(++_compaction_region_iterator);
assert(next != NULL, "Must return valid region");
return next;
}
GrowableArray<HeapRegion*>* G1FullGCCompactionPoint::regions() {
return _compaction_regions;
}
bool G1FullGCCompactionPoint::object_will_fit(size_t size) {
size_t space_left = pointer_delta(_current_region->end(), _compaction_top);
return size <= space_left;
}
void G1FullGCCompactionPoint::switch_region() {
// Save compaction top in the region.
_current_region->set_compaction_top(_compaction_top);
// Get the next region and re-initialize the values.
_current_region = next_region();
initialize_values(true);
}
void G1FullGCCompactionPoint::forward(oop object, size_t size) {
assert(_current_region != NULL, "Must have been initialized");
// Ensure the object fit in the current region.
while (!object_will_fit(size)) {
switch_region();
}
// Store a forwarding pointer if the object should be moved.
if ((HeapWord*)object != _compaction_top) {
object->forward_to(oop(_compaction_top));
} else {
if (object->forwardee() != NULL) {
// Object should not move but mark-word is used so it looks like the
// object is forwarded. Need to clear the mark and it's no problem
// since it will be restored by preserved marks. There is an exception
// with BiasedLocking, in this case forwardee() will return NULL
// even if the mark-word is used. This is no problem since
// forwardee() will return NULL in the compaction phase as well.
object->init_mark();
} else {
// Make sure object has the correct mark-word set or that it will be
// fixed when restoring the preserved marks.
assert(object->mark() == markOopDesc::prototype_for_object(object) || // Correct mark
object->mark()->must_be_preserved(object) || // Will be restored by PreservedMarksSet
(UseBiasedLocking && object->has_bias_pattern()), // Will be restored by BiasedLocking
"should have correct prototype obj: " PTR_FORMAT " mark: " PTR_FORMAT " prototype: " PTR_FORMAT,
p2i(object), p2i(object->mark()), p2i(markOopDesc::prototype_for_object(object)));
}
assert(object->forwardee() == NULL, "should be forwarded to NULL");
}
// Update compaction values.
_compaction_top += size;
if (_compaction_top > _threshold) {
_threshold = _current_region->cross_threshold(_compaction_top - size, _compaction_top);
}
}
void G1FullGCCompactionPoint::add(HeapRegion* hr) {
_compaction_regions->append(hr);
}
void G1FullGCCompactionPoint::merge(G1FullGCCompactionPoint* other) {
_compaction_regions->appendAll(other->regions());
}
HeapRegion* G1FullGCCompactionPoint::remove_last() {
return _compaction_regions->pop();
}

@ -0,0 +1,63 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCCOMPACTIONPOINT_HPP
#define SHARE_GC_G1_G1FULLGCCOMPACTIONPOINT_HPP
#include "memory/allocation.hpp"
#include "utilities/growableArray.hpp"
class HeapRegion;
class G1FullGCCompactionPoint : public CHeapObj<mtGC> {
HeapRegion* _current_region;
HeapWord* _threshold;
HeapWord* _compaction_top;
GrowableArray<HeapRegion*>* _compaction_regions;
GrowableArrayIterator<HeapRegion*> _compaction_region_iterator;
bool object_will_fit(size_t size);
void initialize_values(bool init_threshold);
void switch_region();
HeapRegion* next_region();
public:
G1FullGCCompactionPoint();
~G1FullGCCompactionPoint();
bool has_regions();
bool is_initialized();
void initialize(HeapRegion* hr, bool init_threshold);
void update();
void forward(oop object, size_t size);
void add(HeapRegion* hr);
void merge(G1FullGCCompactionPoint* other);
HeapRegion* remove_last();
HeapRegion* current_region();
GrowableArray<HeapRegion*>* regions();
};
#endif // SHARE_GC_G1_G1FULLGCCOMPACTIONPOINT_HPP

@ -0,0 +1,68 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1FullGCMarkTask.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/g1FullGCReferenceProcessorExecutor.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
G1FullGCMarkTask::G1FullGCMarkTask(G1FullCollector* collector) :
G1FullGCTask("G1 Parallel Marking Task", collector),
_root_processor(G1CollectedHeap::heap(), collector->workers()),
_terminator(collector->workers(), collector->array_queue_set()) {
// Need cleared claim bits for the roots processing
ClassLoaderDataGraph::clear_claimed_marks();
}
void G1FullGCMarkTask::work(uint worker_id) {
Ticks start = Ticks::now();
ResourceMark rm;
G1FullGCMarker* marker = collector()->marker(worker_id);
MarkingCodeBlobClosure code_closure(marker->mark_closure(), !CodeBlobToOopClosure::FixRelocations);
if (ClassUnloading) {
_root_processor.process_strong_roots(
marker->mark_closure(),
marker->cld_closure(),
&code_closure);
} else {
_root_processor.process_all_roots_no_string_table(
marker->mark_closure(),
marker->cld_closure(),
&code_closure);
}
// Mark stack is populated, now process and drain it.
marker->complete_marking(collector()->oop_queue_set(), collector()->array_queue_set(), &_terminator);
// This is the point where the entire marking should have completed.
assert(marker->oop_stack()->is_empty(), "Marking should have completed");
assert(marker->objarray_stack()->is_empty(), "Array marking should have completed");
log_task("Marking task", worker_id, start);
}

@ -0,0 +1,46 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCMARKTASK_HPP
#define SHARE_GC_G1_G1FULLGCMARKTASK_HPP
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/heapRegionManager.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "utilities/ticks.hpp"
class G1FullGCMarkTask : public G1FullGCTask {
G1RootProcessor _root_processor;
ParallelTaskTerminator _terminator;
public:
G1FullGCMarkTask(G1FullCollector* collector);
void work(uint worker_id);
};
#endif // SHARE_GC_G1_G1FULLGCMARKTASK_HPP

@ -0,0 +1,60 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
G1FullGCMarker::G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap) :
_worker_id(worker_id),
_mark_closure(worker_id, this, G1CollectedHeap::heap()->ref_processor_stw()),
_verify_closure(VerifyOption_G1UseFullMarking),
_cld_closure(mark_closure()),
_stack_closure(this),
_preserved_stack(preserved_stack),
_bitmap(bitmap) {
_oop_stack.initialize();
_objarray_stack.initialize();
}
G1FullGCMarker::~G1FullGCMarker() {
assert(is_empty(), "Must be empty at this point");
}
void G1FullGCMarker::complete_marking(OopQueueSet* oop_stacks,
ObjArrayTaskQueueSet* array_stacks,
ParallelTaskTerminator* terminator) {
int hash_seed = 17;
do {
drain_stack();
ObjArrayTask steal_array;
if (array_stacks->steal(_worker_id, &hash_seed, steal_array)) {
follow_array_chunk(objArrayOop(steal_array.obj()), steal_array.index());
} else {
oop steal_oop;
if (oop_stacks->steal(_worker_id, &hash_seed, steal_oop)) {
follow_object(steal_oop);
}
}
} while (!is_empty() || !terminator->offer_termination());
}

@ -0,0 +1,99 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCMARKER_HPP
#define SHARE_GC_G1_G1FULLGCMARKER_HPP
#include "gc/g1/g1FullGCOopClosures.hpp"
#include "gc/shared/preservedMarks.hpp"
#include "gc/shared/taskqueue.hpp"
#include "memory/iterator.hpp"
#include "oops/markOop.hpp"
#include "oops/oop.hpp"
#include "runtime/timer.hpp"
#include "utilities/chunkedList.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/stack.hpp"
typedef OverflowTaskQueue<oop, mtGC> OopQueue;
typedef OverflowTaskQueue<ObjArrayTask, mtGC> ObjArrayTaskQueue;
typedef GenericTaskQueueSet<OopQueue, mtGC> OopQueueSet;
typedef GenericTaskQueueSet<ObjArrayTaskQueue, mtGC> ObjArrayTaskQueueSet;
class G1CMBitMap;
class G1FullGCMarker : public CHeapObj<mtGC> {
private:
uint _worker_id;
// Backing mark bitmap
G1CMBitMap* _bitmap;
// Mark stack
OopQueue _oop_stack;
ObjArrayTaskQueue _objarray_stack;
PreservedMarks* _preserved_stack;
// Marking closures
G1MarkAndPushClosure _mark_closure;
G1VerifyOopClosure _verify_closure;
G1FollowStackClosure _stack_closure;
CLDToOopClosure _cld_closure;
inline bool is_empty();
inline bool pop_object(oop& obj);
inline bool pop_objarray(ObjArrayTask& array);
inline void push_objarray(oop obj, size_t index);
inline bool mark_object(oop obj);
// Marking helpers
inline void follow_object(oop obj);
inline void follow_array(objArrayOop array);
inline void follow_array_chunk(objArrayOop array, int index);
public:
G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap);
~G1FullGCMarker();
// Stack getters
OopQueue* oop_stack() { return &_oop_stack; }
ObjArrayTaskQueue* objarray_stack() { return &_objarray_stack; }
PreservedMarks* preserved_stack() { return _preserved_stack; }
// Marking entry points
template <class T> inline void mark_and_push(T* p);
inline void follow_klass(Klass* k);
inline void follow_cld(ClassLoaderData* cld);
inline void drain_stack();
void complete_marking(OopQueueSet* oop_stacks,
ObjArrayTaskQueueSet* array_stacks,
ParallelTaskTerminator* terminator);
// Closure getters
CLDToOopClosure* cld_closure() { return &_cld_closure; }
G1MarkAndPushClosure* mark_closure() { return &_mark_closure; }
G1FollowStackClosure* stack_closure() { return &_stack_closure; }
};
#endif // SHARE_GC_G1_G1FULLGCMARKER_HPP

@ -0,0 +1,172 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_VM_GC_G1_G1MARKSTACK_INLINE_HPP
#define SHARE_VM_GC_G1_G1MARKSTACK_INLINE_HPP
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/g1StringDedupQueue.hpp"
#include "gc/shared/preservedMarks.inline.hpp"
#include "utilities/debug.hpp"
inline bool G1FullGCMarker::mark_object(oop obj) {
// Not marking closed archive objects.
if (G1ArchiveAllocator::is_closed_archive_object(obj)) {
return false;
}
// Try to mark.
if (!_bitmap->par_mark(obj)) {
// Lost mark race.
return false;
}
// Marked by us, preserve if needed.
markOop mark = obj->mark();
if (mark->must_be_preserved(obj) &&
!G1ArchiveAllocator::is_open_archive_object(obj)) {
preserved_stack()->push(obj, mark);
}
// Check if deduplicatable string.
if (G1StringDedup::is_enabled()) {
G1StringDedup::enqueue_from_mark(obj, _worker_id);
}
return true;
}
template <class T> inline void G1FullGCMarker::mark_and_push(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
if (mark_object(obj)) {
_oop_stack.push(obj);
assert(_bitmap->is_marked(obj), "Must be marked now - map self");
} else {
assert(_bitmap->is_marked(obj) || G1ArchiveAllocator::is_closed_archive_object(obj),
"Must be marked by other or closed archive object");
}
}
}
inline bool G1FullGCMarker::is_empty() {
return _oop_stack.is_empty() && _objarray_stack.is_empty();
}
inline bool G1FullGCMarker::pop_object(oop& oop) {
return _oop_stack.pop_overflow(oop) || _oop_stack.pop_local(oop);
}
inline void G1FullGCMarker::push_objarray(oop obj, size_t index) {
ObjArrayTask task(obj, index);
assert(task.is_valid(), "bad ObjArrayTask");
_objarray_stack.push(task);
}
inline bool G1FullGCMarker::pop_objarray(ObjArrayTask& arr) {
return _objarray_stack.pop_overflow(arr) || _objarray_stack.pop_local(arr);
}
inline void G1FullGCMarker::follow_array(objArrayOop array) {
follow_klass(array->klass());
// Don't push empty arrays to avoid unnecessary work.
if (array->length() > 0) {
push_objarray(array, 0);
}
}
void G1FullGCMarker::follow_array_chunk(objArrayOop array, int index) {
const int len = array->length();
const int beg_index = index;
assert(beg_index < len || len == 0, "index too large");
const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
const int end_index = beg_index + stride;
array->oop_iterate_range(mark_closure(), beg_index, end_index);
if (VerifyDuringGC) {
_verify_closure.set_containing_obj(array);
NoHeaderExtendedOopClosure no(&_verify_closure);
array->oop_iterate_range(&no, beg_index, end_index);
if (_verify_closure.failures()) {
assert(false, "Failed");
}
}
if (end_index < len) {
push_objarray(array, end_index); // Push the continuation.
}
}
inline void G1FullGCMarker::follow_object(oop obj) {
assert(_bitmap->is_marked(obj), "should be marked");
if (obj->is_objArray()) {
// Handle object arrays explicitly to allow them to
// be split into chunks if needed.
follow_array((objArrayOop)obj);
} else {
obj->oop_iterate(mark_closure());
if (VerifyDuringGC) {
if (obj->is_instance() && InstanceKlass::cast(obj->klass())->is_reference_instance_klass()) {
return;
}
_verify_closure.set_containing_obj(obj);
obj->oop_iterate_no_header(&_verify_closure);
if (_verify_closure.failures()) {
log_warning(gc, verify)("Failed after %d", _verify_closure._cc);
assert(false, "Failed");
}
}
}
}
void G1FullGCMarker::drain_stack() {
do {
oop obj;
while (pop_object(obj)) {
assert(_bitmap->is_marked(obj), "must be marked");
follow_object(obj);
}
// Process ObjArrays one at a time to avoid marking stack bloat.
ObjArrayTask task;
if (pop_objarray(task)) {
follow_array_chunk(objArrayOop(task.obj()), task.index());
}
} while (!is_empty());
}
inline void G1FullGCMarker::follow_klass(Klass* k) {
oop op = k->klass_holder();
mark_and_push(&op);
}
inline void G1FullGCMarker::follow_cld(ClassLoaderData* cld) {
_cld_closure.do_cld(cld);
}
#endif

@ -0,0 +1,148 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/g1_specialized_oop_closures.hpp"
#include "logging/logStream.hpp"
void G1MarkAndPushClosure::do_oop(oop* p) {
do_oop_nv(p);
}
void G1MarkAndPushClosure::do_oop(narrowOop* p) {
do_oop_nv(p);
}
bool G1MarkAndPushClosure::do_metadata() {
return do_metadata_nv();
}
void G1MarkAndPushClosure::do_klass(Klass* k) {
do_klass_nv(k);
}
void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) {
do_cld_nv(cld);
}
G1AdjustAndRebuildClosure::G1AdjustAndRebuildClosure(uint worker_id) :
_worker_id(worker_id),
_compaction_delta(0),
_g1h(G1CollectedHeap::heap()) { }
void G1AdjustAndRebuildClosure::update_compaction_delta(oop obj) {
if (G1ArchiveAllocator::is_open_archive_object(obj)) {
_compaction_delta = 0;
return;
}
oop forwardee = obj->forwardee();
if (forwardee == NULL) {
// Object not moved.
_compaction_delta = 0;
} else {
// Object moved to forwardee, calculate delta.
_compaction_delta = calculate_compaction_delta(obj, forwardee);
}
}
void G1AdjustClosure::do_oop(oop* p) { adjust_pointer(p); }
void G1AdjustClosure::do_oop(narrowOop* p) { adjust_pointer(p); }
void G1AdjustAndRebuildClosure::do_oop(oop* p) { do_oop_nv(p); }
void G1AdjustAndRebuildClosure::do_oop(narrowOop* p) { do_oop_nv(p); }
void G1FollowStackClosure::do_void() { _marker->drain_stack(); }
void G1FullKeepAliveClosure::do_oop(oop* p) { do_oop_work(p); }
void G1FullKeepAliveClosure::do_oop(narrowOop* p) { do_oop_work(p); }
G1VerifyOopClosure::G1VerifyOopClosure(VerifyOption option) :
_g1h(G1CollectedHeap::heap()),
_containing_obj(NULL),
_verify_option(option),
_cc(0),
_failures(false) {
}
void G1VerifyOopClosure::print_object(outputStream* out, oop obj) {
#ifdef PRODUCT
Klass* k = obj->klass();
const char* class_name = InstanceKlass::cast(k)->external_name();
out->print_cr("class name %s", class_name);
#else // PRODUCT
obj->print_on(out);
#endif // PRODUCT
}
template <class T> void G1VerifyOopClosure::do_oop_nv(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
if (!oopDesc::is_null(heap_oop)) {
_cc++;
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
bool failed = false;
if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
LogStreamHandle(Error, gc, verify) yy;
if (!_failures) {
yy.cr();
yy.print_cr("----------");
}
if (!_g1h->is_in_closed_subset(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
yy.print_cr("Field " PTR_FORMAT
" of live obj " PTR_FORMAT " in region "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(p), p2i(_containing_obj),
p2i(from->bottom()), p2i(from->end()));
print_object(&yy, _containing_obj);
yy.print_cr("points to obj " PTR_FORMAT " not in the heap",
p2i(obj));
} else {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
yy.print_cr("Field " PTR_FORMAT
" of live obj " PTR_FORMAT " in region "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(p), p2i(_containing_obj),
p2i(from->bottom()), p2i(from->end()));
print_object(&yy, _containing_obj);
yy.print_cr("points to dead obj " PTR_FORMAT " in region "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
p2i(obj), p2i(to->bottom()), p2i(to->end()));
print_object(&yy, obj);
}
yy.print_cr("----------");
yy.flush();
_failures = true;
failed = true;
}
}
}
// Generate G1 full GC specialized oop_oop_iterate functions.
SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(ALL_KLASS_OOP_OOP_ITERATE_DEFN)

@ -0,0 +1,151 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCOOPCLOSURES_HPP
#define SHARE_GC_G1_G1FULLGCOOPCLOSURES_HPP
#include "memory/iterator.hpp"
#include "memory/universe.hpp"
class G1CollectedHeap;
class G1FullCollector;
class G1CMBitMap;
class G1FullGCMarker;
// Below are closures used by the G1 Full GC.
class G1IsAliveClosure : public BoolObjectClosure {
G1CMBitMap* _bitmap;
public:
G1IsAliveClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) { }
virtual bool do_object_b(oop p);
};
class G1FullKeepAliveClosure: public OopClosure {
G1FullGCMarker* _marker;
template <class T>
inline void do_oop_work(T* p);
public:
G1FullKeepAliveClosure(G1FullGCMarker* pm) : _marker(pm) { }
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
};
class G1MarkAndPushClosure : public ExtendedOopClosure {
G1FullGCMarker* _marker;
uint _worker_id;
public:
G1MarkAndPushClosure(uint worker, G1FullGCMarker* marker, ReferenceProcessor* ref) :
_marker(marker),
_worker_id(worker),
ExtendedOopClosure(ref) { }
template <class T> inline void do_oop_nv(T* p);
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
virtual bool do_metadata();
bool do_metadata_nv();
virtual void do_klass(Klass* k);
void do_klass_nv(Klass* k);
virtual void do_cld(ClassLoaderData* cld);
void do_cld_nv(ClassLoaderData* cld);
};
class G1AdjustClosure : public OopClosure {
public:
template <class T> static inline oop adjust_pointer(T* p);
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
};
class G1AdjustAndRebuildClosure : public ExtendedOopClosure {
uint _worker_id;
size_t _compaction_delta;
G1CollectedHeap* _g1h;
inline size_t calculate_compaction_delta(oop current, oop forwardee);
template <class T> inline T* add_compaction_delta(T* p);
public:
G1AdjustAndRebuildClosure(uint worker_id);
void update_compaction_delta(oop obj);
template <class T> inline void add_reference(T* from_field, oop reference, uint worker_id);
template <class T> void do_oop_nv(T* p);
virtual void do_oop(oop* p);
virtual void do_oop(narrowOop* p);
virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; }
};
class G1AdjustObjectClosure {
G1AdjustAndRebuildClosure* _closure;
public:
G1AdjustObjectClosure(G1AdjustAndRebuildClosure* cl) : _closure(cl) { }
inline int adjust_object(oop obj);
};
class G1VerifyOopClosure: public OopClosure {
private:
G1CollectedHeap* _g1h;
bool _failures;
oop _containing_obj;
VerifyOption _verify_option;
public:
int _cc;
G1VerifyOopClosure(VerifyOption option);
void set_containing_obj(oop obj) {
_containing_obj = obj;
}
bool failures() { return _failures; }
void print_object(outputStream* out, oop obj);
template <class T> void do_oop_nv(T* p);
void do_oop(oop* p) { do_oop_nv(p); }
void do_oop(narrowOop* p) { do_oop_nv(p); }
};
class G1FollowStackClosure: public VoidClosure {
G1FullGCMarker* _marker;
public:
G1FollowStackClosure(G1FullGCMarker* marker) : _marker(marker) {}
virtual void do_void();
};
#endif // SHARE_GC_G1_G1FULLGCOOPCLOSURES_HPP

@ -0,0 +1,128 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_VM_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
#define SHARE_VM_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
#include "gc/g1/g1Allocator.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp"
#include "gc/g1/g1FullGCOopClosures.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "memory/iterator.inline.hpp"
template <typename T>
inline void G1MarkAndPushClosure::do_oop_nv(T* p) {
_marker->mark_and_push(p);
}
inline bool G1MarkAndPushClosure::do_metadata_nv() {
return true;
}
inline void G1MarkAndPushClosure::do_klass_nv(Klass* k) {
_marker->follow_klass(k);
}
inline void G1MarkAndPushClosure::do_cld_nv(ClassLoaderData* cld) {
_marker->follow_cld(cld);
}
template <class T> inline oop G1AdjustClosure::adjust_pointer(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
if (oopDesc::is_null(heap_oop)) {
// NULL reference, return NULL.
return NULL;
}
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
assert(Universe::heap()->is_in(obj), "should be in heap");
if (G1ArchiveAllocator::is_archive_object(obj)) {
// Never forwarding archive objects, return current reference.
return obj;
}
oop forwardee = obj->forwardee();
if (forwardee == NULL) {
// Not forwarded, return current reference.
assert(obj->mark() == markOopDesc::prototype_for_object(obj) || // Correct mark
obj->mark()->must_be_preserved(obj) || // Will be restored by PreservedMarksSet
(UseBiasedLocking && obj->has_bias_pattern()), // Will be restored by BiasedLocking
"Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
p2i(obj), p2i(obj->mark()), p2i(markOopDesc::prototype_for_object(obj)));
return obj;
}
// Forwarded, update and return new reference.
assert(Universe::heap()->is_in_reserved(forwardee), "should be in object space");
oopDesc::encode_store_heap_oop_not_null(p, forwardee);
return forwardee;
}
template <class T>
inline void G1AdjustAndRebuildClosure::add_reference(T* from_field, oop reference, uint worker_id) {
if (HeapRegion::is_in_same_region(from_field, reference)) {
return;
}
_g1h->heap_region_containing(reference)->rem_set()->add_reference(from_field, worker_id);
}
inline size_t G1AdjustAndRebuildClosure::calculate_compaction_delta(oop current, oop forwardee) {
return pointer_delta((HeapWord*)forwardee, (HeapWord*)current);
}
template <class T>
inline T* G1AdjustAndRebuildClosure::add_compaction_delta(T* p) {
return (T*)((HeapWord*)p + _compaction_delta);
}
template<typename T>
void G1AdjustAndRebuildClosure::do_oop_nv(T* p) {
oop new_reference = G1AdjustClosure::adjust_pointer(p);
if (new_reference == NULL) {
return;
}
// Update p using the calculated compaction delta to
// get the new field address.
T* new_field = add_compaction_delta(p);
// Update the remembered set.
add_reference(new_field, new_reference, _worker_id);
}
inline int G1AdjustObjectClosure::adjust_object(oop obj) {
_closure->update_compaction_delta(obj);
return obj->oop_iterate_size(_closure);
}
inline bool G1IsAliveClosure::do_object_b(oop p) {
return _bitmap->is_marked(p) || G1ArchiveAllocator::is_closed_archive_object(p);
}
template<typename T>
inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
_marker->mark_and_push(p);
}
#endif

@ -0,0 +1,220 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/g1FullGCPrepareTask.hpp"
#include "gc/g1/g1HotCardCache.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "logging/log.hpp"
#include "utilities/ticks.inline.hpp"
bool G1FullGCPrepareTask::G1CalculatePointersClosure::doHeapRegion(HeapRegion* hr) {
if (hr->is_humongous()) {
oop obj = oop(hr->humongous_start_region()->bottom());
if (_bitmap->is_marked(obj)) {
if (hr->is_starts_humongous()) {
obj->forward_to(obj);
}
} else {
free_humongous_region(hr);
}
} else if (!hr->is_pinned()) {
prepare_for_compaction(hr);
}
// Reset data structures not valid after Full GC.
reset_region_metadata(hr);
return false;
}
G1FullGCPrepareTask::G1FullGCPrepareTask(G1FullCollector* collector) :
G1FullGCTask("G1 Prepare Compact Task", collector),
_hrclaimer(collector->workers()),
_freed_regions(false) {
}
void G1FullGCPrepareTask::set_freed_regions() {
if (!_freed_regions) {
_freed_regions = true;
}
}
bool G1FullGCPrepareTask::has_freed_regions() {
return _freed_regions;
}
void G1FullGCPrepareTask::work(uint worker_id) {
Ticks start = Ticks::now();
G1FullGCCompactionPoint* compaction_point = collector()->compaction_point(worker_id);
G1CalculatePointersClosure closure(collector()->mark_bitmap(), compaction_point);
G1CollectedHeap::heap()->heap_region_par_iterate_from_start(&closure, &_hrclaimer);
// Update humongous region sets
closure.update_sets();
compaction_point->update();
// Check if any regions was freed by this worker and store in task.
if (closure.freed_regions()) {
set_freed_regions();
}
log_task("Prepare compaction task", worker_id, start);
}
G1FullGCPrepareTask::G1CalculatePointersClosure::G1CalculatePointersClosure(G1CMBitMap* bitmap,
G1FullGCCompactionPoint* cp) :
_g1h(G1CollectedHeap::heap()),
_bitmap(bitmap),
_cp(cp),
_humongous_regions_removed(0) { }
void G1FullGCPrepareTask::G1CalculatePointersClosure::free_humongous_region(HeapRegion* hr) {
FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
hr->set_containing_set(NULL);
_humongous_regions_removed++;
_g1h->free_humongous_region(hr, &dummy_free_list, false /* skip_remset */);
prepare_for_compaction(hr);
dummy_free_list.remove_all();
}
void G1FullGCPrepareTask::G1CalculatePointersClosure::reset_region_metadata(HeapRegion* hr) {
hr->reset_gc_time_stamp();
hr->rem_set()->clear();
_g1h->g1_barrier_set()->clear(MemRegion(hr->bottom(), hr->end()));
if (_g1h->g1_hot_card_cache()->use_cache()) {
_g1h->g1_hot_card_cache()->reset_card_counts(hr);
}
}
G1FullGCPrepareTask::G1PrepareCompactLiveClosure::G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp) :
_cp(cp) { }
size_t G1FullGCPrepareTask::G1PrepareCompactLiveClosure::apply(oop object) {
size_t size = object->size();
_cp->forward(object, size);
return size;
}
size_t G1FullGCPrepareTask::G1RePrepareClosure::apply(oop obj) {
// We only re-prepare objects forwarded within the current region, so
// skip objects that are already forwarded to another region.
oop forwarded_to = obj->forwardee();
if (forwarded_to != NULL && !_current->is_in(forwarded_to)) {
return obj->size();
}
// Get size and forward.
size_t size = obj->size();
_cp->forward(obj, size);
return size;
}
void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction_work(G1FullGCCompactionPoint* cp,
HeapRegion* hr) {
G1PrepareCompactLiveClosure prepare_compact(cp);
hr->set_compaction_top(hr->bottom());
hr->apply_to_marked_objects(_bitmap, &prepare_compact);
}
void G1FullGCPrepareTask::G1CalculatePointersClosure::prepare_for_compaction(HeapRegion* hr) {
if (!_cp->is_initialized()) {
hr->set_compaction_top(hr->bottom());
_cp->initialize(hr, true);
}
// Add region to the compaction queue and prepare it.
_cp->add(hr);
prepare_for_compaction_work(_cp, hr);
}
void G1FullGCPrepareTask::prepare_serial_compaction() {
GCTraceTime(Debug, gc, phases) debug("Phase 2: Prepare Serial Compaction", collector()->scope()->timer());
// At this point we know that no regions were completely freed by
// the parallel compaction. That means that the last region of
// all compaction queues still have data in them. We try to compact
// these regions in serial to avoid a premature OOM.
for (uint i = 0; i < collector()->workers(); i++) {
G1FullGCCompactionPoint* cp = collector()->compaction_point(i);
if (cp->has_regions()) {
collector()->serial_compaction_point()->add(cp->remove_last());
}
}
// Update the forwarding information for the regions in the serial
// compaction point.
G1FullGCCompactionPoint* cp = collector()->serial_compaction_point();
for (GrowableArrayIterator<HeapRegion*> it = cp->regions()->begin(); it != cp->regions()->end(); ++it) {
HeapRegion* current = *it;
if (!cp->is_initialized()) {
// Initialize the compaction point. Nothing more is needed for the first heap region
// since it is already prepared for compaction.
cp->initialize(current, false);
} else {
assert(!current->is_humongous(), "Should be no humongous regions in compaction queue");
G1RePrepareClosure re_prepare(cp, current);
current->set_compaction_top(current->bottom());
current->apply_to_marked_objects(collector()->mark_bitmap(), &re_prepare);
}
}
cp->update();
}
void G1FullGCPrepareTask::G1CalculatePointersClosure::update_sets() {
// We'll recalculate total used bytes and recreate the free list
// at the end of the GC, so no point in updating those values here.
_g1h->remove_from_old_sets(0, _humongous_regions_removed);
}
bool G1FullGCPrepareTask::G1CalculatePointersClosure::freed_regions() {
if (_humongous_regions_removed > 0) {
// Free regions from dead humongous regions.
return true;
}
if (!_cp->has_regions()) {
// No regions in queue, so no free ones either.
return false;
}
if (_cp->current_region() != _cp->regions()->last()) {
// The current region used for compaction is not the last in the
// queue. That means there is at least one free region in the queue.
return true;
}
// No free regions in the queue.
return false;
}

@ -0,0 +1,96 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCPREPARETASK_HPP
#define SHARE_GC_G1_G1FULLGCPREPARETASK_HPP
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/heapRegionManager.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "utilities/ticks.hpp"
class G1CMBitMap;
class G1FullGCPrepareTask : public G1FullGCTask {
protected:
volatile bool _freed_regions;
HeapRegionClaimer _hrclaimer;
void set_freed_regions();
public:
G1FullGCPrepareTask(G1FullCollector* collector);
void work(uint worker_id);
void prepare_serial_compaction();
bool has_freed_regions();
protected:
class G1CalculatePointersClosure : public HeapRegionClosure {
protected:
G1CollectedHeap* _g1h;
G1CMBitMap* _bitmap;
G1FullGCCompactionPoint* _cp;
uint _humongous_regions_removed;
virtual void prepare_for_compaction(HeapRegion* hr);
void prepare_for_compaction_work(G1FullGCCompactionPoint* cp, HeapRegion* hr);
void free_humongous_region(HeapRegion* hr);
void reset_region_metadata(HeapRegion* hr);
public:
G1CalculatePointersClosure(G1CMBitMap* bitmap,
G1FullGCCompactionPoint* cp);
void update_sets();
bool doHeapRegion(HeapRegion* hr);
bool freed_regions();
};
class G1PrepareCompactLiveClosure : public StackObj {
G1FullGCCompactionPoint* _cp;
public:
G1PrepareCompactLiveClosure(G1FullGCCompactionPoint* cp);
size_t apply(oop object);
};
class G1RePrepareClosure : public StackObj {
G1FullGCCompactionPoint* _cp;
HeapRegion* _current;
public:
G1RePrepareClosure(G1FullGCCompactionPoint* hrcp,
HeapRegion* hr) :
_cp(hrcp),
_current(hr) { }
size_t apply(oop object);
};
};
#endif // SHARE_GC_G1_G1FULLGCPREPARETASK_HPP

@ -0,0 +1,115 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1FullGCMarker.hpp"
#include "gc/g1/g1FullGCOopClosures.inline.hpp"
#include "gc/g1/g1FullGCReferenceProcessorExecutor.hpp"
#include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
G1FullGCReferenceProcessingExecutor::G1FullGCReferenceProcessingExecutor(G1FullCollector* collector) :
_collector(collector),
_reference_processor(collector->reference_processor()),
_old_mt_degree(_reference_processor->num_q()) {
if (_reference_processor->processing_is_mt()) {
_reference_processor->set_active_mt_degree(_collector->workers());
}
}
G1FullGCReferenceProcessingExecutor::~G1FullGCReferenceProcessingExecutor() {
if (_reference_processor->processing_is_mt()) {
_reference_processor->set_active_mt_degree(_old_mt_degree);
}
}
G1FullGCReferenceProcessingExecutor::G1RefProcTaskProxy::G1RefProcTaskProxy(ProcessTask& proc_task,
G1FullCollector* collector) :
AbstractGangTask("G1 reference processing task"),
_proc_task(proc_task),
_collector(collector),
_terminator(_collector->workers(), _collector->oop_queue_set()) { }
void G1FullGCReferenceProcessingExecutor::G1RefProcTaskProxy::work(uint worker_id) {
G1FullGCMarker* marker = _collector->marker(worker_id);
G1IsAliveClosure is_alive(_collector->mark_bitmap());
G1FullKeepAliveClosure keep_alive(marker);
_proc_task.work(worker_id,
is_alive,
keep_alive,
*marker->stack_closure());
}
G1FullGCReferenceProcessingExecutor::G1RefEnqueueTaskProxy::G1RefEnqueueTaskProxy(EnqueueTask& enq_task) :
AbstractGangTask("G1 reference enqueue task"),
_enq_task(enq_task) { }
void G1FullGCReferenceProcessingExecutor::G1RefEnqueueTaskProxy::work(uint worker_id) {
_enq_task.work(worker_id);
}
void G1FullGCReferenceProcessingExecutor::run_task(AbstractGangTask* task) {
G1CollectedHeap::heap()->workers()->run_task(task, _collector->workers());
}
void G1FullGCReferenceProcessingExecutor::execute(ProcessTask& proc_task) {
G1RefProcTaskProxy proc_task_proxy(proc_task, _collector);
run_task(&proc_task_proxy);
}
// Driver routine for parallel reference processing.
void G1FullGCReferenceProcessingExecutor::execute(EnqueueTask& enq_task) {
G1RefEnqueueTaskProxy enq_task_proxy(enq_task);
run_task(&enq_task_proxy);
}
void G1FullGCReferenceProcessingExecutor::execute(STWGCTimer* timer, G1FullGCTracer* tracer) {
GCTraceTime(Debug, gc, phases) debug("Phase 1: Reference Processing", timer);
// Process reference objects found during marking.
G1FullGCMarker* marker = _collector->marker(0);
G1IsAliveClosure is_alive(_collector->mark_bitmap());
G1FullKeepAliveClosure keep_alive(marker);
ReferenceProcessorPhaseTimes pt(timer, _reference_processor->num_q());
AbstractRefProcTaskExecutor* executor = _reference_processor->processing_is_mt() ? this : NULL;
// Process discovered references, use this executor if multi-threaded
// processing is enabled.
const ReferenceProcessorStats& stats =
_reference_processor->process_discovered_references(&is_alive,
&keep_alive,
marker->stack_closure(),
executor,
&pt);
tracer->report_gc_reference_stats(stats);
pt.print_all_references();
assert(marker->oop_stack()->is_empty(), "Should be no oops on the stack");
// Now enqueue the references.
_reference_processor->enqueue_discovered_references(executor, &pt);
pt.print_enqueue_phase();
}

@ -0,0 +1,82 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCREFERENCEPROCESSOREXECUTOR_HPP
#define SHARE_GC_G1_G1FULLGCREFERENCEPROCESSOREXECUTOR_HPP
#include "gc/g1/g1FullGCCompactionPoint.hpp"
#include "gc/g1/g1FullGCScope.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/g1StringDedup.hpp"
#include "gc/g1/heapRegionManager.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "utilities/ticks.hpp"
class G1FullGCTracer;
class STWGCTimer;
class G1FullGCReferenceProcessingExecutor: public AbstractRefProcTaskExecutor {
G1FullCollector* _collector;
ReferenceProcessor* _reference_processor;
uint _old_mt_degree;
public:
G1FullGCReferenceProcessingExecutor(G1FullCollector* collector);
~G1FullGCReferenceProcessingExecutor();
// Do reference processing.
void execute(STWGCTimer* timer, G1FullGCTracer* tracer);
// Executes the given task using concurrent marking worker threads.
virtual void execute(ProcessTask& task);
virtual void execute(EnqueueTask& task);
private:
void run_task(AbstractGangTask* task);
class G1RefProcTaskProxy : public AbstractGangTask {
typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask;
ProcessTask& _proc_task;
G1FullCollector* _collector;
ParallelTaskTerminator _terminator;
public:
G1RefProcTaskProxy(ProcessTask& proc_task,
G1FullCollector* scope);
virtual void work(uint worker_id);
};
class G1RefEnqueueTaskProxy: public AbstractGangTask {
typedef AbstractRefProcTaskExecutor::EnqueueTask EnqueueTask;
EnqueueTask& _enq_task;
public:
G1RefEnqueueTaskProxy(EnqueueTask& enq_task);
virtual void work(uint worker_id);
};
};
#endif // SHARE_GC_G1_G1FULLGCREFERENCEPROCESSOREXECUTOR_HPP

@ -25,13 +25,6 @@
#include "precompiled.hpp"
#include "gc/g1/g1FullGCScope.hpp"
G1FullGCScope* G1FullGCScope::_instance = NULL;
G1FullGCScope* G1FullGCScope::instance() {
assert(_instance != NULL, "Must be setup already");
return _instance;
}
G1FullGCScope::G1FullGCScope(bool explicit_gc, bool clear_soft) :
_rm(),
_explicit_gc(explicit_gc),
@ -46,12 +39,10 @@ G1FullGCScope::G1FullGCScope(bool explicit_gc, bool clear_soft) :
_memory_stats(true, _g1h->gc_cause()),
_collector_stats(_g1h->g1mm()->full_collection_counters()),
_heap_transition(_g1h) {
assert(_instance == NULL, "Only one scope at a time");
_timer.register_gc_start();
_tracer.report_gc_start(_g1h->gc_cause(), _timer.gc_start());
_g1h->pre_full_gc_dump(&_timer);
_g1h->trace_heap_before_gc(&_tracer);
_instance = this;
}
G1FullGCScope::~G1FullGCScope() {
@ -64,7 +55,6 @@ G1FullGCScope::~G1FullGCScope() {
_g1h->post_full_gc_dump(&_timer);
_timer.register_gc_end();
_tracer.report_gc_end(_timer.gc_end(), _timer.time_partitions());
_instance = NULL;
}
bool G1FullGCScope::is_explicit_gc() {
@ -79,7 +69,7 @@ STWGCTimer* G1FullGCScope::timer() {
return &_timer;
}
SerialOldTracer* G1FullGCScope::tracer() {
G1FullGCTracer* G1FullGCScope::tracer() {
return &_tracer;
}

@ -45,7 +45,7 @@ class G1FullGCScope : public StackObj {
GCIdMark _gc_id;
SvcGCMarker _svc_marker;
STWGCTimer _timer;
SerialOldTracer _tracer;
G1FullGCTracer _tracer;
IsGCActiveMark _active;
GCTraceCPUTime _cpu_time;
ClearedAllSoftRefs _soft_refs;
@ -53,11 +53,7 @@ class G1FullGCScope : public StackObj {
TraceMemoryManagerStats _memory_stats;
G1HeapTransition _heap_transition;
// Singleton instance.
static G1FullGCScope* _instance;
public:
static G1FullGCScope* instance();
G1FullGCScope(bool explicit_gc, bool clear_soft);
~G1FullGCScope();
@ -65,7 +61,7 @@ public:
bool should_clear_soft_refs();
STWGCTimer* timer();
SerialOldTracer* tracer();
G1FullGCTracer* tracer();
G1HeapTransition* heap_transition();
};

@ -0,0 +1,34 @@
/*
* Copyright (c) 2017, 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.
*
*/
#include "precompiled.hpp"
#include "gc/g1/g1FullGCTask.hpp"
#include "logging/log.hpp"
#include "utilities/ticks.inline.hpp"
void G1FullGCTask::log_task(const char* name, uint worker_id, const Ticks& start, const Ticks& stop) {
Tickspan duration = stop - start;
double duration_ms = TimeHelper::counter_to_millis(duration.value());
log_trace(gc, phases)("%s (%u) %.3fms", name, worker_id, duration_ms);
}

@ -0,0 +1,45 @@
/*
* Copyright (c) 2017, 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.
*
*/
#ifndef SHARE_GC_G1_G1FULLGCTASK_HPP
#define SHARE_GC_G1_G1FULLGCTASK_HPP
#include "gc/shared/workgroup.hpp"
#include "utilities/ticks.hpp"
class G1FullCollector;
class G1FullGCTask : public AbstractGangTask {
G1FullCollector* _collector;
protected:
G1FullGCTask(const char* name, G1FullCollector* collector) :
AbstractGangTask(name),
_collector(collector) { }
G1FullCollector* collector() { return _collector; }
void log_task(const char* name, uint worker_id, const Ticks& start, const Ticks& stop = Ticks::now());
};
#endif // SHARE_GC_G1_G1FULLGCTASK_HPP

Some files were not shown because too many files have changed in this diff Show More