Skip to content
Snippets Groups Projects
Commit 5e90278a authored by J. Duke's avatar J. Duke
Browse files

Merge

parents ac5f1cc5 d3a7543e
Branches
Tags
No related merge requests found
Showing
with 480 additions and 54 deletions
...@@ -264,3 +264,4 @@ cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16 ...@@ -264,3 +264,4 @@ cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
75a08df650eb3126bab0c4d15241f5886162393c jdk9-b19 75a08df650eb3126bab0c4d15241f5886162393c jdk9-b19
ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20 ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20
9052803f4d01feda28b3d65f2b64dd457d21c7b6 jdk9-b21 9052803f4d01feda28b3d65f2b64dd457d21c7b6 jdk9-b21
8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22
...@@ -69,8 +69,8 @@ ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR) ...@@ -69,8 +69,8 @@ ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR)
# Yet another name for arch used for an extra subdir below the jvm lib. # Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of x86 and x86_64. # Uses i386 and amd64, instead of x86 and x86_64.
LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB) LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of x86 and x86_64. # Set the cpu architecture
ARCH=$(OPENJDK_TARGET_CPU_LEGACY) ARCH=$(OPENJDK_TARGET_CPU_ARCH)
# Legacy setting for building for a 64 bit machine. # Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64:=1 # If yes then this expands to _LP64:=1
@LP64@ @LP64@
......
...@@ -264,3 +264,4 @@ e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15 ...@@ -264,3 +264,4 @@ e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19 eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19
87f36eecb1665012d01c5cf102494e591c943ea6 jdk9-b20 87f36eecb1665012d01c5cf102494e591c943ea6 jdk9-b20
3615a4e7f0542ca7552ad6454b742c73ee211d8e jdk9-b21 3615a4e7f0542ca7552ad6454b742c73ee211d8e jdk9-b21
ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22
...@@ -25,11 +25,34 @@ ...@@ -25,11 +25,34 @@
# questions. # questions.
# #
to_stderr() {
echo "$@" >&2
}
error() {
to_stderr "ERROR: $1"
exit ${2:-126}
}
warning() {
to_stderr "WARNING: $1"
}
version_field() {
# rev is typically omitted for minor and major releases
field=`echo ${1}.0 | cut -f ${2} -d .`
if expr 1 + $field >/dev/null 2> /dev/null; then
echo $field
else
echo -1
fi
}
# Version check # Version check
# required # required
reqdmajor=1 reqdmajor=1
reqdminor=5 reqdminor=4
reqdrev=0 reqdrev=0
# requested # requested
...@@ -37,34 +60,39 @@ rqstmajor=2 ...@@ -37,34 +60,39 @@ rqstmajor=2
rqstminor=6 rqstminor=6
rqstrev=3 rqstrev=3
# installed # installed
hgwhere="`which hg 2> /dev/null | grep -v '^no hg in '`" hgwhere="`command -v hg`"
if [ "x$hgwhere" = "x" ]; then if [ "x$hgwhere" = "x" ]; then
echo "ERROR: Could not locate Mercurial command" >&2 error "Could not locate Mercurial command"
exit 126
fi fi
hgversion="`hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \(.*\))\$@\1@p'`" hgversion="`hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`"
if [ "x${hgversion}" = "x" ] ; then if [ "x${hgversion}" = "x" ] ; then
echo "ERROR: Could not determine Mercurial version" >&2 error "Could not determine Mercurial version of $hgwhere"
exit 126 fi
hgmajor="`version_field $hgversion 1`"
hgminor="`version_field $hgversion 2`"
hgrev="`version_field $hgversion 3`"
if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then
error "Could not determine Mercurial version of $hgwhere from \"$hgversion\""
fi fi
hgmajor="`echo $hgversion | cut -f 1 -d .`"
hgminor="`echo $hgversion | cut -f 2 -d .`"
hgrev="`echo $hgversion.0 | cut -f 3 -d .`" # rev is omitted for minor and major releases
# Require # Require
if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then
echo "ERROR: Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion" >&2 error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion"
exit 126
fi fi
# Request # Request
if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then
echo "WARNING: Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion" >&2 warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion"
fi fi
# Get clones of all absent nested repositories (harmless if already exist) # Get clones of all absent nested repositories (harmless if already exist)
sh ./common/bin/hgforest.sh clone "$@" || exit $? sh ./common/bin/hgforest.sh clone "$@" || exit $?
......
...@@ -424,3 +424,4 @@ b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16 ...@@ -424,3 +424,4 @@ b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19 d4cffb3ae6213c66c7522ebffe0349360a45f0ef jdk9-b19
c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20 c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20
17b4a5e831b398738feedb0afe75245744510153 jdk9-b21 17b4a5e831b398738feedb0afe75245744510153 jdk9-b21
518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012, 2013 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -23,9 +22,24 @@ ...@@ -23,9 +22,24 @@
* *
*/ */
#include "precompiled.hpp" package sun.jvm.hotspot.gc_interface;
#include "interpreter/bytecodes.hpp"
void Bytecodes::pd_initialize() { //These definitions should be kept in sync with the definitions in the HotSpot
// No ppc specific initialization. //code.
public enum G1YCType {
Normal ("Normal"),
InitialMark ("Initial Mark"),
DuringMark ("During Mark"),
Mixed ("Mixed"),
G1YCTypeEndSentinel ("Unknown");
private final String value;
G1YCType(String val) {
this.value = val;
}
public String value() {
return value;
}
} }
/*
* Copyright (c) 2014, 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum GCCause {
_java_lang_system_gc ("System.gc()"),
_full_gc_alot ("FullGCAlot"),
_scavenge_alot ("ScavengeAlot"),
_allocation_profiler ("Allocation Profiler"),
_jvmti_force_gc ("JvmtiEnv ForceGarbageCollection"),
_gc_locker ("GCLocker Initiated GC"),
_heap_inspection ("Heap Inspection Initiated GC"),
_heap_dump ("Heap Dump Initiated GC"),
_no_gc ("No GC"),
_no_cause_specified ("Unknown GCCause"),
_allocation_failure ("Allocation Failure"),
_tenured_generation_full ("Tenured Generation Full"),
_metadata_GC_threshold ("Metadata GC Threshold"),
_cms_generation_full ("CMS Generation Full"),
_cms_initial_mark ("CMS Initial Mark"),
_cms_final_remark ("CMS Final Remark"),
_cms_concurrent_mark ("CMS Concurrent Mark"),
_old_generation_expanded_on_last_scavenge ("Old Generation Expanded On Last Scavenge"),
_old_generation_too_full_to_scavenge ("Old Generation Too Full To Scavenge"),
_adaptive_size_policy ("Ergonomics"),
_g1_inc_collection_pause ("G1 Evacuation Pause"),
_g1_humongous_allocation ("G1 Humongous Allocation"),
_last_ditch_collection ("Last ditch collection"),
_last_gc_cause ("ILLEGAL VALUE - last gc cause - ILLEGAL VALUE");
private final String value;
GCCause(String val) {
this.value = val;
}
public String value() {
return value;
}
}
/*
* Copyright (c) 2014, 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum GCName {
ParallelOld ("ParallelOld"),
SerialOld ("SerialOld"),
PSMarkSweep ("PSMarkSweep"),
ParallelScavenge ("ParallelScavenge"),
DefNew ("DefNew"),
ParNew ("ParNew"),
G1New ("G1New"),
ConcurrentMarkSweep ("ConcurrentMarkSweep"),
G1Old ("G1Old"),
GCNameEndSentinel ("GCNameEndSentinel");
private final String value;
GCName(String val) {
this.value = val;
}
public String value() {
return value;
}
}
/* /*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -22,14 +22,24 @@ ...@@ -22,14 +22,24 @@
* *
*/ */
#include "precompiled.hpp" package sun.jvm.hotspot.gc_interface;
#include "interpreter/bytecodes.hpp"
//These definitions should be kept in sync with the definitions in the HotSpot code.
void Bytecodes::pd_initialize() { public enum GCWhen {
// (nothing) BeforeGC ("Before GC"),
} AfterGC ("After GC"),
GCWhenEndSentinel ("GCWhenEndSentinel");
private final String value;
Bytecodes::Code Bytecodes::pd_base_code_for(Code code) { GCWhen(String val) {
return code; this.value = val;
}
public String value() {
return value;
}
} }
/*
* Copyright (c) 2014, 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.
*
*/
package sun.jvm.hotspot.gc_interface;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum ReferenceType {
REF_NONE ("None reference"), // Regular class
REF_OTHER ("Other reference"), // Subclass of java/lang/ref/Reference, but not subclass of one of the classes below
REF_SOFT ("Soft reference"), // Subclass of java/lang/ref/SoftReference
REF_WEAK ("Weak reference"), // Subclass of java/lang/ref/WeakReference
REF_FINAL ("Final reference"), // Subclass of java/lang/ref/FinalReference
REF_PHANTOM ("Phantom reference"); // Subclass of java/lang/ref/PhantomReference
private final String value;
ReferenceType(String val) {
this.value = val;
}
public String value() {
return value;
}
}
...@@ -56,6 +56,12 @@ public class Universe { ...@@ -56,6 +56,12 @@ public class Universe {
private static AddressField narrowKlassBaseField; private static AddressField narrowKlassBaseField;
private static CIntegerField narrowKlassShiftField; private static CIntegerField narrowKlassShiftField;
public enum NARROW_OOP_MODE {
UnscaledNarrowOop,
ZeroBasedNarrowOop,
HeapBasedNarrowOop
}
static { static {
VM.registerVMInitializedObserver(new Observer() { VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) { public void update(Observable o, Object data) {
...@@ -94,7 +100,17 @@ public class Universe { ...@@ -94,7 +100,17 @@ public class Universe {
public Universe() { public Universe() {
} }
public static String narrowOopModeToString(NARROW_OOP_MODE mode) {
switch (mode) {
case UnscaledNarrowOop:
return "32-bits Oops";
case ZeroBasedNarrowOop:
return "zero based Compressed Oops";
case HeapBasedNarrowOop:
return "Compressed Oops with base";
}
return "";
}
public CollectedHeap heap() { public CollectedHeap heap() {
try { try {
return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue()); return (CollectedHeap) heapConstructor.instantiateWrapperFor(collectedHeapField.getValue());
......
...@@ -55,6 +55,7 @@ public class Klass extends Metadata implements ClassConstants { ...@@ -55,6 +55,7 @@ public class Klass extends Metadata implements ClassConstants {
layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0); layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0);
name = type.getAddressField("_name"); name = type.getAddressField("_name");
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
traceIDField = type.getField("_trace_id");
subklass = new MetadataField(type.getAddressField("_subklass"), 0); subklass = new MetadataField(type.getAddressField("_subklass"), 0);
nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0); nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0);
...@@ -86,6 +87,7 @@ public class Klass extends Metadata implements ClassConstants { ...@@ -86,6 +87,7 @@ public class Klass extends Metadata implements ClassConstants {
private static CIntField accessFlags; private static CIntField accessFlags;
private static MetadataField subklass; private static MetadataField subklass;
private static MetadataField nextSibling; private static MetadataField nextSibling;
private static sun.jvm.hotspot.types.Field traceIDField;
private Address getValue(AddressField field) { private Address getValue(AddressField field) {
return addr.getAddressAt(field.getOffset()); return addr.getAddressAt(field.getOffset());
...@@ -106,6 +108,7 @@ public class Klass extends Metadata implements ClassConstants { ...@@ -106,6 +108,7 @@ public class Klass extends Metadata implements ClassConstants {
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); } public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); } public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); }
public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); } public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); }
public long traceID() { return traceIDField.getJLong(addr); }
// computed access flags - takes care of inner classes etc. // computed access flags - takes care of inner classes etc.
// This is closer to actual source level than getAccessFlags() etc. // This is closer to actual source level than getAccessFlags() etc.
......
...@@ -54,6 +54,8 @@ public class OopUtilities implements /* imports */ JVMTIThreadState { ...@@ -54,6 +54,8 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
private static OopField threadNameField; private static OopField threadNameField;
private static OopField threadGroupField; private static OopField threadGroupField;
private static LongField threadEETopField; private static LongField threadEETopField;
//tid field is new since 1.5
private static LongField threadTIDField;
// threadStatus field is new since 1.5 // threadStatus field is new since 1.5
private static IntField threadStatusField; private static IntField threadStatusField;
// parkBlocker field is new since 1.6 // parkBlocker field is new since 1.6
...@@ -220,6 +222,7 @@ public class OopUtilities implements /* imports */ JVMTIThreadState { ...@@ -220,6 +222,7 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
threadNameField = (OopField) k.findField("name", "[C"); threadNameField = (OopField) k.findField("name", "[C");
threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;"); threadGroupField = (OopField) k.findField("group", "Ljava/lang/ThreadGroup;");
threadEETopField = (LongField) k.findField("eetop", "J"); threadEETopField = (LongField) k.findField("eetop", "J");
threadTIDField = (LongField) k.findField("tid", "J");
threadStatusField = (IntField) k.findField("threadStatus", "I"); threadStatusField = (IntField) k.findField("threadStatus", "I");
threadParkBlockerField = (OopField) k.findField("parkBlocker", threadParkBlockerField = (OopField) k.findField("parkBlocker",
"Ljava/lang/Object;"); "Ljava/lang/Object;");
...@@ -268,6 +271,15 @@ public class OopUtilities implements /* imports */ JVMTIThreadState { ...@@ -268,6 +271,15 @@ public class OopUtilities implements /* imports */ JVMTIThreadState {
return VM.getVM().getThreads().createJavaThreadWrapper(addr); return VM.getVM().getThreads().createJavaThreadWrapper(addr);
} }
public static long threadOopGetTID(Oop threadOop) {
initThreadFields();
if (threadTIDField != null) {
return threadTIDField.getValue(threadOop);
} else {
return 0;
}
}
/** returns value of java.lang.Thread.threadStatus field */ /** returns value of java.lang.Thread.threadStatus field */
public static int threadOopGetThreadStatus(Oop threadOop) { public static int threadOopGetThreadStatus(Oop threadOop) {
initThreadFields(); initThreadFields();
......
/*
* Copyright (c) 2014, 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.
*
*/
package sun.jvm.hotspot.opto;
//These definitions should be kept in sync with the definitions in the HotSpot code.
public enum CompilerPhaseType {
PHASE_BEFORE_STRINGOPTS ("Before StringOpts"),
PHASE_AFTER_STRINGOPTS ("After StringOpts"),
PHASE_BEFORE_REMOVEUSELESS ("Before RemoveUseless"),
PHASE_AFTER_PARSING ("After Parsing"),
PHASE_ITER_GVN1 ("Iter GVN 1"),
PHASE_PHASEIDEAL_BEFORE_EA ("PhaseIdealLoop before EA"),
PHASE_ITER_GVN_AFTER_EA ("Iter GVN after EA"),
PHASE_ITER_GVN_AFTER_ELIMINATION ("Iter GVN after eliminating allocations and locks"),
PHASE_PHASEIDEALLOOP1 ("PhaseIdealLoop 1"),
PHASE_PHASEIDEALLOOP2 ("PhaseIdealLoop 2"),
PHASE_PHASEIDEALLOOP3 ("PhaseIdealLoop 3"),
PHASE_CPP1 ("PhaseCPP 1"),
PHASE_ITER_GVN2 ("Iter GVN 2"),
PHASE_PHASEIDEALLOOP_ITERATIONS ("PhaseIdealLoop iterations"),
PHASE_OPTIMIZE_FINISHED ("Optimize finished"),
PHASE_GLOBAL_CODE_MOTION ("Global code motion"),
PHASE_FINAL_CODE ("Final Code"),
PHASE_AFTER_EA ("After Escape Analysis"),
PHASE_BEFORE_CLOOPS ("Before CountedLoop"),
PHASE_AFTER_CLOOPS ("After CountedLoop"),
PHASE_BEFORE_BEAUTIFY_LOOPS ("Before beautify loops"),
PHASE_AFTER_BEAUTIFY_LOOPS ("After beautify loops"),
PHASE_BEFORE_MATCHING ("Before Matching"),
PHASE_INCREMENTAL_INLINE ("Incremental Inline"),
PHASE_INCREMENTAL_BOXING_INLINE ("Incremental Boxing Inline"),
PHASE_END ("End"),
PHASE_FAILURE ("Failure"),
PHASE_NUM_TYPES ("Number of Phase Types");
private final String value;
CompilerPhaseType(String val) {
this.value = val;
}
public String value() {
return value;
}
}
/* /*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -19,27 +19,30 @@ ...@@ -19,27 +19,30 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 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 * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*
*/ */
import sun.misc.Unsafe; package sun.jvm.hotspot.runtime;
import java.lang.reflect.Field;
@SuppressWarnings("sunapi") //These definitions should be kept in sync with the definitions in the HotSpot code.
public class Test8001071 {
public static Unsafe unsafe;
static { public enum Flags {
try { // value origin
Field f = Unsafe.class.getDeclaredField("theUnsafe"); DEFAULT ("Default"),
f.setAccessible(true); COMMAND_LINE ("Command line"),
unsafe = (Unsafe) f.get(null); ENVIRON_VAR ("Environment variable"),
} catch ( Exception e ) { CONFIG_FILE ("Config file"),
e.printStackTrace(); MANAGEMENT ("Management"),
} ERGONOMIC ("Ergonomic"),
} ATTACH_ON_DEMAND ("Attach on demand"),
INTERNAL ("Internal");
public static void main(String args[]) { private final String value;
unsafe.getObject(new Test8001071(), Short.MAX_VALUE);
}
Flags(String val) {
this.value = val;
}
public String value() {
return value;
}
} }
...@@ -41,6 +41,8 @@ public class Thread extends VMObject { ...@@ -41,6 +41,8 @@ public class Thread extends VMObject {
private static AddressField currentPendingMonitorField; private static AddressField currentPendingMonitorField;
private static AddressField currentWaitingMonitorField; private static AddressField currentWaitingMonitorField;
private static JLongField allocatedBytesField;
static { static {
VM.registerVMInitializedObserver(new Observer() { VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) { public void update(Observable o, Object data) {
...@@ -61,6 +63,7 @@ public class Thread extends VMObject { ...@@ -61,6 +63,7 @@ public class Thread extends VMObject {
activeHandlesField = type.getAddressField("_active_handles"); activeHandlesField = type.getAddressField("_active_handles");
currentPendingMonitorField = type.getAddressField("_current_pending_monitor"); currentPendingMonitorField = type.getAddressField("_current_pending_monitor");
currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor"); currentWaitingMonitorField = type.getAddressField("_current_waiting_monitor");
allocatedBytesField = type.getJLongField("_allocated_bytes");
} }
public Thread(Address addr) { public Thread(Address addr) {
...@@ -104,6 +107,10 @@ public class Thread extends VMObject { ...@@ -104,6 +107,10 @@ public class Thread extends VMObject {
return new JNIHandleBlock(a); return new JNIHandleBlock(a);
} }
public long allocatedBytes() {
return allocatedBytesField.getValue(addr);
}
public boolean isVMThread() { return false; } public boolean isVMThread() { return false; }
public boolean isJavaThread() { return false; } public boolean isJavaThread() { return false; }
public boolean isCompilerThread() { return false; } public boolean isCompilerThread() { return false; }
......
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -23,9 +22,65 @@ ...@@ -23,9 +22,65 @@
* *
*/ */
#include "precompiled.hpp" package sun.jvm.hotspot.runtime;
#include "interpreter/bytecodes.hpp"
void Bytecodes::pd_initialize() { //These definitions should be kept in sync with the definitions in the HotSpot code.
// No zero specific initialization
public enum VMOps {
Dummy,
ThreadStop,
ThreadDump,
PrintThreads,
FindDeadlocks,
ForceSafepoint,
ForceAsyncSafepoint,
Deoptimize,
DeoptimizeFrame,
DeoptimizeAll,
ZombieAll,
UnlinkSymbols,
Verify,
PrintJNI,
HeapDumper,
DeoptimizeTheWorld,
CollectForMetadataAllocation,
GC_HeapInspection,
GenCollectFull,
GenCollectFullConcurrent,
GenCollectForAllocation,
ParallelGCFailedAllocation,
ParallelGCSystemGC,
CGC_Operation,
CMS_Initial_Mark,
CMS_Final_Remark,
G1CollectFull,
G1CollectForAllocation,
G1IncCollectionPause,
EnableBiasedLocking,
RevokeBias,
BulkRevokeBias,
PopulateDumpSharedSpace,
JNIFunctionTableCopier,
RedefineClasses,
GetOwnedMonitorInfo,
GetObjectMonitorUsage,
GetCurrentContendedMonitor,
GetStackTrace,
GetMultipleStackTraces,
GetAllStackTraces,
GetThreadListStackTraces,
GetFrameCount,
GetFrameLocation,
ChangeBreakpoints,
GetOrSetLocal,
GetCurrentLocation,
EnterInterpOnlyMode,
ChangeSingleStep,
HeapWalkOperation,
HeapIterateOperation,
ReportJavaOutOfMemory,
JFRCheckpoint,
Exit,
LinuxDllLoad,
Terminating
} }
...@@ -82,14 +82,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \ ...@@ -82,14 +82,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \ -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
$(JDK_VER_DEFS) $(JDK_VER_DEFS)
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
CXXFLAGS = \ CXXFLAGS = \
${SYSDEFS} \ ${SYSDEFS} \
${INCLUDES} \ ${INCLUDES} \
${BUILD_TARGET} \
${BUILD_USER} \ ${BUILD_USER} \
${HS_LIB_ARCH} \ ${HS_LIB_ARCH} \
${VM_DISTRO} ${VM_DISTRO}
......
...@@ -280,7 +280,10 @@ endif ...@@ -280,7 +280,10 @@ endif
# optimization control flags (Used by fastdebug and release variants) # optimization control flags (Used by fastdebug and release variants)
OPT_CFLAGS/NOOPT=-O0 OPT_CFLAGS/NOOPT=-O0
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1" ifeq ($(USE_CLANG), true)
# Clang does not support -Og
OPT_CFLAGS/DEBUG=-O0
else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination) # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
OPT_CFLAGS/DEBUG=-Og OPT_CFLAGS/DEBUG=-Og
else else
...@@ -319,9 +322,20 @@ endif ...@@ -319,9 +322,20 @@ endif
# Work around some compiler bugs. # Work around some compiler bugs.
ifeq ($(USE_CLANG), true) ifeq ($(USE_CLANG), true)
# Clang 4.2
ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1 OPT_CFLAGS/unsafe.o += -O1
# Clang 5.0
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
# Clang 5.1
else ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 1), 1)
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
OPT_CFLAGS/unsafe.o += -O1
else
$(error "Update compiler workarounds for Clang $(CC_VER_MAJOR).$(CC_VER_MINOR)")
endif endif
else else
# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
...@@ -443,7 +457,10 @@ ifeq ($(USE_CLANG), true) ...@@ -443,7 +457,10 @@ ifeq ($(USE_CLANG), true)
CFLAGS += -flimit-debug-info CFLAGS += -flimit-debug-info
endif endif
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1" ifeq ($(USE_CLANG), true)
# Clang does not support -Og
DEBUG_CFLAGS=-O0
else ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 8 \) \))" "1"
# Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination) # Allow basic optimizations which don't distrupt debugging. (Principally dead code elimination)
DEBUG_CFLAGS=-Og DEBUG_CFLAGS=-Og
else else
......
...@@ -81,14 +81,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \ ...@@ -81,14 +81,12 @@ VM_VER_DEFS = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" \
-DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \ -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" \
$(JDK_VER_DEFS) $(JDK_VER_DEFS)
HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
CXXFLAGS = \ CXXFLAGS = \
${SYSDEFS} \ ${SYSDEFS} \
${INCLUDES} \ ${INCLUDES} \
${BUILD_TARGET} \
${BUILD_USER} \ ${BUILD_USER} \
${HS_LIB_ARCH} \ ${HS_LIB_ARCH} \
${VM_DISTRO} ${VM_DISTRO}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment