--- a/.hgtags-top-repo Thu Oct 11 16:59:50 2012 -0700
+++ b/.hgtags-top-repo Wed Jul 05 18:25:45 2017 +0200
@@ -181,3 +181,4 @@
522dfac8ca4d07c0b74025d4ac3b6e5feefbb829 jdk8-b57
9367024804874faf8e958adeb333682bab1c0c47 jdk8-b58
dae9821589ccd2611bdf7084269b98e819091770 jdk8-b59
+e07f499b9dccb529ecf74172cf6ac11a195ec57a jdk8-b60
--- a/hotspot/.hgtags Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/.hgtags Wed Jul 05 18:25:45 2017 +0200
@@ -283,3 +283,5 @@
f2e12eb74117c917c0bb264694c02de4a6a15a10 hs25-b03
8a1a6b9b4f20fd2f6a12441d638e51f19a82db19 jdk8-b59
1cc7a2a11d00832e3d07f81f3744a6883422db7e hs25-b04
+3cfd05b2219a29649741a52637696f06acf24a4e jdk8-b60
+b261523fe66c40a02968f0aa7e73602491bb3386 hs25-b05
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java Wed Jul 05 18:25:45 2017 +0200
@@ -89,6 +89,7 @@
public Address getAddressAt (long offset) throws UnmappedAddressException, UnalignedAddressException;
/** Returns the decoded address at the given offset */
public Address getCompOopAddressAt (long offset) throws UnmappedAddressException, UnalignedAddressException;
+ public Address getCompKlassAddressAt (long offset) throws UnmappedAddressException, UnalignedAddressException;
//
// Java-related routines
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -121,6 +121,9 @@
public long getHeapOopSize();
public long getNarrowOopBase();
public int getNarrowOopShift();
+ public long getKlassPtrSize();
+ public long getNarrowKlassBase();
+ public int getNarrowKlassShift();
public ReadResult readBytesFromProcess(long address, long numBytes)
throws DebuggerException;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java Wed Jul 05 18:25:45 2017 +0200
@@ -58,6 +58,10 @@
protected long heapOopSize;
protected long narrowOopBase; // heap base for compressed oops.
protected int narrowOopShift; // shift to decode compressed oops.
+ // class metadata space
+ protected long klassPtrSize;
+ protected long narrowKlassBase; // heap base for compressed klass ptrs.
+ protected int narrowKlassShift; // shift to decode compressed klass ptrs.
// Should be initialized if desired by calling initCache()
private PageCache cache;
@@ -159,10 +163,14 @@
javaPrimitiveTypesConfigured = true;
}
- public void putHeapConst(long heapOopSize, long narrowOopBase, int narrowOopShift) {
+ public void putHeapConst(long heapOopSize, long klassPtrSize, long narrowOopBase, int narrowOopShift,
+ long narrowKlassBase, int narrowKlassShift) {
this.heapOopSize = heapOopSize;
+ this.klassPtrSize = klassPtrSize;
this.narrowOopBase = narrowOopBase;
this.narrowOopShift = narrowOopShift;
+ this.narrowKlassBase = narrowKlassBase;
+ this.narrowKlassShift = narrowKlassShift;
}
/** May be called by subclasses if desired to initialize the page
@@ -464,6 +472,15 @@
return value;
}
+ protected long readCompKlassAddressValue(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCInteger(address, getKlassPtrSize(), true);
+ if (value != 0) {
+ value = (long)(narrowKlassBase + (long)(value << narrowKlassShift));
+ }
+ return value;
+ }
+
protected void writeAddressValue(long address, long value)
throws UnmappedAddressException, UnalignedAddressException {
writeCInteger(address, machDesc.getAddressSize(), value);
@@ -551,4 +568,15 @@
public int getNarrowOopShift() {
return narrowOopShift;
}
+
+ public long getKlassPtrSize() {
+ return klassPtrSize;
+ }
+
+ public long getNarrowKlassBase() {
+ return narrowKlassBase;
+ }
+ public int getNarrowKlassShift() {
+ return narrowKlassShift;
+ }
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -42,5 +42,7 @@
long jintSize,
long jlongSize,
long jshortSize);
- public void putHeapConst(long heapOopSize, long narrowOopBase, int narrowOopShift);
+ public void putHeapConst(long heapOopSize, long klassPtrSize,
+ long narrowKlassBase, int narrowKlassShift,
+ long narrowOopBase, int narrowOopShift);
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java Wed Jul 05 18:25:45 2017 +0200
@@ -79,6 +79,11 @@
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset)
+ throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompOopAddress(addr + offset);
+ }
+
//
// Java-related routines
//
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -46,6 +46,7 @@
throws DebuggerException;
public BsdAddress readAddress(long address) throws DebuggerException;
public BsdAddress readCompOopAddress(long address) throws DebuggerException;
+ public BsdAddress readCompKlassAddress(long address) throws DebuggerException;
public BsdOopHandle readOopHandle(long address) throws DebuggerException;
public BsdOopHandle readCompOopHandle(long address) throws DebuggerException;
public long[] getThreadIntegerRegisterSet(int lwp_id) throws DebuggerException;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java Wed Jul 05 18:25:45 2017 +0200
@@ -431,6 +431,12 @@
return (value == 0 ? null : new BsdAddress(this, value));
}
+ public BsdAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new BsdAddress(this, value));
+ }
+
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException,
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java Wed Jul 05 18:25:45 2017 +0200
@@ -80,6 +80,10 @@
return new DummyAddress(debugger, badLong);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return new DummyAddress(debugger, badLong);
+ }
+
//
// Java-related routines
//
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java Wed Jul 05 18:25:45 2017 +0200
@@ -79,6 +79,11 @@
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset)
+ throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
+
//
// Java-related routines
//
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -46,6 +46,7 @@
throws DebuggerException;
public LinuxAddress readAddress(long address) throws DebuggerException;
public LinuxAddress readCompOopAddress(long address) throws DebuggerException;
+ public LinuxAddress readCompKlassAddress(long address) throws DebuggerException;
public LinuxOopHandle readOopHandle(long address) throws DebuggerException;
public LinuxOopHandle readCompOopHandle(long address) throws DebuggerException;
public long[] getThreadIntegerRegisterSet(int lwp_id) throws DebuggerException;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java Wed Jul 05 18:25:45 2017 +0200
@@ -429,6 +429,12 @@
return (value == 0 ? null : new LinuxAddress(this, value));
}
+ public LinuxAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new LinuxAddress(this, value));
+ }
+
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException,
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java Wed Jul 05 18:25:45 2017 +0200
@@ -76,6 +76,10 @@
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
+
//
// Java-related routines
//
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -47,6 +47,7 @@
throws DebuggerException;
public ProcAddress readAddress(long address) throws DebuggerException;
public ProcAddress readCompOopAddress(long address) throws DebuggerException;
+ public ProcAddress readCompKlassAddress(long address) throws DebuggerException;
public ProcOopHandle readOopHandle(long address) throws DebuggerException;
public ProcOopHandle readCompOopHandle(long address) throws DebuggerException;
public long[] getThreadIntegerRegisterSet(int tid) throws DebuggerException;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java Wed Jul 05 18:25:45 2017 +0200
@@ -351,6 +351,12 @@
return (value == 0 ? null : new ProcAddress(this, value));
}
+ public ProcAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new ProcAddress(this, value));
+ }
+
/** From the ProcDebugger interface */
public ProcOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java Wed Jul 05 18:25:45 2017 +0200
@@ -74,6 +74,9 @@
public Address getCompOopAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
//
// Java-related routines
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -68,6 +68,9 @@
public long getHeapOopSize() throws RemoteException;
public long getNarrowOopBase() throws RemoteException;
public int getNarrowOopShift() throws RemoteException;
+ public long getKlassPtrSize() throws RemoteException;
+ public long getNarrowKlassBase() throws RemoteException;
+ public int getNarrowKlassShift() throws RemoteException;
public boolean areThreadsEqual(long addrOrId1, boolean isAddress1,
long addrOrId2, boolean isAddress2) throws RemoteException;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java Wed Jul 05 18:25:45 2017 +0200
@@ -99,7 +99,10 @@
javaPrimitiveTypesConfigured = true;
narrowOopBase = remoteDebugger.getNarrowOopBase();
narrowOopShift = remoteDebugger.getNarrowOopShift();
+ narrowKlassBase = remoteDebugger.getNarrowKlassBase();
+ narrowKlassShift = remoteDebugger.getNarrowKlassShift();
heapOopSize = remoteDebugger.getHeapOopSize();
+ klassPtrSize = remoteDebugger.getKlassPtrSize();
}
catch (RemoteException e) {
throw new DebuggerException(e);
@@ -319,6 +322,12 @@
return (value == 0 ? null : new RemoteAddress(this, value));
}
+ RemoteAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new RemoteAddress(this, value));
+ }
+
RemoteOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
long value = readAddressValue(address);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java Wed Jul 05 18:25:45 2017 +0200
@@ -126,6 +126,18 @@
return debugger.getNarrowOopShift();
}
+ public long getKlassPtrSize() throws RemoteException {
+ return debugger.getHeapOopSize();
+ }
+
+ public long getNarrowKlassBase() throws RemoteException {
+ return debugger.getNarrowKlassBase();
+ }
+
+ public int getNarrowKlassShift() throws RemoteException {
+ return debugger.getNarrowKlassShift();
+ }
+
public boolean areThreadsEqual(long addrOrId1, boolean isAddress1,
long addrOrId2, boolean isAddress2) throws RemoteException {
ThreadProxy t1 = getThreadProxy(addrOrId1, isAddress1);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java Wed Jul 05 18:25:45 2017 +0200
@@ -76,6 +76,10 @@
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
+
//
// Java-related routines
//
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java Wed Jul 05 18:25:45 2017 +0200
@@ -46,6 +46,7 @@
throws DebuggerException;
public WindbgAddress readAddress(long address) throws DebuggerException;
public WindbgAddress readCompOopAddress(long address) throws DebuggerException;
+ public WindbgAddress readCompKlassAddress(long address) throws DebuggerException;
public WindbgOopHandle readOopHandle(long address) throws DebuggerException;
public WindbgOopHandle readCompOopHandle(long address) throws DebuggerException;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java Wed Jul 05 18:25:45 2017 +0200
@@ -321,6 +321,11 @@
return (WindbgAddress) newAddress(readCompOopAddressValue(address));
}
+ public WindbgAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ return (WindbgAddress) newAddress(readCompKlassAddressValue(address));
+ }
+
/** From the WindbgDebugger interface */
public WindbgOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java Wed Jul 05 18:25:45 2017 +0200
@@ -53,6 +53,8 @@
private static AddressField narrowOopBaseField;
private static CIntegerField narrowOopShiftField;
+ private static AddressField narrowKlassBaseField;
+ private static CIntegerField narrowKlassShiftField;
static {
VM.registerVMInitializedObserver(new Observer() {
@@ -86,6 +88,8 @@
narrowOopBaseField = type.getAddressField("_narrow_oop._base");
narrowOopShiftField = type.getCIntegerField("_narrow_oop._shift");
+ narrowKlassBaseField = type.getAddressField("_narrow_klass._base");
+ narrowKlassShiftField = type.getCIntegerField("_narrow_klass._shift");
}
public Universe() {
@@ -111,6 +115,19 @@
return (int)narrowOopShiftField.getValue();
}
+ public static long getNarrowKlassBase() {
+ if (narrowKlassBaseField.getValue() == null) {
+ return 0;
+ } else {
+ return narrowKlassBaseField.getValue().minus(null);
+ }
+ }
+
+ public static int getNarrowKlassShift() {
+ return (int)narrowKlassShiftField.getValue();
+ }
+
+
/** Returns "TRUE" iff "p" points into the allocated area of the heap. */
public boolean isIn(Address p) {
return heap().isIn(p);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java Wed Jul 05 18:25:45 2017 +0200
@@ -59,7 +59,7 @@
if (headerSize != 0) {
return headerSize;
}
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
headerSize = typeSize;
} else {
headerSize = VM.getVM().alignUp(typeSize + VM.getVM().getIntSize(),
@@ -80,7 +80,7 @@
if (lengthOffsetInBytes != 0) {
return lengthOffsetInBytes;
}
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
lengthOffsetInBytes = typeSize - VM.getVM().getIntSize();
} else {
lengthOffsetInBytes = typeSize;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java Wed Jul 05 18:25:45 2017 +0200
@@ -44,7 +44,7 @@
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("arrayKlass");
+ Type type = db.lookupType("ArrayKlass");
dimension = new CIntField(type.getCIntegerField("_dimension"), 0);
higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java Wed Jul 05 18:25:45 2017 +0200
@@ -53,7 +53,7 @@
// Returns header size in bytes.
public static long getHeaderSize() {
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
return typeSize - VM.getVM().getIntSize();
} else {
return typeSize;
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java Wed Jul 05 18:25:45 2017 +0200
@@ -188,11 +188,11 @@
public Klass arrayKlassOrNull() { return arrayKlassImpl(true); }
public Klass arrayKlassImpl(boolean orNull, int rank) {
- throw new RuntimeException("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
+ throw new RuntimeException("array_klass should be dispatched to InstanceKlass, ObjArrayKlass or TypeArrayKlass");
}
public Klass arrayKlassImpl(boolean orNull) {
- throw new RuntimeException("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
+ throw new RuntimeException("array_klass should be dispatched to InstanceKlass, ObjArrayKlass or TypeArrayKlass");
}
// This returns the name in the form java/lang/String which isn't really a signature
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java Wed Jul 05 18:25:45 2017 +0200
@@ -55,8 +55,8 @@
metadataConstructor.addMapping("InstanceMirrorKlass", InstanceMirrorKlass.class);
metadataConstructor.addMapping("InstanceRefKlass", InstanceRefKlass.class);
metadataConstructor.addMapping("InstanceClassLoaderKlass", InstanceClassLoaderKlass.class);
- metadataConstructor.addMapping("typeArrayKlass", TypeArrayKlass.class);
- metadataConstructor.addMapping("objArrayKlass", ObjArrayKlass.class);
+ metadataConstructor.addMapping("TypeArrayKlass", TypeArrayKlass.class);
+ metadataConstructor.addMapping("ObjArrayKlass", ObjArrayKlass.class);
metadataConstructor.addMapping("Method", Method.class);
metadataConstructor.addMapping("MethodData", MethodData.class);
metadataConstructor.addMapping("ConstMethod", ConstMethod.class);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java Wed Jul 05 18:25:45 2017 +0200
@@ -27,7 +27,6 @@
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.debugger.*;
-// The class for an C int field simply provides access to the value.
public class MetadataField extends Field {
public MetadataField(sun.jvm.hotspot.types.AddressField vmField, long startOffset) {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java Wed Jul 05 18:25:45 2017 +0200
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2012, 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.oops;
+
+import sun.jvm.hotspot.debugger.*;
+
+public class NarrowKlassField extends MetadataField {
+
+ public NarrowKlassField(sun.jvm.hotspot.types.AddressField vmField, long startOffset) {
+ super(vmField, startOffset);
+ }
+
+ public Metadata getValue(Address addr) {
+ return Metadata.instantiateWrapperFor(addr.getCompKlassAddressAt(getOffset()));
+ }
+ public void setValue(Oop obj, long value) throws MutationException {
+ // Fix this: set* missing in Address
+ }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java Wed Jul 05 18:25:45 2017 +0200
@@ -43,7 +43,7 @@
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("objArrayKlass");
+ Type type = db.lookupType("ObjArrayKlass");
elementKlass = new MetadataField(type.getAddressField("_element_klass"), 0);
bottomKlass = new MetadataField(type.getAddressField("_bottom_klass"), 0);
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Wed Jul 05 18:25:45 2017 +0200
@@ -47,10 +47,7 @@
Type type = db.lookupType("oopDesc");
mark = new CIntField(type.getCIntegerField("_mark"), 0);
klass = new MetadataField(type.getAddressField("_metadata._klass"), 0);
- if (VM.getVM().isCompressedHeadersEnabled()) {
- // compressedKlass = new CIntField(type.getCIntegerField("_metadata._compressed_klass"), 0);
- throw new InternalError("unimplemented");
- }
+ compressedKlass = new NarrowKlassField(type.getAddressField("_metadata._compressed_klass"), 0);
headerSize = type.getSize();
}
@@ -74,13 +71,13 @@
private static CIntField mark;
private static MetadataField klass;
- private static CIntField compressedKlass;
+ private static NarrowKlassField compressedKlass;
// Accessors for declared fields
public Mark getMark() { return new Mark(getHandle()); }
public Klass getKlass() {
- if (VM.getVM().isCompressedHeadersEnabled()) {
- throw new InternalError("unimplemented");
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ return (Klass)compressedKlass.getValue(getHandle());
} else {
return (Klass)klass.getValue(getHandle());
}
@@ -150,7 +147,7 @@
void iterateFields(OopVisitor visitor, boolean doVMFields) {
if (doVMFields) {
visitor.doCInt(mark, true);
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
throw new InternalError("unimplemented");
} else {
visitor.doMetadata(klass, true);
@@ -210,8 +207,8 @@
if (handle == null) {
return null;
}
- if (VM.getVM().isCompressedHeadersEnabled()) {
- throw new InternalError("Unimplemented");
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ return (Klass)Metadata.instantiateWrapperFor(handle.getCompKlassAddressAt(compressedKlass.getOffset()));
} else {
return (Klass)Metadata.instantiateWrapperFor(handle.getAddressAt(klass.getOffset()));
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java Wed Jul 05 18:25:45 2017 +0200
@@ -31,7 +31,7 @@
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
-// TypeArrayKlass is a proxy for typeArrayKlass in the JVM
+// TypeArrayKlass is a proxy for TypeArrayKlass in the JVM
public class TypeArrayKlass extends ArrayKlass {
static {
@@ -43,7 +43,7 @@
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type t = db.lookupType("typeArrayKlass");
+ Type t = db.lookupType("TypeArrayKlass");
maxLength = new CIntField(t.getCIntegerField("_max_length"), 0);
}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java Wed Jul 05 18:25:45 2017 +0200
@@ -63,11 +63,7 @@
/** get Klass* field at offset hc_klass_offset from a java.lang.Class object */
public static Klass asKlass(Oop aClass) {
- if (VM.getVM().isCompressedHeadersEnabled()) {
- throw new InternalError("unimplemented");
- } else {
- return (Klass)Metadata.instantiateWrapperFor(aClass.getHandle().getAddressAt(klassOffset));
- }
+ return (Klass)Metadata.instantiateWrapperFor(aClass.getHandle().getAddressAt(klassOffset));
}
/** get oop_size field at offset oop_size_offset from a java.lang.Class object */
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Wed Jul 05 18:25:45 2017 +0200
@@ -103,6 +103,7 @@
private int logMinObjAlignmentInBytes;
private int heapWordSize;
private int heapOopSize;
+ private int klassPtrSize;
private int oopSize;
/** This is only present in a non-core build */
private CodeCache codeCache;
@@ -129,7 +130,7 @@
private static CIntegerType boolType;
private Boolean sharingEnabled;
private Boolean compressedOopsEnabled;
- private Boolean compressedHeadersEnabled;
+ private Boolean compressedKlassPointersEnabled;
// command line flags supplied to VM - see struct Flag in globals.hpp
public static final class Flag {
@@ -350,6 +351,12 @@
} else {
heapOopSize = (int)getOopSize();
}
+
+ if (isCompressedKlassPointersEnabled()) {
+ klassPtrSize = (int)getIntSize();
+ } else {
+ klassPtrSize = (int)getOopSize(); // same as an oop
+ }
}
/** This could be used by a reflective runtime system */
@@ -374,8 +381,9 @@
((Observer) iter.next()).update(null, null);
}
- debugger.putHeapConst(soleInstance.getHeapOopSize(), Universe.getNarrowOopBase(),
- Universe.getNarrowOopShift());
+ debugger.putHeapConst(soleInstance.getHeapOopSize(), soleInstance.getKlassPtrSize(),
+ Universe.getNarrowOopBase(), Universe.getNarrowOopShift(),
+ Universe.getNarrowKlassBase(), Universe.getNarrowKlassShift());
}
/** This is used by the debugging system */
@@ -536,6 +544,10 @@
public int getHeapOopSize() {
return heapOopSize;
}
+
+ public int getKlassPtrSize() {
+ return klassPtrSize;
+ }
/** Utility routine for getting data structure alignment correct */
public long alignUp(long size, long alignment) {
return (size + alignment - 1) & ~(alignment - 1);
@@ -784,13 +796,13 @@
return compressedOopsEnabled.booleanValue();
}
- public boolean isCompressedHeadersEnabled() {
- if (compressedHeadersEnabled == null) {
- Flag flag = getCommandLineFlag("UseCompressedHeaders");
- compressedHeadersEnabled = (flag == null) ? Boolean.FALSE:
+ public boolean isCompressedKlassPointersEnabled() {
+ if (compressedKlassPointersEnabled == null) {
+ Flag flag = getCommandLineFlag("UseCompressedKlassPointers");
+ compressedKlassPointersEnabled = (flag == null) ? Boolean.FALSE:
(flag.getBool()? Boolean.TRUE: Boolean.FALSE);
}
- return compressedHeadersEnabled.booleanValue();
+ return compressedKlassPointersEnabled.booleanValue();
}
public int getObjectAlignmentInBytes() {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java Wed Jul 05 18:25:45 2017 +0200
@@ -354,15 +354,14 @@
}
protected void writeFields() throws IOException {
- U2Array fields = klass.getFields();
- final int length = (int) fields.length();
+ final int javaFieldsCount = klass.getJavaFieldsCount();
// write number of fields
- dos.writeShort((short) length);
+ dos.writeShort((short) javaFieldsCount);
- if (DEBUG) debugMessage("number of fields = " + length);
+ if (DEBUG) debugMessage("number of fields = " + javaFieldsCount);
- for (int index = 0; index < length; index++) {
+ for (int index = 0; index < javaFieldsCount; index++) {
short accessFlags = klass.getFieldAccessFlags(index);
dos.writeShort(accessFlags & (short) JVM_RECOGNIZED_FIELD_MODIFIERS);
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java Wed Jul 05 18:25:45 2017 +0200
@@ -53,9 +53,8 @@
private static void initialize(TypeDataBase db) {
Type type = db.lookupType("oopDesc");
- if (VM.getVM().isCompressedHeadersEnabled()) {
- // klassField = type.getNarrowOopField("_metadata._compressed_klass");
- throw new InternalError("unimplemented");
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ klassField = type.getAddressField("_metadata._compressed_klass");
} else {
klassField = type.getAddressField("_metadata._klass");
}
@@ -70,7 +69,11 @@
}
try {
// Try to instantiate the Klass
- Metadata.instantiateWrapperFor(klassField.getValue(oop));
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ Metadata.instantiateWrapperFor(oop.getCompKlassAddressAt(klassField.getOffset()));
+ } else {
+ Metadata.instantiateWrapperFor(klassField.getValue(oop));
+ }
return true;
}
catch (AddressException e) {
--- a/hotspot/agent/src/share/native/sadis.c Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/agent/src/share/native/sadis.c Wed Jul 05 18:25:45 2017 +0200
@@ -46,7 +46,7 @@
#else
-#include <strings.h>
+#include <string.h>
#include <dlfcn.h>
#include <link.h>
--- a/hotspot/make/Makefile Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/Makefile Wed Jul 05 18:25:45 2017 +0200
@@ -76,6 +76,8 @@
include $(GAMMADIR)/make/altsrc.make
+-include $(HS_ALT_MAKE)/Makefile.make
+
ifneq ($(ALT_OUTPUTDIR),)
ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
else
@@ -88,16 +90,23 @@
KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
+MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 jvmgminimal1
-COMMON_VM_PRODUCT_TARGETS=product product1 productkernel docs export_product
-COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
-COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 jvmgkernel docs export_debug
+COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product
+COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug
+COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 docs export_debug
# JDK directory list
JDK_DIRS=bin include jre lib demo
all: all_product all_fastdebug
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+all_product: productminimal1
+all_fastdebug: fastdebugminimal1
+all_debug: jvmgminimal1
+endif
+
ifdef BUILD_CLIENT_ONLY
all_product: product1 docs export_product
all_fastdebug: fastdebug1 docs export_fastdebug
@@ -114,7 +123,7 @@
endif
endif
-all_optimized: optimized optimized1 optimizedkernel docs export_optimized
+all_optimized: optimized optimized1 docs export_optimized
allzero: all_productzero all_fastdebugzero
all_productzero: productzero docs export_product
@@ -167,6 +176,11 @@
$(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \
generic_buildshark $(ALT_OUT)
+$(MINIMAL1_VM_TARGETS):
+ $(CD) $(GAMMADIR)/make; \
+ $(MAKE) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ \
+ generic_buildminimal1 $(ALT_OUT)
+
# Build compiler1 (client) rule, different for platforms
generic_build1:
$(MKDIR) -p $(OUTPUTDIR)
@@ -239,6 +253,27 @@
$(MAKE) -f $(ABS_OS_MAKEFILE) \
$(MAKE_ARGS) $(VM_TARGET)
+generic_buildminimal1:
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+ $(MKDIR) -p $(OUTPUTDIR)
+ ifeq ($(ARCH_DATA_MODEL), 32)
+ ifeq ($(OSNAME),windows)
+ $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
+ else
+ ifeq ($(OSNAME),solaris)
+ $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
+ else
+ $(CD) $(OUTPUTDIR); \
+ $(MAKE) -f $(ABS_OS_MAKEFILE) $(MAKE_ARGS) $(VM_TARGET) ;
+ endif
+ endif
+ else
+ @$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
+ endif
+else
+ @$(ECHO) "Error: trying to build a minimal target but JVM_VARIANT_MINIMAL1 is not true."
+endif
+
# Export file rule
generic_export: $(EXPORT_LIST)
export_product:
@@ -287,6 +322,8 @@
KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
+MINIMAL1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1
+MINIMAL1_DIR=$(MINIMAL1_BASE_DIR)/$(VM_SUBDIR)
ifeq ($(JVM_VARIANT_SERVER), true)
MISC_DIR=$(C2_DIR)
@@ -308,6 +345,10 @@
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
endif
+ifeq ($(JVM_VARIANT_MINIMAL1), true)
+ MISC_DIR=$(MINIMAL1_DIR)
+ GEN_DIR=$(MINIMAL1_BASE_DIR)/generated
+endif
# Bin files (windows)
ifeq ($(OSNAME),windows)
@@ -357,6 +398,16 @@
$(install-file)
endif
+# Minimal JVM files always come from minimal area
+$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll
+ $(install-file)
+$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb
+ $(install-file)
+$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map
+ $(install-file)
+
# Shared Library
ifneq ($(OSNAME),windows)
ifeq ($(JVM_VARIANT_SERVER), true)
@@ -411,6 +462,26 @@
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
endif
+ ifeq ($(JVM_VARIANT_MINIMAL1), true)
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
+ $(install-file)
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+ endif
endif
# Jar file (sa-jdi.jar)
@@ -451,7 +522,7 @@
$(install-file)
# Xusage file
-$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
+$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt $(EXPORT_MINIMAL_DIR)/Xusage.txt: $(XUSAGE)
$(prep-target)
$(RM) $@.temp
$(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
@@ -467,6 +538,7 @@
$(RM) -r $(KERNEL_DIR)
$(RM) -r $(ZERO_DIR)
$(RM) -r $(SHARK_DIR)
+ $(RM) -r $(MINIMAL1_DIR)
clean_export:
$(RM) -r $(EXPORT_PATH)
clean_jdk:
@@ -574,10 +646,11 @@
@$(ECHO) "create_jdk: Create JDK image, export all files into it"
@$(ECHO) "update_jdk: Update JDK image with fresh exported files"
@$(ECHO) " "
- @$(ECHO) "Others targets are:"
+ @$(ECHO) "Other targets are:"
@$(ECHO) " $(C1_VM_TARGETS)"
@$(ECHO) " $(C2_VM_TARGETS)"
@$(ECHO) " $(KERNEL_VM_TARGETS)"
+ @$(ECHO) " $(MINIMAL1_VM_TARGETS)"
# Variable help (only common ones used by this workspace)
variable_help: variable_help_intro variable_list variable_help_end
@@ -672,9 +745,10 @@
include $(GAMMADIR)/make/jprt.gmk
.PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
- $(KERNEL_VM_TARGETS) \
- generic_build1 generic_build2 generic_buildkernel generic_export \
+ $(KERNEL_VM_TARGETS) $(MINIMAL1_VM_TARGETS) \
+ generic_build1 generic_build2 generic_buildkernel generic_buildminimal1 generic_export \
export_product export_fastdebug export_debug export_optimized \
export_jdk_product export_jdk_fastdebug export_jdk_debug \
create_jdk copy_jdk update_jdk test_jdk \
- copy_product_jdk copy_fastdebug_jdk copy_debug_jdk
+ copy_product_jdk copy_fastdebug_jdk copy_debug_jdk \
+ $(HS_ALT_MAKE)/Makefile.make
--- a/hotspot/make/bsd/Makefile Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/Makefile Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -175,6 +175,10 @@
# profiledshark shark <os>_<arch>_shark/profiled
# productshark shark <os>_<arch>_shark/product
#
+# fastdebugminimal1 minimal1 <os>_<arch>_minimal1/fastdebug
+# jvmgminimal1 minimal1 <os>_<arch>_minimal1/jvmg
+# productminimal1 minimal1 <os>_<arch>_minimal1/product
+#
# What you get with each target:
#
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
@@ -199,6 +203,7 @@
SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
+SUBDIRS_MINIMAL1 = $(addprefix $(OSNAME)_$(BUILDARCH)_minimal1/,$(TARGETS))
TARGETS_C2 = $(TARGETS)
TARGETS_C1 = $(addsuffix 1,$(TARGETS))
@@ -206,6 +211,7 @@
TARGETS_CORE = $(addsuffix core,$(TARGETS))
TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK = $(addsuffix shark,$(TARGETS))
+TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX)
@@ -223,6 +229,7 @@
@echo " $(TARGETS_CORE)"
@echo " $(TARGETS_ZERO)"
@echo " $(TARGETS_SHARK)"
+ @echo " $(TARGETS_MINIMAL1)"
checks: check_os_version check_j2se_version
@@ -281,6 +288,10 @@
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
+$(SUBDIRS_MINIMAL1): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=minimal1
+
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
@@ -340,12 +351,22 @@
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
endif
+$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
+endif
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
treeshark: $(SUBDIRS_SHARK)
+treeminimal1: $(SUBDIRS_MINIMAL1)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
@@ -367,17 +388,23 @@
clean_docs:
rm -rf $(SUBDIR_DOCS)
-clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
+clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark clean_minimal1:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
-clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
+clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_minimal1 clean_docs
include $(GAMMADIR)/make/cscope.make
+#
+# Include alternate Makefile if it exists.
+#
+-include $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
+
#-------------------------------------------------------------------------------
-.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_MINIMAL1)
.PHONY: tree tree1 treecore treezero treeshark
.PHONY: all compiler1 compiler2 core zero shark
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
.PHONY: checks check_os_version check_j2se_version
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
--- a/hotspot/make/bsd/makefiles/adlc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/adlc.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/bsd/makefiles/buildtree.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/buildtree.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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 @@
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
+include $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
@@ -163,6 +164,13 @@
endif
endif
+# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
+ifndef OPENJDK
+ ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
+ OPENJDK=true
+ endif
+endif
+
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \
@@ -195,6 +203,8 @@
sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
echo; \
echo "GAMMADIR = $(GAMMADIR)"; \
+ echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \
+ echo "OSNAME = $(OSNAME)"; \
echo "SYSDEFS = \$$(Platform_sysdefs)"; \
echo "SRCARCH = $(SRCARCH)"; \
echo "BUILDARCH = $(BUILDARCH)"; \
@@ -205,6 +215,7 @@
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo "OPENJDK = $(OPENJDK)"; \
echo; \
echo "# Used for platform dispatching"; \
echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
@@ -251,6 +262,7 @@
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
+ echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@
--- a/hotspot/make/bsd/makefiles/defs.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/defs.make Wed Jul 05 18:25:45 2017 +0200
@@ -155,6 +155,7 @@
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
@@ -168,6 +169,19 @@
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
endif
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
+
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ ifeq ($(ZIP_DEBUGINFO_FILES),1)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
+ else
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
+ endif
+ endif
+endif
+
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
--- a/hotspot/make/bsd/makefiles/dtrace.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/dtrace.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -114,21 +114,21 @@
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
$(JVMOFFS).h: $(GENOFFS)
- $(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp; touch $@; \
+ $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp; touch $@; \
if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
then rm -f $@; mv $@.tmp $@; \
else rm -f $@.tmp; \
fi
$(JVMOFFS)Index.h: $(GENOFFS)
- $(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp; touch $@; \
+ $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp; touch $@; \
if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
then rm -f $@; mv $@.tmp $@; \
else rm -f $@.tmp; \
fi
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
- $(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp; touch $@; \
+ $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp; touch $@; \
if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
then rm -f $@; mv $@.tmp $@; \
else rm -f $@.tmp; \
--- a/hotspot/make/bsd/makefiles/gcc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/gcc.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
@@ -151,11 +151,6 @@
CFLAGS += -DCC_INTERP
endif
-# Build for embedded targets
-ifdef JAVASE_EMBEDDED
- CFLAGS += -DJAVASE_EMBEDDED
-endif
-
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@@ -186,20 +181,32 @@
CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
endif
+OPT_CFLAGS/SIZE=-Os
+OPT_CFLAGS/SPEED=-O3
+
+# Hotspot uses very unstrict aliasing turn this optimization off
+# This option is added to CFLAGS rather than OPT_CFLAGS
+# so that OPT_CFLAGS overrides get this option too.
+CFLAGS += -fno-strict-aliasing
# The flags to use for an Optimized g++ build
ifeq ($(OS_VENDOR), Darwin)
# use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
# <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
- OPT_CFLAGS += -Os
+ OPT_CFLAGS_DEFAULT ?= SIZE
else
- OPT_CFLAGS += -O3
+ OPT_CFLAGS_DEFAULT ?= SPEED
endif
-# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
+ifdef OPT_CFLAGS
+ ifneq ("$(origin OPT_CFLAGS)", "command line")
+ $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
+ endif
+endif
-# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
+OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
+
+# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
# if we use expensive-optimizations
ifeq ($(BUILDARCH), ia64)
OPT_CFLAGS += -fno-expensive-optimizations
--- a/hotspot/make/bsd/makefiles/ia64.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/ia64.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -25,8 +25,6 @@
#
# IA64 only uses c++ based interpreter
CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN
-# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
ifeq ($(VERSION),debug)
ASM_FLAGS= -DDEBUG
else
--- a/hotspot/make/bsd/makefiles/jvmg.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/jvmg.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/bsd/makefiles/launcher.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/launcher.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/make/bsd/makefiles/minimal1.make Wed Jul 05 18:25:45 2017 +0200
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2012, 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.
+#
+#
+
+TYPE=MINIMAL1
+
+INCLUDE_JVMTI ?= false
+INCLUDE_FPROF ?= false
+INCLUDE_VM_STRUCTS ?= false
+INCLUDE_JNI_CHECK ?= false
+INCLUDE_SERVICES ?= false
+INCLUDE_MANAGEMENT ?= false
+INCLUDE_ALTERNATE_GCS ?= false
+INCLUDE_NMT ?= false
+INCLUDE_CDS ?= false
+
+CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+
+Src_Dirs/MINIMAL1 = $(CORE_PATHS) $(COMPILER1_PATHS)
+
+Src_Files_EXCLUDE/MINIMAL1 += $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+
+-include $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
+
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
--- a/hotspot/make/bsd/makefiles/product.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/product.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/bsd/makefiles/rules.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/rules.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, 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
--- a/hotspot/make/bsd/makefiles/sparcWorks.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/sparcWorks.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/bsd/makefiles/top.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/top.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/bsd/makefiles/vm.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/bsd/makefiles/vm.make Wed Jul 05 18:25:45 2017 +0200
@@ -190,7 +190,7 @@
ZERO_SPECIFIC_FILES := zero
# Always exclude these.
-Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
# Exclude per type.
Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
--- a/hotspot/make/defs.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/defs.make Wed Jul 05 18:25:45 2017 +0200
@@ -22,6 +22,27 @@
#
#
+# The common definitions for hotspot builds.
+
+# Optionally include SPEC file generated by configure.
+ifneq ($(SPEC),)
+ include $(SPEC)
+endif
+
+# Directory paths and user name
+# Unless GAMMADIR is set on the command line, search upward from
+# the current directory for a parent directory containing "src/share/vm".
+# If that fails, look for $GAMMADIR in the environment.
+# When the tree of subdirs is built, this setting is stored in each flags.make.
+GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)
+HS_SRC_DIR=$(GAMMADIR)/src
+HS_MAKE_DIR=$(GAMMADIR)/make
+HS_BUILD_DIR=$(GAMMADIR)/build
+
+ifeq ($(USER),)
+ USER=$(USERNAME)
+endif
+
ifeq ($(HS_ALT_MAKE),)
ifneq ($(OPENJDK),true)
HS_ALT_MAKE=$(GAMMADIR)/make/closed
@@ -30,12 +51,10 @@
endif
endif
-# The common definitions for hotspot builds.
-
-# Optionally include SPEC file generated by configure.
-ifneq ($(SPEC),)
- include $(SPEC)
-endif
+#
+# Include alternate defs.make if it exists
+#
+-include $(HS_ALT_MAKE)/defs.make
# Default to verbose build logs (show all compile lines):
MAKE_VERBOSE=y
@@ -84,20 +103,6 @@
endif
endif
-# Directory paths and user name
-# Unless GAMMADIR is set on the command line, search upward from
-# the current directory for a parent directory containing "src/share/vm".
-# If that fails, look for $GAMMADIR in the environment.
-# When the tree of subdirs is built, this setting is stored in each flags.make.
-GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)
-HS_SRC_DIR=$(GAMMADIR)/src
-HS_MAKE_DIR=$(GAMMADIR)/make
-HS_BUILD_DIR=$(GAMMADIR)/build
-
-ifeq ($(USER),)
- USER=$(USERNAME)
-endif
-
# hotspot version definitions
include $(GAMMADIR)/make/hotspot_version
@@ -339,3 +344,4 @@
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
endif
+.PHONY: $(HS_ALT_MAKE)/defs.make
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/make/excludeSrc.make Wed Jul 05 18:25:45 2017 +0200
@@ -0,0 +1,110 @@
+#
+# Copyright (c) 2012, 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.
+#
+#
+ifeq ($(INCLUDE_JVMTI), false)
+ CXXFLAGS += -DINCLUDE_JVMTI=0
+ CFLAGS += -DINCLUDE_JVMTI=0
+
+ Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
+ jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
+ jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
+ jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp
+endif
+
+ifeq ($(INCLUDE_FPROF), false)
+ CXXFLAGS += -DINCLUDE_FPROF=0
+ CFLAGS += -DINCLUDE_FPROF=0
+
+ Src_Files_EXCLUDE += fprofiler.cpp
+endif
+
+ifeq ($(INCLUDE_VM_STRUCTS), false)
+ CXXFLAGS += -DINCLUDE_VM_STRUCTS=0
+ CFLAGS += -DINCLUDE_VM_STRUCTS=0
+
+ Src_Files_EXCLUDE += vmStructs.cpp
+endif
+
+ifeq ($(INCLUDE_JNI_CHECK), false)
+ CXXFLAGS += -DINCLUDE_JNI_CHECK=0
+ CFLAGS += -DINCLUDE_JNI_CHECK=0
+
+ Src_Files_EXCLUDE += jniCheck.cpp
+endif
+
+ifeq ($(INCLUDE_SERVICES), false)
+ CXXFLAGS += -DINCLUDE_SERVICES=0
+ CFLAGS += -DINCLUDE_SERVICES=0
+
+ Src_Files_EXCLUDE += heapDumper.cpp heapInspection.cpp \
+ attachListener_linux.cpp attachListener.cpp
+endif
+
+ifeq ($(INCLUDE_MANAGEMENT), false)
+ CXXFLAGS += -DINCLUDE_MANAGEMENT=0
+ CFLAGS += -DINCLUDE_MANAGEMENT=0
+endif
+
+ifeq ($(INCLUDE_CDS), false)
+ CXXFLAGS += -DINCLUDE_CDS=0
+ CFLAGS += -DINCLUDE_CDS=0
+
+ Src_Files_EXCLUDE += metaspaceShared.cpp
+endif
+
+ifeq ($(INCLUDE_ALTERNATE_GCS), false)
+ CXXFLAGS += -DINCLUDE_ALTERNATE_GCS=0
+ CFLAGS += -DINCLUDE_ALTERNATE_GCS=0
+
+ CXXFLAGS += -DSERIALGC
+ CFLAGS += -DSERIALGC
+ Src_Files_EXCLUDE += \
+ binaryTreeDictionary.cpp cmsAdaptiveSizePolicy.cpp cmsCollectorPolicy.cpp \
+ cmsGCAdaptivePolicyCounters.cpp cmsLockVerifier.cpp cmsPermGen.cpp compactibleFreeListSpace.cpp \
+ concurrentMarkSweepGeneration.cpp concurrentMarkSweepThread.cpp freeBlockDictionary.cpp \
+ freeChunk.cpp freeList.cpp promotionInfo.cpp vmCMSOperations.cpp collectionSetChooser.cpp \
+ concurrentG1Refine.cpp concurrentG1RefineThread.cpp concurrentMark.cpp concurrentMarkThread.cpp \
+ dirtyCardQueue.cpp g1AllocRegion.cpp g1BlockOffsetTable.cpp g1CollectedHeap.cpp g1GCPhaseTimes.cpp \
+ g1CollectorPolicy.cpp g1ErgoVerbose.cpp g1_globals.cpp g1HRPrinter.cpp g1MarkSweep.cpp \
+ g1MMUTracker.cpp g1MonitoringSupport.cpp g1RemSet.cpp g1SATBCardTableModRefBS.cpp heapRegion.cpp \
+ heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp ptrQueue.cpp \
+ satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp adjoiningGenerations.cpp \
+ adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp cardTableExtension.cpp \
+ gcTaskManager.cpp gcTaskThread.cpp objectStartArray.cpp parallelScavengeHeap.cpp parMarkBitMap.cpp \
+ pcTasks.cpp psAdaptiveSizePolicy.cpp psCompactionManager.cpp psGCAdaptivePolicyCounters.cpp \
+ psGenerationCounters.cpp psMarkSweep.cpp psMarkSweepDecorator.cpp psOldGen.cpp psParallelCompact.cpp \
+ psPermGen.cpp psPromotionLAB.cpp psPromotionManager.cpp psScavenge.cpp psTasks.cpp psVirtualspace.cpp \
+ psYoungGen.cpp vmPSOperations.cpp asParNewGeneration.cpp parCardTableModRefBS.cpp \
+ parGCAllocBuffer.cpp parNewGeneration.cpp mutableSpace.cpp gSpaceCounters.cpp allocationStats.cpp \
+ spaceCounters.cpp gcAdaptivePolicyCounters.cpp mutableNUMASpace.cpp immutableSpace.cpp \
+ immutableSpace.cpp g1MemoryPool.cpp psMemoryPool.cpp yieldWorkingGroup.cpp g1Log.cpp
+endif
+
+ifeq ($(INCLUDE_NMT), false)
+ CXXFLAGS += -DINCLUDE_NMT=0
+ CFLAGS += -DINCLUDE_NMT=0
+
+ Src_Files_EXCLUDE += \
+ memBaseline.cpp memPtr.cpp memRecorder.cpp memReporter.cpp memSnapshot.cpp memTrackWorker.cpp \
+ memTracker.cpp nmtDCmd.cpp
+endif
--- a/hotspot/make/hotspot_version Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/hotspot_version Wed Jul 05 18:25:45 2017 +0200
@@ -35,7 +35,7 @@
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=04
+HS_BUILD_NUMBER=05
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
--- a/hotspot/make/linux/Makefile Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/Makefile Wed Jul 05 18:25:45 2017 +0200
@@ -175,6 +175,10 @@
# profiledshark shark <os>_<arch>_shark/profiled
# productshark shark <os>_<arch>_shark/product
#
+# fastdebugminimal1 minimal1 <os>_<arch>_minimal1/fastdebug
+# jvmgminimal1 minimal1 <os>_<arch>_minimal1/jvmg
+# productminimal1 minimal1 <os>_<arch>_minimal1/product
+#
# What you get with each target:
#
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
@@ -199,6 +203,7 @@
SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
+SUBDIRS_MINIMAL1 = $(addprefix $(OSNAME)_$(BUILDARCH)_minimal1/,$(TARGETS))
TARGETS_C2 = $(TARGETS)
TARGETS_C1 = $(addsuffix 1,$(TARGETS))
@@ -206,6 +211,7 @@
TARGETS_CORE = $(addsuffix core,$(TARGETS))
TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK = $(addsuffix shark,$(TARGETS))
+TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
@@ -224,6 +230,7 @@
@echo " $(TARGETS_CORE)"
@echo " $(TARGETS_ZERO)"
@echo " $(TARGETS_SHARK)"
+ @echo " $(TARGETS_MINIMAL1)"
checks: check_os_version check_j2se_version
@@ -281,6 +288,11 @@
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
+$(SUBDIRS_MINIMAL1): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=minimal1
+
+
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
@@ -340,12 +352,22 @@
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
endif
+$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
+endif
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
treeshark: $(SUBDIRS_SHARK)
+treeminimal1: $(SUBDIRS_MINIMAL1)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
@@ -369,17 +391,23 @@
clean_docs:
rm -rf $(SUBDIR_DOCS)
-clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
+clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark clean_minimal1:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
-clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
+clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_minimal1 clean_docs
include $(GAMMADIR)/make/cscope.make
+#
+# Include alternate Makefile if it exists.
+#
+-include $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
+
#-------------------------------------------------------------------------------
-.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_MINIMAL1)
.PHONY: tree tree1 treecore treezero treeshark
.PHONY: all compiler1 compiler2 core zero shark
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
.PHONY: checks check_os_version check_j2se_version
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
--- a/hotspot/make/linux/makefiles/buildtree.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/buildtree.make Wed Jul 05 18:25:45 2017 +0200
@@ -57,6 +57,7 @@
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
+include $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
@@ -156,6 +157,13 @@
endif
endif
+# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
+ifndef OPENJDK
+ ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
+ OPENJDK=true
+ endif
+endif
+
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \
@@ -188,6 +196,8 @@
sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
echo; \
echo "GAMMADIR = $(GAMMADIR)"; \
+ echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \
+ echo "OSNAME = $(OSNAME)"; \
echo "SYSDEFS = \$$(Platform_sysdefs)"; \
echo "SRCARCH = $(SRCARCH)"; \
echo "BUILDARCH = $(BUILDARCH)"; \
@@ -198,6 +208,7 @@
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo "OPENJDK = $(OPENJDK)"; \
echo; \
echo "# Used for platform dispatching"; \
echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
@@ -254,6 +265,7 @@
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
+ echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@
--- a/hotspot/make/linux/makefiles/defs.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/defs.make Wed Jul 05 18:25:45 2017 +0200
@@ -254,6 +254,7 @@
endif
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
@@ -281,6 +282,19 @@
endif
endif
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
+
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ ifeq ($(ZIP_DEBUGINFO_FILES),1)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
+ else
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
+ endif
+ endif
+endif
+
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
--- a/hotspot/make/linux/makefiles/dtrace.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/dtrace.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,6 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012 Red Hat, Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,3 +26,40 @@
# Linux does not build jvm_db
LIBJVM_DB =
+# Only OPENJDK builds test and support SDT probes currently.
+ifndef OPENJDK
+REASON = "This JDK does not support SDT probes"
+else
+
+# We need a recent GCC for the default
+ifeq "$(shell expr \( $(CC_VER_MAJOR) \>= 4 \) \& \( $(CC_VER_MINOR) \>= 4 \) )" "0"
+REASON = "gcc version is too old"
+else
+
+# But it does have a SystemTap dtrace compatible sys/sdt.h
+ifneq ($(ALT_SDT_H),)
+ SDT_H_FILE = $(ALT_SDT_H)
+else
+ SDT_H_FILE = /usr/include/sys/sdt.h
+endif
+DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
+REASON = "$(SDT_H_FILE) not found"
+
+ifneq ($(DTRACE_ENABLED),)
+ CFLAGS += -DDTRACE_ENABLED
+endif
+
+endif
+endif
+
+# Phony target used in vm.make build target to check whether enabled.
+.PHONY: dtraceCheck
+ifeq ($(DTRACE_ENABLED),)
+dtraceCheck:
+ $(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)"
+else
+dtraceCheck:
+endif
+
+# It doesn't support HAVE_DTRACE_H though.
+
--- a/hotspot/make/linux/makefiles/gcc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/gcc.make Wed Jul 05 18:25:45 2017 +0200
@@ -116,11 +116,6 @@
CFLAGS += -DCC_INTERP
endif
-# Build for embedded targets
-ifdef JAVASE_EMBEDDED
- CFLAGS += -DJAVASE_EMBEDDED
-endif
-
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@@ -146,10 +141,23 @@
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
# The flags to use for an Optimized g++ build
-OPT_CFLAGS += -O3
+OPT_CFLAGS/SIZE=-Os
+OPT_CFLAGS/SPEED=-O3
# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
+# This option is added to CFLAGS rather than OPT_CFLAGS
+# so that OPT_CFLAGS overrides get this option too.
+CFLAGS += -fno-strict-aliasing
+
+OPT_CFLAGS_DEFAULT ?= SPEED
+
+ifdef OPT_CFLAGS
+ ifneq ("$(origin OPT_CFLAGS)", "command line")
+ $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
+ endif
+endif
+
+OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
# if we use expensive-optimizations
--- a/hotspot/make/linux/makefiles/ia64.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/ia64.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
@@ -25,8 +25,6 @@
#
# IA64 only uses c++ based interpreter
CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN
-# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
ifeq ($(VERSION),debug)
ASM_FLAGS= -DDEBUG
else
--- a/hotspot/make/linux/makefiles/launcher.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/launcher.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/make/linux/makefiles/minimal1.make Wed Jul 05 18:25:45 2017 +0200
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2012, 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.
+#
+#
+
+TYPE=MINIMAL1
+
+INCLUDE_JVMTI ?= false
+INCLUDE_FPROF ?= false
+INCLUDE_VM_STRUCTS ?= false
+INCLUDE_JNI_CHECK ?= false
+INCLUDE_SERVICES ?= false
+INCLUDE_MANAGEMENT ?= false
+INCLUDE_ALTERNATE_GCS ?= false
+INCLUDE_NMT ?= false
+INCLUDE_CDS ?= false
+
+CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+
+Src_Dirs/MINIMAL1 = $(CORE_PATHS) $(COMPILER1_PATHS)
+
+Src_Files_EXCLUDE/MINIMAL1 += $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+
+-include $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
+
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
--- a/hotspot/make/linux/makefiles/ppc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/ppc.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2012, 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
--- a/hotspot/make/linux/makefiles/product.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/product.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/linux/makefiles/rules.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/rules.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, 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
--- a/hotspot/make/linux/makefiles/sparcWorks.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/sparcWorks.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/linux/makefiles/top.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/top.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/linux/makefiles/vm.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/linux/makefiles/vm.make Wed Jul 05 18:25:45 2017 +0200
@@ -192,7 +192,7 @@
ZERO_SPECIFIC_FILES := zero
# Always exclude these.
-Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
# Exclude per type.
Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
@@ -387,7 +387,7 @@
#----------------------------------------------------------------------
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) $(WB_JAR)
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck $(WB_JAR)
install: install_jvm install_jsig install_saproc
--- a/hotspot/make/solaris/makefiles/adlc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/adlc.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
--- a/hotspot/make/solaris/makefiles/buildtree.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/buildtree.make Wed Jul 05 18:25:45 2017 +0200
@@ -148,6 +148,13 @@
endif
endif
+# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
+ifndef OPENJDK
+ ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
+ OPENJDK=true
+ endif
+endif
+
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \
@@ -190,6 +197,7 @@
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo "OPENJDK = $(OPENJDK)"; \
echo "$(LP64_SETTING/$(DATA_MODE))"; \
echo; \
echo "# Used for platform dispatching"; \
--- a/hotspot/make/solaris/makefiles/dtrace.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/dtrace.make Wed Jul 05 18:25:45 2017 +0200
@@ -206,15 +206,15 @@
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
$(JVMOFFS).h: $(GENOFFS)
- $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp
+ $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
$(JVMOFFS)Index.h: $(GENOFFS)
- $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp
+ $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
- $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp
+ $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp
--- a/hotspot/make/solaris/makefiles/gcc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/gcc.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
--- a/hotspot/make/solaris/makefiles/jvmg.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/jvmg.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/solaris/makefiles/optimized.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/optimized.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
--- a/hotspot/make/solaris/makefiles/rules.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/rules.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2012, 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
--- a/hotspot/make/solaris/makefiles/top.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/solaris/makefiles/top.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2012, 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
--- a/hotspot/make/windows/build.bat Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/build.bat Wed Jul 05 18:25:45 2017 +0200
@@ -1,6 +1,6 @@
@echo off
REM
-REM Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
--- a/hotspot/make/windows/build_vm_def.sh Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/build_vm_def.sh Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2012, 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
--- a/hotspot/make/windows/get_msc_ver.sh Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/get_msc_ver.sh Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, 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
--- a/hotspot/make/windows/makefiles/adlc.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/adlc.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/windows/makefiles/defs.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/defs.make Wed Jul 05 18:25:45 2017 +0200
@@ -154,10 +154,9 @@
# On 32 bit windows we build server, client and kernel, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ARCH_DATA_MODEL), 32)
- JVM_VARIANTS:=client,server,kernel
+ JVM_VARIANTS:=client,server
JVM_VARIANT_CLIENT:=true
JVM_VARIANT_SERVER:=true
- JVM_VARIANT_KERNEL:=true
else
JVM_VARIANTS:=server
JVM_VARIANT_SERVER:=true
--- a/hotspot/make/windows/makefiles/launcher.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/launcher.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, 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
--- a/hotspot/make/windows/makefiles/projectcreator.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/projectcreator.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/make/windows/makefiles/rules.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/rules.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, 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
--- a/hotspot/make/windows/makefiles/sanity.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/sanity.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, 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
--- a/hotspot/make/windows/makefiles/shared.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/shared.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
--- a/hotspot/make/windows/makefiles/vm.make Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/makefiles/vm.make Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
--- a/hotspot/make/windows/projectfiles/common/Makefile Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/make/windows/projectfiles/common/Makefile Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, 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
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1641,6 +1641,21 @@
}
+void MacroAssembler::set_narrow_klass(Klass* k, Register d) {
+ assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ narrowOop encoded_k = oopDesc::encode_klass(k);
+
+ assert_not_delayed();
+ // Relocation with special format (see relocInfo_sparc.hpp).
+ relocate(rspec, 1);
+ // Assembler::sethi(encoded_k, d);
+ emit_long( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(encoded_k) );
+ // Don't add relocation for 'add'. Do patching during 'sethi' processing.
+ add(d, low10(encoded_k), d);
+
+}
void MacroAssembler::align(int modulus) {
while (offset() % modulus != 0) nop();
@@ -4660,7 +4675,7 @@
// if this changes, change that.
if (UseCompressedKlassPointers) {
lduw(src_oop, oopDesc::klass_offset_in_bytes(), klass);
- decode_heap_oop_not_null(klass);
+ decode_klass_not_null(klass);
} else {
ld_ptr(src_oop, oopDesc::klass_offset_in_bytes(), klass);
}
@@ -4669,7 +4684,7 @@
void MacroAssembler::store_klass(Register klass, Register dst_oop) {
if (UseCompressedKlassPointers) {
assert(dst_oop != klass, "not enough registers");
- encode_heap_oop_not_null(klass);
+ encode_klass_not_null(klass);
st(klass, dst_oop, oopDesc::klass_offset_in_bytes());
} else {
st_ptr(klass, dst_oop, oopDesc::klass_offset_in_bytes());
@@ -4829,17 +4844,58 @@
// pd_code_size_limit.
// Also do not verify_oop as this is called by verify_oop.
assert (UseCompressedOops, "must be compressed");
- assert (Universe::heap() != NULL, "java heap should be initialized");
assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
sllx(src, LogMinObjAlignmentInBytes, dst);
if (Universe::narrow_oop_base() != NULL)
add(dst, G6_heapbase, dst);
}
+void MacroAssembler::encode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ if (Universe::narrow_klass_base() != NULL)
+ sub(r, G6_heapbase, r);
+ srlx(r, LogKlassAlignmentInBytes, r);
+}
+
+void MacroAssembler::encode_klass_not_null(Register src, Register dst) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ if (Universe::narrow_klass_base() == NULL) {
+ srlx(src, LogKlassAlignmentInBytes, dst);
+ } else {
+ sub(src, G6_heapbase, dst);
+ srlx(dst, LogKlassAlignmentInBytes, dst);
+ }
+}
+
+void MacroAssembler::decode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Do not add assert code to this unless you change vtableStubs_sparc.cpp
+ // pd_code_size_limit.
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ sllx(r, LogKlassAlignmentInBytes, r);
+ if (Universe::narrow_klass_base() != NULL)
+ add(r, G6_heapbase, r);
+}
+
+void MacroAssembler::decode_klass_not_null(Register src, Register dst) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Do not add assert code to this unless you change vtableStubs_sparc.cpp
+ // pd_code_size_limit.
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ sllx(src, LogKlassAlignmentInBytes, dst);
+ if (Universe::narrow_klass_base() != NULL)
+ add(dst, G6_heapbase, dst);
+}
+
void MacroAssembler::reinit_heapbase() {
- if (UseCompressedOops) {
- // call indirectly to solve generation ordering problem
- AddressLiteral base(Universe::narrow_oop_base_addr());
+ if (UseCompressedOops || UseCompressedKlassPointers) {
+ AddressLiteral base(Universe::narrow_ptrs_base_addr());
load_ptr_contents(base, G6_heapbase);
}
}
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -2280,6 +2280,11 @@
void encode_heap_oop_not_null(Register src, Register dst);
void decode_heap_oop_not_null(Register src, Register dst);
+ void encode_klass_not_null(Register r);
+ void decode_klass_not_null(Register r);
+ void encode_klass_not_null(Register src, Register dst);
+ void decode_klass_not_null(Register src, Register dst);
+
// Support for managing the JavaThread pointer (i.e.; the reference to
// thread-local information).
void get_thread(); // load G2_thread
@@ -2409,6 +2414,7 @@
inline void set_metadata (const AddressLiteral& obj_addr, Register d); // same as load_address
void set_narrow_oop( jobject obj, Register d );
+ void set_narrow_klass( Klass* k, Register d );
// nop padding
void align(int modulus);
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -105,6 +105,11 @@
if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
}
+ if (UseCompressedKlassPointers) {
+ if (src->is_address() && !src->is_stack() && src->type() == T_ADDRESS &&
+ src->as_address_ptr()->disp() == oopDesc::klass_offset_in_bytes()) return false;
+ }
+
if (dst->is_register()) {
if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) {
return !PatchALot;
@@ -969,8 +974,18 @@
#endif
}
break;
- case T_METADATA:
- case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break;
+ case T_METADATA: __ ld_ptr(base, offset, to_reg->as_register()); break;
+ case T_ADDRESS:
+#ifdef _LP64
+ if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedKlassPointers) {
+ __ lduw(base, offset, to_reg->as_register());
+ __ decode_klass_not_null(to_reg->as_register());
+ } else
+#endif
+ {
+ __ ld_ptr(base, offset, to_reg->as_register());
+ }
+ break;
case T_ARRAY : // fall through
case T_OBJECT:
{
@@ -2290,7 +2305,7 @@
__ mov(length, len);
__ load_klass(dst, tmp);
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
__ ld_ptr(tmp, ek_offset, super_k);
int sco_offset = in_bytes(Klass::super_check_offset_offset());
@@ -2344,7 +2359,7 @@
if (UseCompressedKlassPointers) {
// tmp holds the default type. It currently comes uncompressed after the
// load of a constant, so encode it.
- __ encode_heap_oop(tmp);
+ __ encode_klass_not_null(tmp);
// load the raw value of the dst klass, since we will be comparing
// uncompressed values directly.
__ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
@@ -2781,7 +2796,7 @@
__ load_klass(value, klass_RInfo);
// get instance klass
- __ ld_ptr(Address(k_RInfo, objArrayKlass::element_klass_offset()), k_RInfo);
+ __ ld_ptr(Address(k_RInfo, ObjArrayKlass::element_klass_offset()), k_RInfo);
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, failure_target, NULL);
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -189,7 +189,7 @@
if (UseCompressedKlassPointers) {
// Save klass
mov(klass, t1);
- encode_heap_oop_not_null(t1);
+ encode_klass_not_null(t1);
stw(t1, obj, oopDesc::klass_offset_in_bytes());
} else {
st_ptr(klass, obj, oopDesc::klass_offset_in_bytes());
--- a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -208,8 +208,6 @@
Register O1_scratch = O1;
Register O4_param_size = O4; // size of parameters
- address code_start = __ pc();
-
// here's where control starts out:
__ align(CodeEntryAlignment);
address entry_point = __ pc();
@@ -252,22 +250,9 @@
// O4_first_arg_addr is live!
if (TraceMethodHandles) {
- const char* name = vmIntrinsics::name_at(iid);
- if (*name == '_') name += 1;
- const size_t len = strlen(name) + 50;
- char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
- const char* suffix = "";
- if (vmIntrinsics::method_for(iid) == NULL ||
- !vmIntrinsics::method_for(iid)->access_flags().is_public()) {
- if (is_signature_polymorphic_static(iid))
- suffix = "/static";
- else
- suffix = "/private";
- }
- jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
if (O0_mh != noreg)
__ mov(O0_mh, G3_method_handle); // make stub happy
- trace_method_handle(_masm, qname);
+ trace_method_handle_interpreter_entry(_masm, iid);
}
if (iid == vmIntrinsics::_invokeBasic) {
@@ -287,14 +272,6 @@
generate_method_handle_dispatch(_masm, iid, O0_recv, G5_member, not_for_compiler_entry);
}
- if (PrintMethodHandleStubs) {
- address code_end = __ pc();
- tty->print_cr("--------");
- tty->print_cr("method handle interpreter entry for %s", vmIntrinsics::name_at(iid));
- Disassembler::decode(code_start, code_end);
- tty->cr();
- }
-
return entry_point;
}
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -58,5 +58,3 @@
Register recv, Register method_temp,
Register temp2, Register temp3,
bool for_compiler_entry);
-
- static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -97,8 +97,8 @@
jint inst2;
guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
if (format() != 0) {
- assert(type() == relocInfo::oop_type, "only narrow oops case");
- jint np = oopDesc::encode_heap_oop((oop)x);
+ assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "only narrow oops or klasses case");
+ jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : oopDesc::encode_klass((Klass*)x);
inst &= ~Assembler::hi22(-1);
inst |= Assembler::hi22((intptr_t)np);
if (verify_only) {
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad Wed Jul 05 18:25:45 2017 +0200
@@ -557,9 +557,9 @@
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
int klass_load_size;
- if (UseCompressedOops && UseCompressedKlassPointers) {
+ if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
- if (Universe::narrow_oop_base() == NULL)
+ if (Universe::narrow_klass_base() == NULL)
klass_load_size = 2*BytesPerInstWord; // see MacroAssembler::load_klass()
else
klass_load_size = 3*BytesPerInstWord;
@@ -1707,11 +1707,11 @@
void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
st->print_cr("\nUEP:");
#ifdef _LP64
- if (UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass");
st->print_cr("\tSLL R_G5,3,R_G5");
- if (Universe::narrow_oop_base() != NULL)
+ if (Universe::narrow_klass_base() != NULL)
st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5");
} else {
st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check");
@@ -1942,6 +1942,12 @@
return false;
}
+bool Matcher::narrow_klass_use_complex_address() {
+ NOT_LP64(ShouldNotCallThis());
+ assert(UseCompressedKlassPointers, "only for compressed klass code");
+ return false;
+}
+
// Is it better to copy float constants, or load them directly from memory?
// Intel can load a float constant from a direct address, requiring no
// extra registers. Most RISCs will have to materialize an address into a
@@ -2602,9 +2608,9 @@
int off = __ offset();
__ load_klass(O0, G3_scratch);
int klass_load_size;
- if (UseCompressedOops && UseCompressedKlassPointers) {
+ if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
- if (Universe::narrow_oop_base() == NULL)
+ if (Universe::narrow_klass_base() == NULL)
klass_load_size = 2*BytesPerInstWord;
else
klass_load_size = 3*BytesPerInstWord;
@@ -3610,6 +3616,15 @@
interface(CONST_INTER);
%}
+operand immNKlass()
+%{
+ match(ConNKlass);
+
+ op_cost(10);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// NULL Pointer Immediate
operand immN0()
%{
@@ -5870,8 +5885,8 @@
%}
// Load Unsigned Integer into a Long Register
-instruct loadUI2L(iRegL dst, memory mem) %{
- match(Set dst (LoadUI2L mem));
+instruct loadUI2L(iRegL dst, memory mem, immL_32bits mask) %{
+ match(Set dst (AndL (ConvI2L (LoadI mem)) mask));
ins_cost(MEMORY_REF_COST);
size(4);
@@ -6159,6 +6174,17 @@
ins_pipe(ialu_hi_lo_reg);
%}
+instruct loadConNKlass(iRegN dst, immNKlass src) %{
+ match(Set dst src);
+ ins_cost(DEFAULT_COST * 3/2);
+ format %{ "SET $src,$dst\t! compressed klass ptr" %}
+ ins_encode %{
+ Register dst = $dst$$Register;
+ __ set_narrow_klass((Klass*)$src$$constant, dst);
+ %}
+ ins_pipe(ialu_hi_lo_reg);
+%}
+
// Materialize long value (predicated by immL_cheap).
instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{
match(Set dst con);
@@ -6475,6 +6501,25 @@
ins_pipe(istore_mem_spORreg);
%}
+instruct storeNKlass(memory dst, iRegN src) %{
+ match(Set dst (StoreNKlass dst src));
+ ins_cost(MEMORY_REF_COST);
+ size(4);
+
+ format %{ "STW $src,$dst\t! compressed klass ptr" %}
+ ins_encode %{
+ Register base = as_Register($dst$$base);
+ Register index = as_Register($dst$$index);
+ Register src = $src$$Register;
+ if (index != G0) {
+ __ stw(src, base, index);
+ } else {
+ __ stw(src, base, $dst$$disp);
+ }
+ %}
+ ins_pipe(istore_mem_spORreg);
+%}
+
instruct storeN0(memory dst, immN0 src) %{
match(Set dst (StoreN dst src));
ins_cost(MEMORY_REF_COST);
@@ -6582,6 +6627,23 @@
ins_pipe(ialu_reg);
%}
+instruct encodeKlass_not_null(iRegN dst, iRegP src) %{
+ match(Set dst (EncodePKlass src));
+ format %{ "encode_klass_not_null $src, $dst" %}
+ ins_encode %{
+ __ encode_klass_not_null($src$$Register, $dst$$Register);
+ %}
+ ins_pipe(ialu_reg);
+%}
+
+instruct decodeKlass_not_null(iRegP dst, iRegN src) %{
+ match(Set dst (DecodeNKlass src));
+ format %{ "decode_klass_not_null $src, $dst" %}
+ ins_encode %{
+ __ decode_klass_not_null($src$$Register, $dst$$Register);
+ %}
+ ins_pipe(ialu_reg);
+%}
//----------MemBar Instructions-----------------------------------------------
// Memory barrier flavors
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -3091,7 +3091,7 @@
arraycopy_range_checks(src, src_pos, dst, dst_pos, length,
O5_temp, G4_dst_klass, L_failed);
- // typeArrayKlass
+ // TypeArrayKlass
//
// src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
// dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
@@ -3142,7 +3142,7 @@
__ br(Assembler::always, false, Assembler::pt, entry_jlong_arraycopy);
__ delayed()->signx(length, count); // length
- // objArrayKlass
+ // ObjArrayKlass
__ BIND(L_objArray);
// live at this point: G3_src_klass, G4_dst_klass, src[_pos], dst[_pos], length
@@ -3198,8 +3198,8 @@
generate_type_check(G3_src_klass, sco_temp, G4_dst_klass,
O5_temp, L_plain_copy);
- // Fetch destination element klass from the objArrayKlass header.
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ // Fetch destination element klass from the ObjArrayKlass header.
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
// the checkcast_copy loop needs two extra arguments:
__ ld_ptr(G4_dst_klass, ek_offset, O4); // dest elem klass
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -867,7 +867,7 @@
// do fast instanceof cache test
- __ ld_ptr(O4, in_bytes(objArrayKlass::element_klass_offset()), O4);
+ __ ld_ptr(O4, in_bytes(ObjArrayKlass::element_klass_offset()), O4);
assert(Otos_i == O0, "just checking");
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -117,6 +117,7 @@
// 32-bit oops don't make sense for the 64-bit VM on sparc
// since the 32-bit VM has the same registers and smaller objects.
Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
+ Universe::set_narrow_klass_shift(LogKlassAlignmentInBytes);
#endif // _LP64
#ifdef COMPILER2
// Indirect branch is the same cost as direct
--- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -220,13 +220,13 @@
const int basic = 5*BytesPerInstWord +
// shift;add for load_klass (only shift with zero heap based)
(UseCompressedKlassPointers ?
- ((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
+ ((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
return basic + slop;
} else {
const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord +
// shift;add for load_klass (only shift with zero heap based)
(UseCompressedKlassPointers ?
- ((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
+ ((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
return (basic + slop);
}
}
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1170,26 +1170,11 @@
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,.
// The ZF is set if the compared values were equal, and cleared otherwise.
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg
- if (Atomics & 2) {
- // caveat: no instructionmark, so this isn't relocatable.
- // Emit a synthetic, non-atomic, CAS equivalent.
- // Beware. The synthetic form sets all ICCs, not just ZF.
- // cmpxchg r,[m] is equivalent to rax, = CAS (m, rax, r)
- cmpl(rax, adr);
- movl(rax, adr);
- if (reg != rax) {
- Label L ;
- jcc(Assembler::notEqual, L);
- movl(adr, reg);
- bind(L);
- }
- } else {
- InstructionMark im(this);
- prefix(adr, reg);
- emit_byte(0x0F);
- emit_byte(0xB1);
- emit_operand(reg, adr);
- }
+ InstructionMark im(this);
+ prefix(adr, reg);
+ emit_byte(0x0F);
+ emit_byte(0xB1);
+ emit_operand(reg, adr);
}
void Assembler::comisd(XMMRegister dst, Address src) {
@@ -1513,12 +1498,7 @@
}
void Assembler::lock() {
- if (Atomics & 1) {
- // Emit either nothing, a NOP, or a NOP: prefix
- emit_byte(0x90) ;
- } else {
- emit_byte(0xF0);
- }
+ emit_byte(0xF0);
}
void Assembler::lzcntl(Register dst, Register src) {
@@ -6936,7 +6916,7 @@
#ifdef ASSERT
// TraceBytecodes does not use r12 but saves it over the call, so don't verify
// r12 is the heapbase.
- LP64_ONLY(if (UseCompressedOops && !TraceBytecodes) verify_heapbase("call_VM_base");)
+ LP64_ONLY(if ((UseCompressedOops || UseCompressedKlassPointers) && !TraceBytecodes) verify_heapbase("call_VM_base: heap base corrupted?");)
#endif // ASSERT
assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result");
@@ -10036,7 +10016,7 @@
#ifdef _LP64
if (UseCompressedKlassPointers) {
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
- decode_heap_oop_not_null(dst);
+ decode_klass_not_null(dst);
} else
#endif
movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
@@ -10047,15 +10027,10 @@
if (UseCompressedKlassPointers) {
assert (Universe::heap() != NULL, "java heap should be initialized");
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
- if (Universe::narrow_oop_shift() != 0) {
- assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
- if (LogMinObjAlignmentInBytes == Address::times_8) {
- movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset()));
- } else {
- // OK to use shift since we don't need to preserve flags.
- shlq(dst, LogMinObjAlignmentInBytes);
- movq(dst, Address(r12_heapbase, dst, Address::times_1, Klass::prototype_header_offset()));
- }
+ if (Universe::narrow_klass_shift() != 0) {
+ assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
+ movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset()));
} else {
movq(dst, Address(dst, Klass::prototype_header_offset()));
}
@@ -10070,7 +10045,7 @@
void MacroAssembler::store_klass(Register dst, Register src) {
#ifdef _LP64
if (UseCompressedKlassPointers) {
- encode_heap_oop_not_null(src);
+ encode_klass_not_null(src);
movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);
} else
#endif
@@ -10152,12 +10127,12 @@
#ifdef ASSERT
void MacroAssembler::verify_heapbase(const char* msg) {
- assert (UseCompressedOops, "should be compressed");
+ assert (UseCompressedOops || UseCompressedKlassPointers, "should be compressed");
assert (Universe::heap() != NULL, "java heap should be initialized");
if (CheckCompressedOops) {
Label ok;
push(rscratch1); // cmpptr trashes rscratch1
- cmpptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
+ cmpptr(r12_heapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
jcc(Assembler::equal, ok);
STOP(msg);
bind(ok);
@@ -10295,6 +10270,74 @@
}
}
+void MacroAssembler::encode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+#ifdef ASSERT
+ verify_heapbase("MacroAssembler::encode_klass_not_null: heap base corrupted?");
+#endif
+ if (Universe::narrow_klass_base() != NULL) {
+ subq(r, r12_heapbase);
+ }
+ if (Universe::narrow_klass_shift() != 0) {
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ shrq(r, LogKlassAlignmentInBytes);
+ }
+}
+
+void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+#ifdef ASSERT
+ verify_heapbase("MacroAssembler::encode_klass_not_null2: heap base corrupted?");
+#endif
+ if (dst != src) {
+ movq(dst, src);
+ }
+ if (Universe::narrow_klass_base() != NULL) {
+ subq(dst, r12_heapbase);
+ }
+ if (Universe::narrow_klass_shift() != 0) {
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ shrq(dst, LogKlassAlignmentInBytes);
+ }
+}
+
+void MacroAssembler::decode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Note: it will change flags
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ // Cannot assert, unverified entry point counts instructions (see .ad file)
+ // vtableStubs also counts instructions in pd_code_size_limit.
+ // Also do not verify_oop as this is called by verify_oop.
+ if (Universe::narrow_klass_shift() != 0) {
+ assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ shlq(r, LogKlassAlignmentInBytes);
+ if (Universe::narrow_klass_base() != NULL) {
+ addq(r, r12_heapbase);
+ }
+ } else {
+ assert (Universe::narrow_klass_base() == NULL, "sanity");
+ }
+}
+
+void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Note: it will change flags
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ // Cannot assert, unverified entry point counts instructions (see .ad file)
+ // vtableStubs also counts instructions in pd_code_size_limit.
+ // Also do not verify_oop as this is called by verify_oop.
+ if (Universe::narrow_klass_shift() != 0) {
+ assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
+ leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
+ } else {
+ assert (Universe::narrow_klass_base() == NULL, "sanity");
+ if (dst != src) {
+ movq(dst, src);
+ }
+ }
+}
+
void MacroAssembler::set_narrow_oop(Register dst, jobject obj) {
assert (UseCompressedOops, "should only be used for compressed headers");
assert (Universe::heap() != NULL, "java heap should be initialized");
@@ -10313,6 +10356,22 @@
mov_narrow_oop(dst, oop_index, rspec);
}
+void MacroAssembler::set_narrow_klass(Register dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ mov_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
+void MacroAssembler::set_narrow_klass(Address dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ mov_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
void MacroAssembler::cmp_narrow_oop(Register dst, jobject obj) {
assert (UseCompressedOops, "should only be used for compressed headers");
assert (Universe::heap() != NULL, "java heap should be initialized");
@@ -10331,9 +10390,25 @@
Assembler::cmp_narrow_oop(dst, oop_index, rspec);
}
+void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ Assembler::cmp_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
+void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ Assembler::cmp_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
void MacroAssembler::reinit_heapbase() {
- if (UseCompressedOops) {
- movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
+ if (UseCompressedOops || UseCompressedKlassPointers) {
+ movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
}
}
#endif // _LP64
@@ -10616,7 +10691,7 @@
// Array header size is 12 bytes in 32-bit VM
// + 6 bytes for 3 chars == 18 bytes,
// enough space to load vec and shift.
- assert(HeapWordSize*typeArrayKlass::header_size() >= 12,"sanity");
+ assert(HeapWordSize*TypeArrayKlass::header_size() >= 12,"sanity");
movdqu(vec, Address(str2, (int_cnt2*2)-16));
psrldq(vec, 16-(int_cnt2*2));
}
--- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -2083,6 +2083,15 @@
void cmp_narrow_oop(Register dst, jobject obj);
void cmp_narrow_oop(Address dst, jobject obj);
+ void encode_klass_not_null(Register r);
+ void decode_klass_not_null(Register r);
+ void encode_klass_not_null(Register dst, Register src);
+ void decode_klass_not_null(Register dst, Register src);
+ void set_narrow_klass(Register dst, Klass* k);
+ void set_narrow_klass(Address dst, Klass* k);
+ void cmp_narrow_klass(Register dst, Klass* k);
+ void cmp_narrow_klass(Address dst, Klass* k);
+
// if heap base register is used - reinit it with the correct value
void reinit_heapbase();
--- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -148,7 +148,7 @@
static int adjust_reg_range(int range) {
// Reduce the number of available regs (to free r12) in case of compressed oops
- if (UseCompressedOops) return range - 1;
+ if (UseCompressedOops || UseCompressedKlassPointers) return range - 1;
return range;
}
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -340,7 +340,7 @@
Register receiver = FrameMap::receiver_opr->as_register();
Register ic_klass = IC_Klass;
const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
- const bool do_post_padding = VerifyOops || UseCompressedOops;
+ const bool do_post_padding = VerifyOops || UseCompressedKlassPointers;
if (!do_post_padding) {
// insert some nops so that the verified entry point is aligned on CodeEntryAlignment
while ((__ offset() + ic_cmp_size) % CodeEntryAlignment != 0) {
@@ -1262,7 +1262,11 @@
break;
case T_ADDRESS:
- __ movptr(dest->as_register(), from_addr);
+ if (UseCompressedKlassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) {
+ __ movl(dest->as_register(), from_addr);
+ } else {
+ __ movptr(dest->as_register(), from_addr);
+ }
break;
case T_INT:
__ movl(dest->as_register(), from_addr);
@@ -1364,6 +1368,12 @@
}
#endif
__ verify_oop(dest->as_register());
+ } else if (type == T_ADDRESS && addr->disp() == oopDesc::klass_offset_in_bytes()) {
+#ifdef _LP64
+ if (UseCompressedKlassPointers) {
+ __ decode_klass_not_null(dest->as_register());
+ }
+#endif
}
}
@@ -1705,7 +1715,7 @@
} else if (obj == klass_RInfo) {
klass_RInfo = dst;
}
- if (k->is_loaded() && !UseCompressedOops) {
+ if (k->is_loaded() && !UseCompressedKlassPointers) {
select_different_registers(obj, dst, k_RInfo, klass_RInfo);
} else {
Rtmp1 = op->tmp3()->as_register();
@@ -1881,7 +1891,7 @@
__ load_klass(klass_RInfo, value);
// get instance klass (it's already uncompressed)
- __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset()));
+ __ movptr(k_RInfo, Address(k_RInfo, ObjArrayKlass::element_klass_offset()));
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL);
// call out-of-line instance of __ check_klass_subtype_slow_path(...):
@@ -3349,7 +3359,7 @@
#ifndef _LP64
__ movptr(tmp, dst_klass_addr);
- __ movptr(tmp, Address(tmp, objArrayKlass::element_klass_offset()));
+ __ movptr(tmp, Address(tmp, ObjArrayKlass::element_klass_offset()));
__ push(tmp);
__ movl(tmp, Address(tmp, Klass::super_check_offset_offset()));
__ push(tmp);
@@ -3375,14 +3385,14 @@
// Allocate abi space for args but be sure to keep stack aligned
__ subptr(rsp, 6*wordSize);
__ load_klass(c_rarg3, dst);
- __ movptr(c_rarg3, Address(c_rarg3, objArrayKlass::element_klass_offset()));
+ __ movptr(c_rarg3, Address(c_rarg3, ObjArrayKlass::element_klass_offset()));
store_parameter(c_rarg3, 4);
__ movl(c_rarg3, Address(c_rarg3, Klass::super_check_offset_offset()));
__ call(RuntimeAddress(copyfunc_addr));
__ addptr(rsp, 6*wordSize);
#else
__ load_klass(c_rarg4, dst);
- __ movptr(c_rarg4, Address(c_rarg4, objArrayKlass::element_klass_offset()));
+ __ movptr(c_rarg4, Address(c_rarg4, ObjArrayKlass::element_klass_offset()));
__ movl(c_rarg3, Address(c_rarg4, Klass::super_check_offset_offset()));
__ call(RuntimeAddress(copyfunc_addr));
#endif
@@ -3446,7 +3456,7 @@
__ mov_metadata(tmp, default_type->constant_encoding());
#ifdef _LP64
if (UseCompressedKlassPointers) {
- __ encode_heap_oop(tmp);
+ __ encode_klass_not_null(tmp);
}
#endif
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1166,7 +1166,7 @@
}
LIR_Opr reg = rlock_result(x);
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
- if (!x->klass()->is_loaded() || UseCompressedOops) {
+ if (!x->klass()->is_loaded() || UseCompressedKlassPointers) {
tmp3 = new_register(objectType);
}
__ checkcast(reg, obj.result(), x->klass(),
@@ -1188,7 +1188,7 @@
}
obj.load_item();
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
- if (!x->klass()->is_loaded() || UseCompressedOops) {
+ if (!x->klass()->is_loaded() || UseCompressedKlassPointers) {
tmp3 = new_register(objectType);
}
__ instanceof(reg, obj.result(), x->klass(),
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -159,7 +159,7 @@
#ifdef _LP64
if (UseCompressedKlassPointers) { // Take care not to kill klass
movptr(t1, klass);
- encode_heap_oop_not_null(t1);
+ encode_klass_not_null(t1);
movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
} else
#endif
--- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -209,8 +209,6 @@
Register rcx_mh = rcx; // MH receiver; dies quickly and is recycled
Register rbx_method = rbx; // eventual target of this invocation
- address code_start = __ pc();
-
// here's where control starts out:
__ align(CodeEntryAlignment);
address entry_point = __ pc();
@@ -251,23 +249,7 @@
// rdx_first_arg_addr is live!
- if (TraceMethodHandles) {
- const char* name = vmIntrinsics::name_at(iid);
- if (*name == '_') name += 1;
- const size_t len = strlen(name) + 50;
- char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
- const char* suffix = "";
- if (vmIntrinsics::method_for(iid) == NULL ||
- !vmIntrinsics::method_for(iid)->access_flags().is_public()) {
- if (is_signature_polymorphic_static(iid))
- suffix = "/static";
- else
- suffix = "/private";
- }
- jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
- // note: stub look for mh in rcx
- trace_method_handle(_masm, qname);
- }
+ trace_method_handle_interpreter_entry(_masm, iid);
if (iid == vmIntrinsics::_invokeBasic) {
generate_method_handle_dispatch(_masm, iid, rcx_mh, noreg, not_for_compiler_entry);
@@ -287,14 +269,6 @@
generate_method_handle_dispatch(_masm, iid, rcx_recv, rbx_member, not_for_compiler_entry);
}
- if (PrintMethodHandleStubs) {
- address code_end = __ pc();
- tty->print_cr("--------");
- tty->print_cr("method handle interpreter entry for %s", vmIntrinsics::name_at(iid));
- Disassembler::decode(code_start, code_end);
- tty->cr();
- }
-
return entry_point;
}
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -55,8 +55,6 @@
Register temp2,
bool for_compiler_entry);
- static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
-
static Register saved_last_sp_register() {
// Should be in sharedRuntime, not here.
return LP64_ONLY(r13) NOT_LP64(rsi);
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1801,7 +1801,7 @@
assert_different_registers(src, src_pos, dst, dst_pos, rcx_lh);
arraycopy_range_checks(src, src_pos, dst, dst_pos, LENGTH, L_failed);
- // typeArrayKlass
+ // TypeArrayKlass
//
// src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
// dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
@@ -1864,7 +1864,7 @@
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
- // objArrayKlass
+ // ObjArrayKlass
__ BIND(L_objArray);
// live at this point: rcx_src_klass, src[_pos], dst[_pos]
@@ -1894,7 +1894,7 @@
// live at this point: rcx_src_klass, dst[_pos], src[_pos]
{
// Handy offsets:
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
int sco_offset = in_bytes(Klass::super_check_offset_offset());
Register rsi_dst_klass = rsi;
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -2604,7 +2604,7 @@
arraycopy_range_checks(src, src_pos, dst, dst_pos, r11_length,
r10, L_failed);
- // typeArrayKlass
+ // TypeArrayKlass
//
// src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
// dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
@@ -2670,7 +2670,7 @@
__ movl2ptr(count, r11_length); // length
__ jump(RuntimeAddress(long_copy_entry));
- // objArrayKlass
+ // ObjArrayKlass
__ BIND(L_objArray);
// live at this point: r10_src_klass, r11_length, src[_pos], dst[_pos]
@@ -2723,8 +2723,8 @@
assert_clean_int(sco_temp, rax);
generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy);
- // Fetch destination element klass from the objArrayKlass header.
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ // Fetch destination element klass from the ObjArrayKlass header.
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
__ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset));
__ movl( sco_temp, Address(r11_dst_klass, sco_offset));
assert_clean_int(sco_temp, rax);
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -949,7 +949,7 @@
__ load_klass(rbx, rax);
// Move superklass into EAX
__ load_klass(rax, rdx);
- __ movptr(rax, Address(rax, objArrayKlass::element_klass_offset()));
+ __ movptr(rax, Address(rax, ObjArrayKlass::element_klass_offset()));
// Compress array+index*wordSize+12 into a single register. Frees ECX.
__ lea(rdx, element_address);
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -970,7 +970,7 @@
// Move superklass into rax
__ load_klass(rax, rdx);
__ movptr(rax, Address(rax,
- objArrayKlass::element_klass_offset()));
+ ObjArrayKlass::element_klass_offset()));
// Compress array + index*oopSize + 12 into a single register. Frees rcx.
__ lea(rdx, element_address);
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -212,11 +212,11 @@
if (is_vtable_stub) {
// Vtable stub size
return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
- (UseCompressedOops ? 16 : 0); // 1 leaq can be 3 bytes + 1 long
+ (UseCompressedKlassPointers ? 16 : 0); // 1 leaq can be 3 bytes + 1 long
} else {
// Itable stub size
return (DebugVtables ? 512 : 74) + (CountCompiledCalls ? 13 : 0) +
- (UseCompressedOops ? 32 : 0); // 2 leaqs
+ (UseCompressedKlassPointers ? 32 : 0); // 2 leaqs
}
// In order to tune these parameters, run the JVM with VM options
// +PrintMiscellaneous and +WizardMode to see information about
--- a/hotspot/src/cpu/x86/vm/x86_32.ad Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad Wed Jul 05 18:25:45 2017 +0200
@@ -1424,6 +1424,11 @@
return true;
}
+bool Matcher::narrow_klass_use_complex_address() {
+ ShouldNotCallThis();
+ return true;
+}
+
// Is it better to copy float constants, or load them directly from memory?
// Intel can load a float constant from a direct address, requiring no
@@ -1553,9 +1558,6 @@
// Returns true if the high 32 bits of the value is known to be zero.
bool is_operand_hi32_zero(Node* n) {
int opc = n->Opcode();
- if (opc == Op_LoadUI2L) {
- return true;
- }
if (opc == Op_AndL) {
Node* o2 = n->in(2);
if (o2->is_Con() && (o2->get_long() & 0xFFFFFFFF00000000LL) == 0LL) {
@@ -6147,8 +6149,8 @@
%}
// Load Unsigned Integer into Long Register
-instruct loadUI2L(eRegL dst, memory mem, eFlagsReg cr) %{
- match(Set dst (LoadUI2L mem));
+instruct loadUI2L(eRegL dst, memory mem, immL_32bits mask, eFlagsReg cr) %{
+ match(Set dst (AndL (ConvI2L (LoadI mem)) mask));
effect(KILL cr);
ins_cost(250);
@@ -12145,8 +12147,8 @@
ins_cost(1100); // slightly larger than the next version
format %{ "MOV EDI,[$sub+Klass::secondary_supers]\n\t"
- "MOV ECX,[EDI+arrayKlass::length]\t# length to scan\n\t"
- "ADD EDI,arrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
+ "MOV ECX,[EDI+ArrayKlass::length]\t# length to scan\n\t"
+ "ADD EDI,ArrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
"REPNE SCASD\t# Scan *EDI++ for a match with EAX while CX-- != 0\n\t"
"JNE,s miss\t\t# Missed: EDI not-zero\n\t"
"MOV [$sub+Klass::secondary_super_cache],$super\t# Hit: update cache\n\t"
@@ -12164,8 +12166,8 @@
ins_cost(1000);
format %{ "MOV EDI,[$sub+Klass::secondary_supers]\n\t"
- "MOV ECX,[EDI+arrayKlass::length]\t# length to scan\n\t"
- "ADD EDI,arrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
+ "MOV ECX,[EDI+ArrayKlass::length]\t# length to scan\n\t"
+ "ADD EDI,ArrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
"REPNE SCASD\t# Scan *EDI++ for a match with EAX while CX-- != 0\n\t"
"JNE,s miss\t\t# Missed: flags NZ\n\t"
"MOV [$sub+Klass::secondary_super_cache],$super\t# Hit: update cache, flags Z\n\t"
--- a/hotspot/src/cpu/x86/vm/x86_64.ad Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad Wed Jul 05 18:25:45 2017 +0200
@@ -1409,10 +1409,10 @@
#ifndef PRODUCT
void MachUEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
{
- if (UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
st->print_cr("movl rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
- if (Universe::narrow_oop_shift() != 0) {
- st->print_cr("\tdecode_heap_oop_not_null rscratch1, rscratch1");
+ if (Universe::narrow_klass_shift() != 0) {
+ st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
}
st->print_cr("\tcmpq rax, rscratch1\t # Inline cache check");
} else {
@@ -1428,7 +1428,7 @@
{
MacroAssembler masm(&cbuf);
uint insts_size = cbuf.insts_size();
- if (UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
masm.load_klass(rscratch1, j_rarg0);
masm.cmpptr(rax, rscratch1);
} else {
@@ -1576,6 +1576,11 @@
return (LogMinObjAlignmentInBytes <= 3);
}
+bool Matcher::narrow_klass_use_complex_address() {
+ assert(UseCompressedKlassPointers, "only for compressed klass code");
+ return (LogKlassAlignmentInBytes <= 3);
+}
+
// Is it better to copy float constants, or load them directly from
// memory? Intel can load a float constant from a direct address,
// requiring no extra registers. Most RISCs will have to materialize
@@ -3139,6 +3144,14 @@
interface(CONST_INTER);
%}
+operand immNKlass() %{
+ match(ConNKlass);
+
+ op_cost(10);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// NULL Pointer Immediate
operand immN0() %{
predicate(n->get_narrowcon() == 0);
@@ -4038,6 +4051,145 @@
%}
%}
+operand indirectNarrowKlass(rRegN reg)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(DecodeNKlass reg);
+
+ format %{ "[$reg]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x4);
+ scale(0x0);
+ disp(0x0);
+ %}
+%}
+
+operand indOffset8NarrowKlass(rRegN reg, immL8 off)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) off);
+
+ format %{ "[$reg + $off (8-bit)]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x4);
+ scale(0x0);
+ disp($off);
+ %}
+%}
+
+operand indOffset32NarrowKlass(rRegN reg, immL32 off)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) off);
+
+ format %{ "[$reg + $off (32-bit)]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x4);
+ scale(0x0);
+ disp($off);
+ %}
+%}
+
+operand indIndexOffsetNarrowKlass(rRegN reg, rRegL lreg, immL32 off)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (AddP (DecodeNKlass reg) lreg) off);
+
+ op_cost(10);
+ format %{"[$reg + $off + $lreg]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale(0x0);
+ disp($off);
+ %}
+%}
+
+operand indIndexNarrowKlass(rRegN reg, rRegL lreg)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) lreg);
+
+ op_cost(10);
+ format %{"[$reg + $lreg]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale(0x0);
+ disp(0x0);
+ %}
+%}
+
+operand indIndexScaleNarrowKlass(rRegN reg, rRegL lreg, immI2 scale)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) (LShiftL lreg scale));
+
+ op_cost(10);
+ format %{"[$reg + $lreg << $scale]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale($scale);
+ disp(0x0);
+ %}
+%}
+
+operand indIndexScaleOffsetNarrowKlass(rRegN reg, immL32 off, rRegL lreg, immI2 scale)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (AddP (DecodeNKlass reg) (LShiftL lreg scale)) off);
+
+ op_cost(10);
+ format %{"[$reg + $off + $lreg << $scale]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale($scale);
+ disp($off);
+ %}
+%}
+
+operand indCompressedKlassOffset(rRegN reg, immL32 off) %{
+ predicate(UseCompressedKlassPointers && (Universe::narrow_klass_shift() == Address::times_8));
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) off);
+
+ op_cost(10);
+ format %{"[R12 + $reg << 3 + $off] (compressed klass addressing)" %}
+ interface(MEMORY_INTER) %{
+ base(0xc); // R12
+ index($reg);
+ scale(0x3);
+ disp($off);
+ %}
+%}
+
+operand indPosIndexScaleOffsetNarrowKlass(rRegN reg, immL32 off, rRegI idx, immI2 scale)
+%{
+ constraint(ALLOC_IN_RC(ptr_reg));
+ predicate(Universe::narrow_klass_shift() == 0 && n->in(2)->in(3)->in(1)->as_Type()->type()->is_long()->_lo >= 0);
+ match(AddP (AddP (DecodeNKlass reg) (LShiftL (ConvI2L idx) scale)) off);
+
+ op_cost(10);
+ format %{"[$reg + $off + $idx << $scale]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($idx);
+ scale($scale);
+ disp($off);
+ %}
+%}
//----------Special Memory Operands--------------------------------------------
// Stack Slot Operand - This operand is used for loading and storing temporary
@@ -4209,7 +4361,11 @@
indCompressedOopOffset,
indirectNarrow, indOffset8Narrow, indOffset32Narrow,
indIndexOffsetNarrow, indIndexNarrow, indIndexScaleNarrow,
- indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow);
+ indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow,
+ indCompressedKlassOffset,
+ indirectNarrowKlass, indOffset8NarrowKlass, indOffset32NarrowKlass,
+ indIndexOffsetNarrowKlass, indIndexNarrowKlass, indIndexScaleNarrowKlass,
+ indIndexScaleOffsetNarrowKlass, indPosIndexScaleOffsetNarrowKlass);
//----------PIPELINE-----------------------------------------------------------
// Rules which define the behavior of the target architectures pipeline.
@@ -5044,9 +5200,9 @@
%}
// Load Unsigned Integer into Long Register
-instruct loadUI2L(rRegL dst, memory mem)
-%{
- match(Set dst (LoadUI2L mem));
+instruct loadUI2L(rRegL dst, memory mem, immL_32bits mask)
+%{
+ match(Set dst (AndL (ConvI2L (LoadI mem)) mask));
ins_cost(125);
format %{ "movl $dst, $mem\t# uint -> long" %}
@@ -5469,6 +5625,22 @@
ins_pipe(ialu_reg_fat); // XXX
%}
+instruct loadConNKlass(rRegN dst, immNKlass src) %{
+ match(Set dst src);
+
+ ins_cost(125);
+ format %{ "movl $dst, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ address con = (address)$src$$constant;
+ if (con == NULL) {
+ ShouldNotReachHere();
+ } else {
+ __ set_narrow_klass($dst$$Register, (Klass*)$src$$constant);
+ }
+ %}
+ ins_pipe(ialu_reg_fat); // XXX
+%}
+
instruct loadConF0(regF dst, immF0 src)
%{
match(Set dst src);
@@ -5738,7 +5910,7 @@
instruct storeImmP0(memory mem, immP0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreP mem zero));
ins_cost(125); // XXX
@@ -5774,9 +5946,21 @@
ins_pipe(ialu_mem_reg);
%}
+instruct storeNKlass(memory mem, rRegN src)
+%{
+ match(Set mem (StoreNKlass mem src));
+
+ ins_cost(125); // XXX
+ format %{ "movl $mem, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ __ movl($mem$$Address, $src$$Register);
+ %}
+ ins_pipe(ialu_mem_reg);
+%}
+
instruct storeImmN0(memory mem, immN0 zero)
%{
- predicate(Universe::narrow_oop_base() == NULL);
+ predicate(Universe::narrow_oop_base() == NULL && Universe::narrow_klass_base() == NULL);
match(Set mem (StoreN mem zero));
ins_cost(125); // XXX
@@ -5804,10 +5988,22 @@
ins_pipe(ialu_mem_imm);
%}
+instruct storeImmNKlass(memory mem, immNKlass src)
+%{
+ match(Set mem (StoreNKlass mem src));
+
+ ins_cost(150); // XXX
+ format %{ "movl $mem, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ __ set_narrow_klass($mem$$Address, (Klass*)$src$$constant);
+ %}
+ ins_pipe(ialu_mem_imm);
+%}
+
// Store Integer Immediate
instruct storeImmI0(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreI mem zero));
ins_cost(125); // XXX
@@ -5832,7 +6028,7 @@
// Store Long Immediate
instruct storeImmL0(memory mem, immL0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreL mem zero));
ins_cost(125); // XXX
@@ -5857,7 +6053,7 @@
// Store Short/Char Immediate
instruct storeImmC0(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreC mem zero));
ins_cost(125); // XXX
@@ -5883,7 +6079,7 @@
// Store Byte Immediate
instruct storeImmB0(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreB mem zero));
ins_cost(125); // XXX
@@ -5908,7 +6104,7 @@
// Store CMS card-mark Immediate
instruct storeImmCM0_reg(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreCM mem zero));
ins_cost(125); // XXX
@@ -5946,7 +6142,7 @@
// Store immediate Float value (it is faster than store from XMM register)
instruct storeF0(memory mem, immF0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreF mem zero));
ins_cost(25); // XXX
@@ -5996,7 +6192,7 @@
instruct storeD0(memory mem, immD0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreD mem zero));
ins_cost(25); // XXX
@@ -6482,6 +6678,32 @@
ins_pipe(ialu_reg_long);
%}
+instruct encodeKlass_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
+ match(Set dst (EncodePKlass src));
+ effect(KILL cr);
+ format %{ "encode_heap_oop_not_null $dst,$src" %}
+ ins_encode %{
+ __ encode_klass_not_null($dst$$Register, $src$$Register);
+ %}
+ ins_pipe(ialu_reg_long);
+%}
+
+instruct decodeKlass_not_null(rRegP dst, rRegN src, rFlagsReg cr) %{
+ match(Set dst (DecodeNKlass src));
+ effect(KILL cr);
+ format %{ "decode_heap_oop_not_null $dst,$src" %}
+ ins_encode %{
+ Register s = $src$$Register;
+ Register d = $dst$$Register;
+ if (s != d) {
+ __ decode_klass_not_null(d, s);
+ } else {
+ __ decode_klass_not_null(d);
+ }
+ %}
+ ins_pipe(ialu_reg_long);
+%}
+
//----------Conditional Move---------------------------------------------------
// Jump
@@ -10452,7 +10674,7 @@
instruct testP_mem_reg0(rFlagsReg cr, memory mem, immP0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set cr (CmpP (LoadP mem) zero));
format %{ "cmpq R12, $mem\t# ptr (R12_heapbase==0)" %}
@@ -10503,6 +10725,27 @@
ins_pipe(ialu_cr_reg_mem);
%}
+instruct compN_rReg_imm_klass(rFlagsRegU cr, rRegN op1, immNKlass op2) %{
+ match(Set cr (CmpN op1 op2));
+
+ format %{ "cmpl $op1, $op2\t# compressed klass ptr" %}
+ ins_encode %{
+ __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
+ %}
+ ins_pipe(ialu_cr_reg_imm);
+%}
+
+instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
+%{
+ match(Set cr (CmpN src (LoadNKlass mem)));
+
+ format %{ "cmpl $mem, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
+ %}
+ ins_pipe(ialu_cr_reg_mem);
+%}
+
instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
match(Set cr (CmpN src zero));
@@ -10526,7 +10769,7 @@
instruct testN_mem_reg0(rFlagsReg cr, memory mem, immN0 zero)
%{
- predicate(Universe::narrow_oop_base() == NULL);
+ predicate(Universe::narrow_oop_base() == NULL && (Universe::narrow_klass_base() == NULL));
match(Set cr (CmpN (LoadN mem) zero));
format %{ "cmpl R12, $mem\t# compressed ptr (R12_heapbase==0)" %}
--- a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
--- a/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
--- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -267,8 +267,8 @@
printf("\n");
- GEN_OFFS(NarrowOopStruct, _base);
- GEN_OFFS(NarrowOopStruct, _shift);
+ GEN_OFFS(NarrowPtrStruct, _base);
+ GEN_OFFS(NarrowPtrStruct, _shift);
printf("\n");
GEN_VALUE(SIZE_HeapBlockHeader, (int) sizeof(HeapBlock::Header));
--- a/hotspot/src/os/bsd/dtrace/jhelper.d Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/bsd/dtrace/jhelper.d Wed Jul 05 18:25:45 2017 +0200
@@ -45,10 +45,6 @@
extern pointer __1cJCodeCacheF_heap_;
extern pointer __1cIUniverseO_collectedHeap_;
-extern pointer __1cIUniverseL_narrow_oop_;
-#ifdef _LP64
-extern pointer UseCompressedOops;
-#endif
extern pointer __1cHnmethodG__vtbl_;
extern pointer __1cNMethodG__vtbl_;
@@ -136,8 +132,8 @@
copyin_offset(SIZE_oopDesc);
copyin_offset(SIZE_ConstantPool);
- copyin_offset(OFFSET_NarrowOopStruct_base);
- copyin_offset(OFFSET_NarrowOopStruct_shift);
+ copyin_offset(OFFSET_NarrowPtrStruct_base);
+ copyin_offset(OFFSET_NarrowPtrStruct_shift);
/*
* The PC to translate is in arg0.
@@ -159,17 +155,6 @@
this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
/* Reading volatile values */
-#ifdef _LP64
- this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
-#else
- this->Use_Compressed_Oops = 0;
-#endif
-
- this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_base);
- this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_shift);
-
this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
--- a/hotspot/src/os/bsd/vm/decoder_machO.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/bsd/vm/decoder_machO.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/os/linux/vm/decoder_linux.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/linux/vm/decoder_linux.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/os/linux/vm/vmError_linux.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/linux/vm/vmError_linux.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -44,7 +44,7 @@
jio_snprintf(p, buflen - len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n"
+ "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " UINTX_FORMAT " (" INTPTR_FORMAT ")\n"
"Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(), os::current_process_id(),
--- a/hotspot/src/os/posix/launcher/java_md.c Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/posix/launcher/java_md.c Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os/posix/launcher/launcher.script Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/posix/launcher/launcher.script Wed Jul 05 18:25:45 2017 +0200
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, 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
--- a/hotspot/src/os/posix/vm/os_posix.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/posix/vm/os_posix.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os/posix/vm/os_posix.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/posix/vm/os_posix.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -262,8 +262,8 @@
printf("\n");
- GEN_OFFS(NarrowOopStruct, _base);
- GEN_OFFS(NarrowOopStruct, _shift);
+ GEN_OFFS(NarrowPtrStruct, _base);
+ GEN_OFFS(NarrowPtrStruct, _shift);
printf("\n");
GEN_VALUE(SIZE_HeapBlockHeader, sizeof(HeapBlock::Header));
--- a/hotspot/src/os/solaris/dtrace/hs_private.d Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/dtrace/hs_private.d Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/os/solaris/dtrace/jhelper.d Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/dtrace/jhelper.d Wed Jul 05 18:25:45 2017 +0200
@@ -45,10 +45,6 @@
extern pointer __1cJCodeCacheF_heap_;
extern pointer __1cIUniverseO_collectedHeap_;
-extern pointer __1cIUniverseL_narrow_oop_;
-#ifdef _LP64
-extern pointer UseCompressedOops;
-#endif
extern pointer __1cHnmethodG__vtbl_;
extern pointer __1cGMethodG__vtbl_;
@@ -136,8 +132,8 @@
copyin_offset(SIZE_oopDesc);
copyin_offset(SIZE_ConstantPool);
- copyin_offset(OFFSET_NarrowOopStruct_base);
- copyin_offset(OFFSET_NarrowOopStruct_shift);
+ copyin_offset(OFFSET_NarrowPtrStruct_base);
+ copyin_offset(OFFSET_NarrowPtrStruct_shift);
/*
* The PC to translate is in arg0.
@@ -158,18 +154,6 @@
this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
- /* Reading volatile values */
-#ifdef _LP64
- this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
-#else
- this->Use_Compressed_Oops = 0;
-#endif
-
- this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_base);
- this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_shift);
-
this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
--- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/os/solaris/vm/decoder_solaris.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/vm/decoder_solaris.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -5870,15 +5870,6 @@
}
}
-// Just to get the Kernel build to link on solaris for testing.
-
-extern "C" {
-class ASGCT_CallTrace;
-void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext)
- KERNEL_RETURN;
-}
-
-
// ObjectMonitor park-unpark infrastructure ...
//
// We implement Solaris and Linux PlatformEvents with the
--- a/hotspot/src/os/solaris/vm/os_solaris.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/vm/os_solaris.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/os/windows/vm/decoder_windows.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/windows/vm/decoder_windows.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/os/windows/vm/decoder_windows.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/windows/vm/decoder_windows.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/os/windows/vm/jvm_windows.h Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/windows/vm/jvm_windows.h Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -61,8 +61,6 @@
typedef int socklen_t;
-// #include "jni.h"
-
#define JNI_ONLOAD_SYMBOLS {"_JNI_OnLoad@8", "JNI_OnLoad"}
#define JNI_ONUNLOAD_SYMBOLS {"_JNI_OnUnload@8", "JNI_OnUnload"}
#define JVM_ONLOAD_SYMBOLS {"_JVM_OnLoad@12", "JVM_OnLoad"}
@@ -108,10 +106,7 @@
* File I/O
*/
-// #include <sys/types.h>
-// #include <sys/stat.h>
-// #include <fcntl.h>
-// #include <errno.h>
+#include <sys/stat.h>
/* O Flags */
--- a/hotspot/src/os/windows/vm/os_windows.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/windows/vm/os_windows.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, 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
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2003, 2012, 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
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2004, 2012, 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
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/tools/ProjectCreator/Util.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/Util.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/adlc/adlparse.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/adlparse.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1392,7 +1392,7 @@
_AD.addForm(machnode);
}
else if (!strcmp(ident, "attributes")) {
- bool vsi_seen = false, bhds_seen = false;
+ bool vsi_seen = false;
skipws();
if ( (_curchar != '%')
@@ -1436,7 +1436,6 @@
}
pipeline->_branchHasDelaySlot = true;
- bhds_seen = true;
continue;
}
@@ -1639,6 +1638,12 @@
next_char(); // Skip "(" or ","
ident = get_ident(); // Grab next identifier
+ if (_AD._adl_debug > 1) {
+ if (ident != NULL) {
+ fprintf(stderr, "resource_parse: identifier: %s\n", ident);
+ }
+ }
+
if (ident == NULL) {
parse_err(SYNERR, "keyword identifier expected at \"%c\"\n", _curchar);
return;
@@ -2427,7 +2432,6 @@
int lparen = 0; // keep track of parenthesis nesting depth
int rparen = 0; // position of instruction at this depth
InstructForm *inst_seen = NULL;
- InstructForm *child_seen = NULL;
// Walk the match tree,
// Record <parent, position, instruction name, input position>
@@ -2437,7 +2441,7 @@
if (_curchar == '(') {
++lparen;
next_char();
- child_seen = peep_match_child_parse(match, parent, position, rparen);
+ ( void ) peep_match_child_parse(match, parent, position, rparen);
}
// Right paren signals end of an input, may be more
else if (_curchar == ')') {
@@ -3154,6 +3158,9 @@
//------------------------------size_parse-----------------------------------
+// Parse a 'size(<expr>)' attribute which specifies the size of the
+// emitted instructions in bytes. <expr> can be a C++ expression,
+// e.g. a constant.
char* ADLParser::size_parse(InstructForm *instr) {
char* sizeOfInstr = NULL;
@@ -4274,7 +4281,17 @@
|| ((c >= '0') && (c <= '9'))
|| ((c == '_')) || ((c == ':')) || ((c == '#')) );
if (start == end) { // We popped out on the first try
- parse_err(SYNERR, "identifier expected at %c\n", c);
+ // It can occur that `start' contains the rest of the input file.
+ // In this case the output should be truncated.
+ if (strlen(start) > 24) {
+ char buf[32];
+ strncpy(buf, start, 20);
+ buf[20] = '\0';
+ strcat(buf, "[...]");
+ parse_err(SYNERR, "Identifier expected, but found '%s'.", buf);
+ } else {
+ parse_err(SYNERR, "Identifier expected, but found '%s'.", start);
+ }
start = NULL;
}
else {
--- a/hotspot/src/share/vm/adlc/archDesc.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/archDesc.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -221,6 +221,7 @@
_register = NULL;
_encode = NULL;
_pipeline = NULL;
+ _frame = NULL;
}
ArchDesc::~ArchDesc() {
@@ -648,7 +649,10 @@
// Return the textual binding for a given CPP flag name.
// Return NULL if there is no binding, or it has been #undef-ed.
char* ArchDesc::get_preproc_def(const char* flag) {
- SourceForm* deff = (SourceForm*) _preproc_table[flag];
+ // In case of syntax errors, flag may take the value NULL.
+ SourceForm* deff = NULL;
+ if (flag != NULL)
+ deff = (SourceForm*) _preproc_table[flag];
return (deff == NULL) ? NULL : deff->_code;
}
@@ -803,7 +807,9 @@
while (i++ <= 15) fputc(' ', errfile);
fprintf(errfile, "%-8s:", pref);
vfprintf(errfile, fmt, args);
- fprintf(errfile, "\n"); }
+ fprintf(errfile, "\n");
+ fflush(errfile);
+ }
return 1;
}
@@ -855,8 +861,14 @@
// Check constraints on result's register class
const char *result_class = opForm.constrained_reg_class();
- if (!result_class) opForm.dump();
- assert( result_class, "Resulting register class was not defined for operand");
+ if (result_class == NULL) {
+ opForm.dump();
+ syntax_err(opForm._linenum,
+ "Use of an undefined result class for operand: %s",
+ opForm._ident);
+ abort();
+ }
+
regMask = reg_class_to_reg_mask( result_class );
return regMask;
@@ -865,8 +877,14 @@
// Obtain the name of the RegMask for an InstructForm
const char *ArchDesc::reg_mask(InstructForm &inForm) {
const char *result = inForm.reduce_result();
- assert( result,
- "Did not find result operand or RegMask for this instruction");
+
+ if (result == NULL) {
+ syntax_err(inForm._linenum,
+ "Did not find result operand or RegMask"
+ " for this instruction: %s",
+ inForm._ident);
+ abort();
+ }
// Instructions producing 'Universe' use RegMask::Empty
if( strcmp(result,"Universe")==0 ) {
@@ -875,10 +893,17 @@
// Lookup this result operand and get its register class
Form *form = (Form*)_globalNames[result];
- assert( form, "Result operand must be defined");
+ if (form == NULL) {
+ syntax_err(inForm._linenum,
+ "Did not find result operand for result: %s", result);
+ abort();
+ }
OperandForm *oper = form->is_operand();
- if (oper == NULL) form->dump();
- assert( oper, "Result must be an OperandForm");
+ if (oper == NULL) {
+ syntax_err(inForm._linenum, "Form is not an OperandForm:");
+ form->dump();
+ abort();
+ }
return reg_mask( *oper );
}
@@ -887,7 +912,13 @@
char *ArchDesc::stack_or_reg_mask(OperandForm &opForm) {
// name of cisc_spillable version
const char *reg_mask_name = reg_mask(opForm);
- assert( reg_mask_name != NULL, "called with incorrect opForm");
+
+ if (reg_mask_name == NULL) {
+ syntax_err(opForm._linenum,
+ "Did not find reg_mask for opForm: %s",
+ opForm._ident);
+ abort();
+ }
const char *stack_or = "STACK_OR_";
int length = (int)strlen(stack_or) + (int)strlen(reg_mask_name) + 1;
@@ -968,7 +999,8 @@
// Create InstructForm and assign type for each ideal instruction.
for ( int j = _last_machine_leaf+1; j < _last_opcode; ++j) {
char *ident = (char *)NodeClassNames[j];
- if(!strcmp(ident, "ConI") || !strcmp(ident, "ConP") || !strcmp(ident, "ConN") ||
+ if(!strcmp(ident, "ConI") || !strcmp(ident, "ConP") ||
+ !strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") ||
!strcmp(ident, "ConF") || !strcmp(ident, "ConD") ||
!strcmp(ident, "ConL") || !strcmp(ident, "Con" ) ||
!strcmp(ident, "Bool") ) {
--- a/hotspot/src/share/vm/adlc/archDesc.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/archDesc.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -365,13 +365,14 @@
// A derived class defines the appropriate output for a specific mapping.
class OutputMap {
protected:
- FILE *_hpp;
- FILE *_cpp;
- FormDict &_globals;
- ArchDesc &_AD;
+ FILE *_hpp;
+ FILE *_cpp;
+ FormDict &_globals;
+ ArchDesc &_AD;
+ const char *_name;
public:
- OutputMap (FILE *decl_file, FILE *def_file, FormDict &globals, ArchDesc &AD)
- : _hpp(decl_file), _cpp(def_file), _globals(globals), _AD(AD) {};
+ OutputMap (FILE *decl_file, FILE *def_file, FormDict &globals, ArchDesc &AD, const char *name)
+ : _hpp(decl_file), _cpp(def_file), _globals(globals), _AD(AD), _name(name) {};
// Access files used by this routine
FILE *decl_file() { return _hpp; }
FILE *def_file() { return _cpp; }
--- a/hotspot/src/share/vm/adlc/dict2.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/dict2.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -33,7 +33,7 @@
// String hash tables
#define MAXID 20
static char initflag = 0; // True after 1st initialization
-static char shft[MAXID] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6};
+static char shft[MAXID + 1] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7};
static short xsum[MAXID];
//------------------------------bucket---------------------------------------
--- a/hotspot/src/share/vm/adlc/filebuff.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/filebuff.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -31,10 +31,14 @@
using namespace std;
// STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
-typedef struct {
+
+class BufferedFile {
+ public:
const char *_name;
FILE *_fp;
-} BufferedFile;
+ inline BufferedFile() { _name = NULL; _fp = NULL; };
+ inline ~BufferedFile() {};
+};
class ArchDesc;
--- a/hotspot/src/share/vm/adlc/forms.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/forms.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -215,6 +215,7 @@
if (strcmp(name,"ConI")==0) return Form::idealI;
if (strcmp(name,"ConP")==0) return Form::idealP;
if (strcmp(name,"ConN")==0) return Form::idealN;
+ if (strcmp(name,"ConNKlass")==0) return Form::idealNKlass;
if (strcmp(name,"ConL")==0) return Form::idealL;
if (strcmp(name,"ConF")==0) return Form::idealF;
if (strcmp(name,"ConD")==0) return Form::idealD;
@@ -255,9 +256,8 @@
if( strcmp(opType,"LoadD_unaligned")==0 ) return Form::idealD;
if( strcmp(opType,"LoadF")==0 ) return Form::idealF;
if( strcmp(opType,"LoadI")==0 ) return Form::idealI;
- if( strcmp(opType,"LoadUI2L")==0 ) return Form::idealI;
if( strcmp(opType,"LoadKlass")==0 ) return Form::idealP;
- if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealN;
+ if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealNKlass;
if( strcmp(opType,"LoadL")==0 ) return Form::idealL;
if( strcmp(opType,"LoadL_unaligned")==0 ) return Form::idealL;
if( strcmp(opType,"LoadPLocked")==0 ) return Form::idealP;
@@ -280,6 +280,7 @@
if( strcmp(opType,"StoreL")==0) return Form::idealL;
if( strcmp(opType,"StoreP")==0) return Form::idealP;
if( strcmp(opType,"StoreN")==0) return Form::idealN;
+ if( strcmp(opType,"StoreNKlass")==0) return Form::idealNKlass;
if( strcmp(opType,"StoreVector")==0 ) return Form::idealV;
assert( strcmp(opType,"Store") != 0, "Must type Stores" );
return Form::none;
--- a/hotspot/src/share/vm/adlc/forms.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/forms.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -173,7 +173,8 @@
idealC = 7, // Char type
idealS = 8, // String type
idealN = 9, // Narrow oop types
- idealV = 10 // Vector type
+ idealNKlass = 10, // Narrow klass types
+ idealV = 11 // Vector type
};
// Convert ideal name to a DataType, return DataType::none if not a 'ConX'
Form::DataType ideal_to_const_type(const char *ideal_type_name) const;
@@ -448,11 +449,11 @@
// Return number of USEs + number of DEFs
int num_operands();
// Return zero-based position in list; -1 if not in list.
- int operand_position(const char *name, int usedef);
+ int operand_position(const char *name, int usedef, Form *fm);
// Find position for this name, regardless of use/def information
int operand_position(const char *name);
// Find position for this name when looked up for output via "format"
- int operand_position_format(const char *name);
+ int operand_position_format(const char *name, Form *fm);
// Find position for the Label when looked up for output via "format"
int label_position();
// Find position for the Method when looked up for output via "format"
--- a/hotspot/src/share/vm/adlc/formssel.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/formssel.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -567,7 +567,7 @@
if( strcmp(rc_name,"stack_slots") ) {
// Check for ideal_type of RegFlags
const char *type = opform->ideal_type( globals, registers );
- if( !strcmp(type,"RegFlags") )
+ if( (type != NULL) && !strcmp(type, "RegFlags") )
rematerialize = true;
} else
rematerialize = false; // Do not rematerialize things target stk
@@ -746,14 +746,16 @@
// Expected use is for pointer vs oop determination for LoadP
bool InstructForm::captures_bottom_type(FormDict &globals) const {
if( _matrule && _matrule->_rChild &&
- (!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
- !strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
- !strcmp(_matrule->_rChild->_opType,"DecodeN") ||
- !strcmp(_matrule->_rChild->_opType,"EncodeP") ||
- !strcmp(_matrule->_rChild->_opType,"LoadN") ||
- !strcmp(_matrule->_rChild->_opType,"GetAndSetN") ||
- !strcmp(_matrule->_rChild->_opType,"LoadNKlass") ||
- !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception
+ (!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
+ !strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
+ !strcmp(_matrule->_rChild->_opType,"DecodeN") ||
+ !strcmp(_matrule->_rChild->_opType,"EncodeP") ||
+ !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
+ !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
+ !strcmp(_matrule->_rChild->_opType,"LoadN") ||
+ !strcmp(_matrule->_rChild->_opType,"GetAndSetN") ||
+ !strcmp(_matrule->_rChild->_opType,"LoadNKlass") ||
+ !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception
!strcmp(_matrule->_rChild->_opType,"CheckCastPP")) ) return true;
else if ( is_ideal_load() == Form::idealP ) return true;
else if ( is_ideal_store() != Form::none ) return true;
@@ -793,6 +795,20 @@
return num_opnds;
}
+const char *InstructForm::opnd_ident(int idx) {
+ return _components.at(idx)->_name;
+}
+
+const char *InstructForm::unique_opnd_ident(int idx) {
+ uint i;
+ for (i = 1; i < num_opnds(); ++i) {
+ if (unique_opnds_idx(i) == idx) {
+ break;
+ }
+ }
+ return (_components.at(i) != NULL) ? _components.at(i)->_name : "";
+}
+
// Return count of unmatched operands.
uint InstructForm::num_post_match_opnds() {
uint num_post_match_opnds = _components.count();
@@ -864,6 +880,9 @@
return base;
}
+// This function determines the order of the MachOper in _opnds[]
+// by writing the operand names into the _components list.
+//
// Implementation does not modify state of internal structures
void InstructForm::build_components() {
// Add top-level operands to the components
@@ -959,11 +978,11 @@
// Return zero-based position in component list; -1 if not in list.
int InstructForm::operand_position(const char *name, int usedef) {
- return unique_opnds_idx(_components.operand_position(name, usedef));
+ return unique_opnds_idx(_components.operand_position(name, usedef, this));
}
int InstructForm::operand_position_format(const char *name) {
- return unique_opnds_idx(_components.operand_position_format(name));
+ return unique_opnds_idx(_components.operand_position_format(name, this));
}
// Return zero-based position in component list; -1 if not in list.
@@ -1223,7 +1242,7 @@
if (different) {
globalAD->syntax_err(short_branch->_linenum, "Instruction %s and its short form %s have different parameters\n", _ident, short_branch->_ident);
}
- if (AD._short_branch_debug) {
+ if (AD._adl_debug > 1 || AD._short_branch_debug) {
fprintf(stderr, "Instruction %s has short form %s\n", _ident, short_branch->_ident);
}
_short_branch_form = short_branch;
@@ -1255,16 +1274,19 @@
// Find replacement variable's type
const Form *form = _localNames[rep_var];
if (form == NULL) {
- fprintf(stderr, "unknown replacement variable in format statement: '%s'\n", rep_var);
- assert(false, "ShouldNotReachHere()");
+ globalAD->syntax_err(_linenum, "Unknown replacement variable %s in format statement of %s.",
+ rep_var, _ident);
+ return;
}
OpClassForm *opc = form->is_opclass();
assert( opc, "replacement variable was not found in local names");
// Lookup the index position of the replacement variable
int idx = operand_position_format(rep_var);
if ( idx == -1 ) {
- assert( strcmp(opc->_ident,"label")==0, "Unimplemented");
- assert( false, "ShouldNotReachHere()");
+ globalAD->syntax_err(_linenum, "Could not find replacement variable %s in format statement of %s.\n",
+ rep_var, _ident);
+ assert(strcmp(opc->_ident, "label") == 0, "Unimplemented");
+ return;
}
if (is_noninput_operand(idx)) {
@@ -1273,7 +1295,7 @@
OperandForm* oper = form->is_operand();
if (oper != NULL && oper->is_bound_register()) {
const RegDef* first = oper->get_RegClass()->find_first_elem();
- fprintf(fp, " tty->print(\"%s\");\n", first->_regname);
+ fprintf(fp, " st->print(\"%s\");\n", first->_regname);
} else {
globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
}
@@ -1371,26 +1393,28 @@
// idx0=0 is used to indicate that info comes from this same node, not from input edge.
// idx1 starts at oper_input_base()
if ( cur_num_opnds >= 1 ) {
- fprintf(fp," // Start at oper_input_base() and count operands\n");
- fprintf(fp," unsigned %sidx0 = %d;\n", prefix, oper_input_base(globals));
- fprintf(fp," unsigned %sidx1 = %d;\n", prefix, oper_input_base(globals));
+ fprintf(fp," // Start at oper_input_base() and count operands\n");
+ fprintf(fp," unsigned %sidx0 = %d;\n", prefix, oper_input_base(globals));
+ fprintf(fp," unsigned %sidx1 = %d;", prefix, oper_input_base(globals));
+ fprintf(fp," \t// %s\n", unique_opnd_ident(1));
// Generate starting points for other unique operands if they exist
for ( idx = 2; idx < num_unique_opnds(); ++idx ) {
if( *receiver == 0 ) {
- fprintf(fp," unsigned %sidx%d = %sidx%d + opnd_array(%d)->num_edges();\n",
+ fprintf(fp," unsigned %sidx%d = %sidx%d + opnd_array(%d)->num_edges();",
prefix, idx, prefix, idx-1, idx-1 );
} else {
- fprintf(fp," unsigned %sidx%d = %sidx%d + %s_opnds[%d]->num_edges();\n",
+ fprintf(fp," unsigned %sidx%d = %sidx%d + %s_opnds[%d]->num_edges();",
prefix, idx, prefix, idx-1, receiver, idx-1 );
}
+ fprintf(fp," \t// %s\n", unique_opnd_ident(idx));
}
}
if( *receiver != 0 ) {
// This value is used by generate_peepreplace when copying a node.
// Don't emit it in other cases since it can hide bugs with the
// use invalid idx's.
- fprintf(fp," unsigned %sidx%d = %sreq(); \n", prefix, idx, receiver);
+ fprintf(fp," unsigned %sidx%d = %sreq(); \n", prefix, idx, receiver);
}
}
@@ -1774,9 +1798,25 @@
return Component::INVALID;
}
+const char *Component::getUsedefName() {
+ switch (_usedef) {
+ case Component::INVALID: return "INVALID"; break;
+ case Component::USE: return "USE"; break;
+ case Component::USE_DEF: return "USE_DEF"; break;
+ case Component::USE_KILL: return "USE_KILL"; break;
+ case Component::KILL: return "KILL"; break;
+ case Component::TEMP: return "TEMP"; break;
+ case Component::DEF: return "DEF"; break;
+ case Component::CALL: return "CALL"; break;
+ default: assert(false, "unknown effect");
+ }
+ return "Undefined Use/Def info";
+}
+
Effect::Effect(const char *name) : _name(name), _use_def(effect_lookup(name)) {
_ftype = Form::EFF;
}
+
Effect::~Effect() {
}
@@ -2273,7 +2313,7 @@
}
int OperandForm::operand_position(const char *name, int usedef) {
- return _components.operand_position(name, usedef);
+ return _components.operand_position(name, usedef, this);
}
@@ -2399,20 +2439,20 @@
if (_matrule && (_matrule->is_base_register(globals) ||
strcmp(ideal_type(globalAD->globalNames()), "RegFlags") == 0)) {
// !!!!! !!!!!
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node,reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node,reg_str);\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else if (_matrule && (dtype = _matrule->is_base_constant(globals)) != Form::none) {
format_constant( fp, index, dtype );
} else if (ideal_to_sReg_type(_ident) != Form::none) {
// Special format for Stack Slot Register
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node,reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node,reg_str);\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else {
- fprintf(fp,"tty->print(\"No format defined for %s\n\");\n", _ident);
+ fprintf(fp," st->print(\"No format defined for %s\n\");\n", _ident);
fflush(fp);
fprintf(stderr,"No format defined for %s\n", _ident);
dump();
@@ -2426,36 +2466,37 @@
Form::DataType dtype;
if (_matrule && (_matrule->is_base_register(globals) ||
strcmp(ideal_type(globalAD->globalNames()), "RegFlags") == 0)) {
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node->in(idx");
- if ( index != 0 ) fprintf(fp, "+%d",index);
- fprintf(fp, "),reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node->in(idx");
+ if ( index != 0 ) fprintf(fp, "+%d",index);
+ fprintf(fp, "),reg_str);\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else if (_matrule && (dtype = _matrule->is_base_constant(globals)) != Form::none) {
format_constant( fp, index, dtype );
} else if (ideal_to_sReg_type(_ident) != Form::none) {
// Special format for Stack Slot Register
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node->in(idx");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node->in(idx");
if ( index != 0 ) fprintf(fp, "+%d",index);
fprintf(fp, "),reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else {
- fprintf(fp,"tty->print(\"No format defined for %s\n\");\n", _ident);
+ fprintf(fp," st->print(\"No format defined for %s\n\");\n", _ident);
assert( false,"Internal error:\n output_external_operand() attempting to output other than a Register or Constant");
}
}
void OperandForm::format_constant(FILE *fp, uint const_index, uint const_type) {
switch(const_type) {
- case Form::idealI: fprintf(fp,"st->print(\"#%%d\", _c%d);\n", const_index); break;
- case Form::idealP: fprintf(fp,"_c%d->dump_on(st);\n", const_index); break;
- case Form::idealN: fprintf(fp,"_c%d->dump_on(st);\n", const_index); break;
- case Form::idealL: fprintf(fp,"st->print(\"#%%lld\", _c%d);\n", const_index); break;
- case Form::idealF: fprintf(fp,"st->print(\"#%%f\", _c%d);\n", const_index); break;
- case Form::idealD: fprintf(fp,"st->print(\"#%%f\", _c%d);\n", const_index); break;
+ case Form::idealI: fprintf(fp," st->print(\"#%%d\", _c%d);\n", const_index); break;
+ case Form::idealP: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
+ case Form::idealNKlass:
+ case Form::idealN: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
+ case Form::idealL: fprintf(fp," st->print(\"#%%lld\", _c%d);\n", const_index); break;
+ case Form::idealF: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
+ case Form::idealD: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
default:
assert( false, "ShouldNotReachHere()");
}
@@ -2825,17 +2866,8 @@
fprintf(fp,"Component:"); // Write to output files
fprintf(fp, " name = %s", _name);
fprintf(fp, ", type = %s", _type);
- const char * usedef = "Undefined Use/Def info";
- switch (_usedef) {
- case USE: usedef = "USE"; break;
- case USE_DEF: usedef = "USE_DEF"; break;
- case USE_KILL: usedef = "USE_KILL"; break;
- case KILL: usedef = "KILL"; break;
- case TEMP: usedef = "TEMP"; break;
- case DEF: usedef = "DEF"; break;
- default: assert(false, "unknown effect");
- }
- fprintf(fp, ", use/def = %s\n", usedef);
+ assert(_usedef != 0, "unknown effect");
+ fprintf(fp, ", use/def = %s\n", getUsedefName());
}
@@ -2927,9 +2959,9 @@
return count;
}
-// Return zero-based position in list; -1 if not in list.
+// Return zero-based position of operand 'name' in list; -1 if not in list.
// if parameter 'usedef' is ::USE, it will match USE, USE_DEF, ...
-int ComponentList::operand_position(const char *name, int usedef) {
+int ComponentList::operand_position(const char *name, int usedef, Form *fm) {
PreserveIter pi(this);
int position = 0;
int num_opnds = num_operands();
@@ -2952,10 +2984,18 @@
return position+1;
} else {
if( preceding_non_use && strcmp(component->_name, preceding_non_use->_name) ) {
- fprintf(stderr, "the name '%s' should not precede the name '%s'\n", preceding_non_use->_name, name);
+ fprintf(stderr, "the name '%s(%s)' should not precede the name '%s(%s)'",
+ preceding_non_use->_name, preceding_non_use->getUsedefName(),
+ name, component->getUsedefName());
+ if (fm && fm->is_instruction()) fprintf(stderr, "in form '%s'", fm->is_instruction()->_ident);
+ if (fm && fm->is_operand()) fprintf(stderr, "in form '%s'", fm->is_operand()->_ident);
+ fprintf(stderr, "\n");
}
if( position >= num_opnds ) {
- fprintf(stderr, "the name '%s' is too late in its name list\n", name);
+ fprintf(stderr, "the name '%s' is too late in its name list", name);
+ if (fm && fm->is_instruction()) fprintf(stderr, "in form '%s'", fm->is_instruction()->_ident);
+ if (fm && fm->is_operand()) fprintf(stderr, "in form '%s'", fm->is_operand()->_ident);
+ fprintf(stderr, "\n");
}
assert(position < num_opnds, "advertised index in bounds");
return position;
@@ -3001,10 +3041,10 @@
return Not_in_list;
}
-int ComponentList::operand_position_format(const char *name) {
+int ComponentList::operand_position_format(const char *name, Form *fm) {
PreserveIter pi(this);
int first_position = operand_position(name);
- int use_position = operand_position(name, Component::USE);
+ int use_position = operand_position(name, Component::USE, fm);
return ((first_position < use_position) ? use_position : first_position);
}
@@ -3267,8 +3307,8 @@
// If we are a "Set", start from the right child.
const MatchNode *const mnode = sets_result() ?
- (const MatchNode *const)this->_rChild :
- (const MatchNode *const)this;
+ (const MatchNode *)this->_rChild :
+ (const MatchNode *)this;
// If our right child exists, it is the right reduction
if ( mnode->_rChild ) {
@@ -3285,8 +3325,8 @@
// If we are a "Set", start from the right child.
const MatchNode *const mnode = sets_result() ?
- (const MatchNode *const)this->_rChild :
- (const MatchNode *const)this;
+ (const MatchNode *)this->_rChild :
+ (const MatchNode *)this;
// If our left child exists, it is the left reduction
if ( mnode->_lChild ) {
@@ -3390,9 +3430,9 @@
int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
static const char *needs_ideal_memory_list[] = {
- "StoreI","StoreL","StoreP","StoreN","StoreD","StoreF" ,
+ "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
"StoreB","StoreC","Store" ,"StoreFP",
- "LoadI", "LoadUI2L", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
+ "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
"LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
"StoreVector", "LoadVector",
"LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
@@ -3947,6 +3987,8 @@
strcmp(opType,"ConvL2I")==0 ||
strcmp(opType,"DecodeN")==0 ||
strcmp(opType,"EncodeP")==0 ||
+ strcmp(opType,"EncodePKlass")==0 ||
+ strcmp(opType,"DecodeNKlass")==0 ||
strcmp(opType,"RoundDouble")==0 ||
strcmp(opType,"RoundFloat")==0 ||
strcmp(opType,"ReverseBytesI")==0 ||
@@ -4108,12 +4150,17 @@
output(stderr);
}
-void MatchRule::output(FILE *fp) {
+// Write just one line.
+void MatchRule::output_short(FILE *fp) {
fprintf(fp,"MatchRule: ( %s",_name);
if (_lChild) _lChild->output(fp);
if (_rChild) _rChild->output(fp);
- fprintf(fp," )\n");
- fprintf(fp," nesting depth = %d\n", _depth);
+ fprintf(fp," )");
+}
+
+void MatchRule::output(FILE *fp) {
+ output_short(fp);
+ fprintf(fp,"\n nesting depth = %d\n", _depth);
if (_result) fprintf(fp," Result Type = %s", _result);
fprintf(fp,"\n");
}
--- a/hotspot/src/share/vm/adlc/formssel.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/formssel.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -76,7 +76,7 @@
private:
bool _ideal_only; // Not a user-defined instruction
// Members used for tracking CISC-spilling
- uint _cisc_spill_operand;// Which operand may cisc-spill
+ int _cisc_spill_operand;// Which operand may cisc-spill
void set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; }
bool _is_cisc_alternate;
InstructForm *_cisc_spill_alternate;// cisc possible replacement
@@ -103,7 +103,7 @@
RewriteRule *_rewrule; // Rewrite rule for this instruction
FormatRule *_format; // Format for assembly generation
Peephole *_peephole; // List of peephole rules for instruction
- const char *_ins_pipe; // Instruction Scheduline description class
+ const char *_ins_pipe; // Instruction Scheduling description class
uint *_uniq_idx; // Indexes of unique operands
int _uniq_idx_length; // Length of _uniq_idx array
@@ -198,6 +198,7 @@
virtual const char *cost(); // Access ins_cost attribute
virtual uint num_opnds(); // Count of num_opnds for MachNode class
+ // Counts USE_DEF opnds twice. See also num_unique_opnds().
virtual uint num_post_match_opnds();
virtual uint num_consts(FormDict &globals) const;// Constants in match rule
// Constants in match rule with specified type
@@ -228,6 +229,7 @@
// Return number of relocation entries needed for this instruction.
virtual uint reloc(FormDict &globals);
+ const char *opnd_ident(int idx); // Name of operand #idx.
const char *reduce_result();
// Return the name of the operand on the right hand side of the binary match
// Return NULL if there is no right hand side
@@ -240,7 +242,7 @@
// Check if this instruction can cisc-spill to 'alternate'
bool cisc_spills_to(ArchDesc &AD, InstructForm *alternate);
InstructForm *cisc_spill_alternate() { return _cisc_spill_alternate; }
- uint cisc_spill_operand() const { return _cisc_spill_operand; }
+ int cisc_spill_operand() const { return _cisc_spill_operand; }
bool is_cisc_alternate() const { return _is_cisc_alternate; }
void set_cisc_alternate(bool val) { _is_cisc_alternate = val; }
const char *cisc_reg_mask_name() const { return _cisc_reg_mask_name; }
@@ -277,6 +279,7 @@
return idx;
}
}
+ const char *unique_opnd_ident(int idx); // Name of operand at unique idx.
// Operands which are only KILLs aren't part of the input array and
// require special handling in some cases. Their position in this
@@ -889,6 +892,7 @@
void dump(); // Debug printer
void output(FILE *fp); // Write to output files
+ const char* getUsedefName();
public:
// Implementation depends upon working bit intersection and union.
@@ -1030,6 +1034,7 @@
void matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt);
void dump();
+ void output_short(FILE *fp);
void output(FILE *fp);
};
--- a/hotspot/src/share/vm/adlc/main.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/main.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -341,14 +341,20 @@
static void usage(ArchDesc& AD)
{
printf("Architecture Description Language Compiler\n\n");
- printf("Usage: adl [-doqw] [-Dflag[=def]] [-Uflag] [-cFILENAME] [-hFILENAME] [-aDFAFILE] ADLFILE\n");
+ printf("Usage: adlc [-doqwTs] [-#]* [-D<FLAG>[=<DEF>]] [-U<FLAG>] [-c<CPP_FILE_NAME>] [-h<HPP_FILE_NAME>] [-a<DFA_FILE_NAME>] [-v<GLOBALS_FILE_NAME>] <ADL_FILE_NAME>\n");
printf(" d produce DFA debugging info\n");
printf(" o no output produced, syntax and semantic checking only\n");
printf(" q quiet mode, supresses all non-essential messages\n");
printf(" w suppress warning messages\n");
+ printf(" T make DFA as many subroutine calls\n");
+ printf(" s output which instructions are cisc-spillable\n");
+ printf(" D define preprocessor symbol\n");
+ printf(" U undefine preprocessor symbol\n");
printf(" c specify CPP file name (default: %s)\n", AD._CPP_file._name);
printf(" h specify HPP file name (default: %s)\n", AD._HPP_file._name);
printf(" a specify DFA output file name\n");
+ printf(" v specify adGlobals output file name\n");
+ printf(" # increment ADL debug level\n");
printf("\n");
}
@@ -450,22 +456,6 @@
return fname;
}
-//------------------------------strip_path_and_ext------------------------------
-static char *strip_path_and_ext(char *fname)
-{
- char *ep;
- char *sp;
-
- if (fname) {
- for (sp = fname; *sp; sp++)
- if (*sp == '/') fname = sp+1;
- ep = fname; // start at first character and look for '.'
- while (ep <= (fname + strlen(fname) - 1) && *ep != '.') ep++;
- if (*ep == '.') *ep = '\0'; // truncate string at '.'
- }
- return fname;
-}
-
//------------------------------base_plus_suffix-------------------------------
// New concatenated string
static char *base_plus_suffix(const char* base, const char *suffix)
@@ -477,18 +467,6 @@
return fname;
}
-
-//------------------------------prefix_plus_base_plus_suffix-------------------
-// New concatenated string
-static char *prefix_plus_base_plus_suffix(const char* prefix, const char* base, const char *suffix)
-{
- int len = (int)strlen(prefix) + (int)strlen(base) + (int)strlen(suffix) + 1;
-
- char* fname = new char[len];
- sprintf(fname,"%s%s%s",prefix,base,suffix);
- return fname;
-}
-
//------------------------------get_legal_text---------------------------------
// Get pointer to legal text at the beginning of AD file.
// This code assumes that a legal text starts at the beginning of .ad files,
--- a/hotspot/src/share/vm/adlc/output_c.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/output_c.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -518,6 +518,14 @@
int cycles = piperesource->_cycles;
uint stage = pipeline->_stages.index(piperesource->_stage);
+ if (NameList::Not_in_list == stage) {
+ fprintf(stderr,
+ "pipeline_res_mask_initializer: "
+ "semantic error: "
+ "pipeline stage undeclared: %s\n",
+ piperesource->_stage);
+ exit(1);
+ }
uint upper_limit = stage+cycles-1;
uint lower_limit = stage-1;
uint upper_idx = upper_limit >> 5;
@@ -1000,7 +1008,7 @@
}
fprintf(fp_cpp, "};\n\n");
fprintf(fp_cpp, "#ifndef PRODUCT\n");
- fprintf(fp_cpp, "void Bundle::dump() const {\n");
+ fprintf(fp_cpp, "void Bundle::dump(outputStream *st) const {\n");
fprintf(fp_cpp, " static const char * bundle_flags[] = {\n");
fprintf(fp_cpp, " \"\",\n");
fprintf(fp_cpp, " \"use nop delay\",\n");
@@ -1019,22 +1027,22 @@
// See if the same string is in the table
fprintf(fp_cpp, " bool needs_comma = false;\n\n");
fprintf(fp_cpp, " if (_flags) {\n");
- fprintf(fp_cpp, " tty->print(\"%%s\", bundle_flags[_flags]);\n");
+ fprintf(fp_cpp, " st->print(\"%%s\", bundle_flags[_flags]);\n");
fprintf(fp_cpp, " needs_comma = true;\n");
fprintf(fp_cpp, " };\n");
fprintf(fp_cpp, " if (instr_count()) {\n");
- fprintf(fp_cpp, " tty->print(\"%%s%%d instr%%s\", needs_comma ? \", \" : \"\", instr_count(), instr_count() != 1 ? \"s\" : \"\");\n");
+ fprintf(fp_cpp, " st->print(\"%%s%%d instr%%s\", needs_comma ? \", \" : \"\", instr_count(), instr_count() != 1 ? \"s\" : \"\");\n");
fprintf(fp_cpp, " needs_comma = true;\n");
fprintf(fp_cpp, " };\n");
fprintf(fp_cpp, " uint r = resources_used();\n");
fprintf(fp_cpp, " if (r) {\n");
- fprintf(fp_cpp, " tty->print(\"%%sresource%%s:\", needs_comma ? \", \" : \"\", (r & (r-1)) != 0 ? \"s\" : \"\");\n");
+ fprintf(fp_cpp, " st->print(\"%%sresource%%s:\", needs_comma ? \", \" : \"\", (r & (r-1)) != 0 ? \"s\" : \"\");\n");
fprintf(fp_cpp, " for (uint i = 0; i < %d; i++)\n", _pipeline->_rescount);
fprintf(fp_cpp, " if ((r & (1 << i)) != 0)\n");
- fprintf(fp_cpp, " tty->print(\" %%s\", resource_names[i]);\n");
+ fprintf(fp_cpp, " st->print(\" %%s\", resource_names[i]);\n");
fprintf(fp_cpp, " needs_comma = true;\n");
fprintf(fp_cpp, " };\n");
- fprintf(fp_cpp, " tty->print(\"\\n\");\n");
+ fprintf(fp_cpp, " st->print(\"\\n\");\n");
fprintf(fp_cpp, "}\n");
fprintf(fp_cpp, "#endif\n");
}
@@ -1048,39 +1056,6 @@
node, regMask);
}
-// Scan the peepmatch and output a test for each instruction
-static void check_peepmatch_instruction_tree(FILE *fp, PeepMatch *pmatch, PeepConstraint *pconstraint) {
- int parent = -1;
- int inst_position = 0;
- const char* inst_name = NULL;
- int input = 0;
- fprintf(fp, " // Check instruction sub-tree\n");
- pmatch->reset();
- for( pmatch->next_instruction( parent, inst_position, inst_name, input );
- inst_name != NULL;
- pmatch->next_instruction( parent, inst_position, inst_name, input ) ) {
- // If this is not a placeholder
- if( ! pmatch->is_placeholder() ) {
- // Define temporaries 'inst#', based on parent and parent's input index
- if( parent != -1 ) { // root was initialized
- fprintf(fp, " inst%d = inst%d->in(%d);\n",
- inst_position, parent, input);
- }
-
- // When not the root
- // Test we have the correct instruction by comparing the rule
- if( parent != -1 ) {
- fprintf(fp, " matches = matches && ( inst%d->rule() == %s_rule );",
- inst_position, inst_name);
- }
- } else {
- // Check that user did not try to constrain a placeholder
- assert( ! pconstraint->constrains_instruction(inst_position),
- "fatal(): Can not constrain a placeholder instruction");
- }
- }
-}
-
static void print_block_index(FILE *fp, int inst_position) {
assert( inst_position >= 0, "Instruction number less than zero");
fprintf(fp, "block_index");
@@ -1242,7 +1217,7 @@
if( left_op_index != 0 ) {
assert( (left_index <= 9999) && (left_op_index <= 9999), "exceed string size");
// Must have index into operands
- sprintf(left_reg_index,",inst%d_idx%d", left_index, left_op_index);
+ sprintf(left_reg_index,",inst%d_idx%d", (int)left_index, left_op_index);
} else {
strcpy(left_reg_index, "");
}
@@ -1255,7 +1230,7 @@
if( right_op_index != 0 ) {
assert( (right_index <= 9999) && (right_op_index <= 9999), "exceed string size");
// Must have index into operands
- sprintf(right_reg_index,",inst%d_idx%d", right_index, right_op_index);
+ sprintf(right_reg_index,",inst%d_idx%d", (int)right_index, right_op_index);
} else {
strcpy(right_reg_index, "");
}
@@ -1645,7 +1620,7 @@
new_pos = new_inst->operand_position(parameter,Component::USE);
exp_pos += node->num_opnds();
// If there is no use of the created operand, just skip it
- if (new_pos != -1) {
+ if (new_pos != NameList::Not_in_list) {
//Copy the operand from the original made above
fprintf(fp," n%d->set_opnd_array(%d, op%d->clone(C)); // %s\n",
cnt, new_pos, exp_pos-node->num_opnds(), opid);
@@ -1789,7 +1764,8 @@
// Build mapping from num_edges to local variables
fprintf(fp," unsigned num0 = 0;\n");
for( i = 1; i < cur_num_opnds; i++ ) {
- fprintf(fp," unsigned num%d = opnd_array(%d)->num_edges();\n",i,i);
+ fprintf(fp," unsigned num%d = opnd_array(%d)->num_edges();",i,i);
+ fprintf(fp, " \t// %s\n", node->opnd_ident(i));
}
// Build a mapping from operand index to input edges
fprintf(fp," unsigned idx0 = oper_input_base();\n");
@@ -1934,6 +1910,7 @@
}
// Track necessary state when identifying a replacement variable
+ // @arg rep_var: The formal parameter of the encoding.
void update_state(const char *rep_var) {
// A replacement variable or one of its subfields
// Obtain replacement variable from list
@@ -1955,7 +1932,7 @@
}
}
else {
- // Lookup its position in parameter list
+ // Lookup its position in (formal) parameter list of encoding
int param_no = _encoding.rep_var_index(rep_var);
if ( param_no == -1 ) {
_AD.syntax_err( _encoding._linenum,
@@ -1964,6 +1941,7 @@
}
// Lookup the corresponding ins_encode parameter
+ // This is the argument (actual parameter) to the encoding.
const char *inst_rep_var = _ins_encode.rep_var_name(_inst, param_no);
if (inst_rep_var == NULL) {
_AD.syntax_err( _ins_encode._linenum,
@@ -2329,6 +2307,7 @@
// Add parameter for index position, if not result operand
if( _operand_idx != 0 ) fprintf(_fp,",idx%d", _operand_idx);
fprintf(_fp,")");
+ fprintf(_fp, "/* %s */", _operand_name);
}
} else {
assert( _reg_status == LITERAL_OUTPUT, "should have output register literal in emit_rep_var");
@@ -2368,7 +2347,7 @@
}
} else {
assert( _constant_status == LITERAL_OUTPUT, "should have output constant literal in emit_rep_var");
- // Cosntant literal has already been sent to output file, nothing more needed
+ // Constant literal has already been sent to output file, nothing more needed
}
}
else if ( strcmp(rep_var,"$disp") == 0 ) {
@@ -2387,6 +2366,8 @@
}
else {
printf("emit_field: %s\n",rep_var);
+ globalAD->syntax_err(_inst._linenum, "Unknown replacement variable %s in format statement of %s.",
+ rep_var, _inst._ident);
assert( false, "UnImplemented()");
}
}
@@ -2484,14 +2465,14 @@
//(1)
// Output instruction's emit prototype
- fprintf(fp,"uint %sNode::size(PhaseRegAlloc *ra_) const {\n",
+ fprintf(fp,"uint %sNode::size(PhaseRegAlloc *ra_) const {\n",
inst._ident);
- fprintf(fp, " assert(VerifyOops || MachNode::size(ra_) <= %s, \"bad fixed size\");\n", inst._size);
+ fprintf(fp, " assert(VerifyOops || MachNode::size(ra_) <= %s, \"bad fixed size\");\n", inst._size);
//(2)
// Print the size
- fprintf(fp, " return (VerifyOops ? MachNode::size(ra_) : %s);\n", inst._size);
+ fprintf(fp, " return (VerifyOops ? MachNode::size(ra_) : %s);\n", inst._size);
// (3) and (4)
fprintf(fp,"}\n");
@@ -2579,7 +2560,7 @@
}
// (3) and (4)
- fprintf(fp, "}\n");
+ fprintf(fp, "}\n\n");
}
// defineEvalConstant ---------------------------------------------------------
@@ -2727,12 +2708,12 @@
// (2) }
//
static void defineClone(FILE *fp, FormDict &globalNames, OperandForm &oper) {
- fprintf(fp,"MachOper *%sOper::clone(Compile* C) const {\n", oper._ident);
+ fprintf(fp,"MachOper *%sOper::clone(Compile* C) const {\n", oper._ident);
// Check for constants that need to be copied over
const int num_consts = oper.num_consts(globalNames);
const bool is_ideal_bool = oper.is_ideal_bool();
if( (num_consts > 0) ) {
- fprintf(fp," return new (C) %sOper(", oper._ident);
+ fprintf(fp," return new (C) %sOper(", oper._ident);
// generate parameters for constants
int i = 0;
fprintf(fp,"_c%d", i);
@@ -2744,21 +2725,12 @@
}
else {
assert( num_consts == 0, "Currently support zero or one constant per operand clone function");
- fprintf(fp," return new (C) %sOper();\n", oper._ident);
+ fprintf(fp," return new (C) %sOper();\n", oper._ident);
}
// finish method
fprintf(fp,"}\n");
}
-static void define_hash(FILE *fp, char *operand) {
- fprintf(fp,"uint %sOper::hash() const { return 5; }\n", operand);
-}
-
-static void define_cmp(FILE *fp, char *operand) {
- fprintf(fp,"uint %sOper::cmp( const MachOper &oper ) const { return opcode() == oper.opcode(); }\n", operand);
-}
-
-
// Helper functions for bug 4796752, abstracted with minimal modification
// from define_oper_interface()
OperandForm *rep_var_to_operand(const char *encoding, OperandForm &oper, FormDict &globals) {
@@ -2852,14 +2824,14 @@
} else if ( (strcmp(name,"disp") == 0) ) {
fprintf(fp,"(PhaseRegAlloc *ra_, const Node *node, int idx) const { \n");
} else {
- fprintf(fp,"() const { ");
+ fprintf(fp,"() const { \n");
}
// Check for hexadecimal value OR replacement variable
if( *encoding == '$' ) {
// Replacement variable
const char *rep_var = encoding + 1;
- fprintf(fp,"// Replacement variable: %s\n", encoding+1);
+ fprintf(fp," // Replacement variable: %s\n", encoding+1);
// Lookup replacement variable, rep_var, in operand's component list
const Component *comp = oper._components.search(rep_var);
assert( comp != NULL, "Replacement variable not found in components");
@@ -2880,10 +2852,10 @@
} else if ( op->ideal_to_sReg_type(op->_ident) != Form::none ) {
// StackSlot for an sReg comes either from input node or from self, when idx==0
fprintf(fp," if( idx != 0 ) {\n");
- fprintf(fp," // Access register number for input operand\n");
+ fprintf(fp," // Access stack offset (register number) for input operand\n");
fprintf(fp," return ra_->reg2offset(ra_->get_reg_first(node->in(idx)));/* sReg */\n");
fprintf(fp," }\n");
- fprintf(fp," // Access register number from myself\n");
+ fprintf(fp," // Access stack offset (register number) from myself\n");
fprintf(fp," return ra_->reg2offset(ra_->get_reg_first(node));/* sReg */\n");
} else if (op->_matrule && op->_matrule->is_base_constant(globals)) {
// Constant
@@ -2900,7 +2872,7 @@
}
else if( *encoding == '0' && *(encoding+1) == 'x' ) {
// Hex value
- fprintf(fp,"return %s;", encoding);
+ fprintf(fp," return %s;\n", encoding);
} else {
assert( false, "Do not support octal or decimal encode constants");
}
@@ -3133,8 +3105,8 @@
// Output the definition for number of relocation entries
uint reloc_size = instr->reloc(_globalNames);
if ( reloc_size != 0 ) {
- fprintf(fp,"int %sNode::reloc() const {\n", instr->_ident);
- fprintf(fp, " return %d;\n", reloc_size );
+ fprintf(fp,"int %sNode::reloc() const {\n", instr->_ident);
+ fprintf(fp," return %d;\n", reloc_size);
fprintf(fp,"}\n");
fprintf(fp,"\n");
}
@@ -3241,7 +3213,7 @@
class OutputReduceOp : public OutputMap {
public:
OutputReduceOp(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "reduceOp") {};
void declaration() { fprintf(_hpp, "extern const int reduceOp[];\n"); }
void definition() { fprintf(_cpp, "const int reduceOp[] = {\n"); }
@@ -3276,7 +3248,7 @@
class OutputLeftOp : public OutputMap {
public:
OutputLeftOp(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "leftOp") {};
void declaration() { fprintf(_hpp, "extern const int leftOp[];\n"); }
void definition() { fprintf(_cpp, "const int leftOp[] = {\n"); }
@@ -3306,7 +3278,7 @@
class OutputRightOp : public OutputMap {
public:
OutputRightOp(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "rightOp") {};
void declaration() { fprintf(_hpp, "extern const int rightOp[];\n"); }
void definition() { fprintf(_cpp, "const int rightOp[] = {\n"); }
@@ -3336,11 +3308,11 @@
class OutputRuleName : public OutputMap {
public:
OutputRuleName(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "ruleName") {};
void declaration() { fprintf(_hpp, "extern const char *ruleName[];\n"); }
void definition() { fprintf(_cpp, "const char *ruleName[] = {\n"); }
- void closing() { fprintf(_cpp, " \"no trailing comma\"\n");
+ void closing() { fprintf(_cpp, " \"invalid rule name\" // no trailing comma\n");
OutputMap::closing();
}
void map(OpClassForm &opc) { fprintf(_cpp, " \"%s\"", _AD.machOperEnum(opc._ident) ); }
@@ -3354,7 +3326,7 @@
class OutputSwallowed : public OutputMap {
public:
OutputSwallowed(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "swallowed") {};
void declaration() { fprintf(_hpp, "extern const bool swallowed[];\n"); }
void definition() { fprintf(_cpp, "const bool swallowed[] = {\n"); }
@@ -3375,7 +3347,7 @@
class OutputInstChainRule : public OutputMap {
public:
OutputInstChainRule(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "instruction_chain_rule") {};
void declaration() { fprintf(_hpp, "extern const bool instruction_chain_rule[];\n"); }
void definition() { fprintf(_cpp, "const bool instruction_chain_rule[] = {\n"); }
@@ -3416,7 +3388,7 @@
if ( op->ideal_only() ) continue;
// Generate the entry for this opcode
- map.map(*op); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*op); fprintf(fp_cpp, ",\n");
++idx;
};
fprintf(fp_cpp, " // last operand\n");
@@ -3425,7 +3397,7 @@
map.record_position(OutputMap::BEGIN_OPCLASSES, idx );
_opclass.reset();
for(; (opc = (OpClassForm*)_opclass.iter()) != NULL; ) {
- map.map(*opc); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*opc); fprintf(fp_cpp, ",\n");
++idx;
};
fprintf(fp_cpp, " // last operand class\n");
@@ -3435,7 +3407,7 @@
_internalOpNames.reset();
char *name = NULL;
for(; (name = (char *)_internalOpNames.iter()) != NULL; ) {
- map.map(name); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(name); fprintf(fp_cpp, ",\n");
++idx;
};
fprintf(fp_cpp, " // last internally defined operand\n");
@@ -3453,7 +3425,7 @@
if ( ! inst->is_simple_chain_rule(_globalNames) ) continue;
if ( inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
map.record_position(OutputMap::BEGIN_REMATERIALIZE, idx );
@@ -3464,7 +3436,7 @@
if ( ! inst->is_simple_chain_rule(_globalNames) ) continue;
if ( ! inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
map.record_position(OutputMap::END_INST_CHAIN_RULES, idx );
@@ -3478,7 +3450,7 @@
if ( inst->is_simple_chain_rule(_globalNames) ) continue;
if ( ! inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
map.record_position(OutputMap::END_REMATERIALIZE, idx );
@@ -3489,7 +3461,7 @@
if ( inst->is_simple_chain_rule(_globalNames) ) continue;
if ( inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
}
@@ -3571,7 +3543,7 @@
next = _register->iter_RegDefs();
char policy = reg_save_policy(rdef->_callconv);
const char *comma = (next != NULL) ? "," : " // no trailing comma";
- fprintf(fp_cpp, " '%c'%s\n", policy, comma);
+ fprintf(fp_cpp, " '%c'%s // %s\n", policy, comma, rdef->_regname);
}
fprintf(fp_cpp, "};\n\n");
@@ -3583,7 +3555,7 @@
next = _register->iter_RegDefs();
char policy = reg_save_policy(rdef->_c_conv);
const char *comma = (next != NULL) ? "," : " // no trailing comma";
- fprintf(fp_cpp, " '%c'%s\n", policy, comma);
+ fprintf(fp_cpp, " '%c'%s // %s\n", policy, comma, rdef->_regname);
}
fprintf(fp_cpp, "};\n\n");
@@ -3644,6 +3616,8 @@
fprintf(fp, "_leaf->bottom_type()->is_ptr()");
} else if ( (strcmp(optype,"ConN") == 0) ) {
fprintf(fp, "_leaf->bottom_type()->is_narrowoop()");
+ } else if ( (strcmp(optype,"ConNKlass") == 0) ) {
+ fprintf(fp, "_leaf->bottom_type()->is_narrowklass()");
} else if ( (strcmp(optype,"ConF") == 0) ) {
fprintf(fp, "_leaf->getf()");
} else if ( (strcmp(optype,"ConD") == 0) ) {
@@ -3792,7 +3766,7 @@
// For each operand not in the match rule, call MachOperGenerator
// with the enum for the opcode that needs to be built.
ComponentList clist = inst->_components;
- int index = clist.operand_position(comp->_name, comp->_usedef);
+ int index = clist.operand_position(comp->_name, comp->_usedef, inst);
const char *opcode = machOperEnum(comp->_type);
fprintf(fp_cpp, "%s node->set_opnd_array(%d, ", indent, index);
fprintf(fp_cpp, "MachOperGenerator(%s, C));\n", opcode);
@@ -3987,7 +3961,7 @@
fprintf(fp_cpp, " case %s_rule:", opClass);
// Start local scope
- fprintf(fp_cpp, " {\n");
+ fprintf(fp_cpp, " {\n");
// Generate code to construct the new MachNode
buildMachNode(fp_cpp, inst, " ");
// Return result and exit scope
@@ -4137,6 +4111,9 @@
// Get info for the CISC_oracle and MachNode::cisc_version()
void ArchDesc::identify_cisc_spill_instructions() {
+ if (_frame == NULL)
+ return;
+
// Find the user-defined operand for cisc-spilling
if( _frame->_cisc_spilling_operand_name != NULL ) {
const Form *form = _globalNames[_frame->_cisc_spilling_operand_name];
--- a/hotspot/src/share/vm/adlc/output_h.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/adlc/output_h.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -25,6 +25,8 @@
// output_h.cpp - Class HPP file output routines for architecture definition
#include "adlc.hpp"
+// The comment delimiter used in format statements after assembler instructions.
+#define commentSeperator "!"
// Generate the #define that describes the number of registers.
static void defineRegCount(FILE *fp, RegisterForm *registers) {
@@ -79,10 +81,15 @@
_register->reset_RegDefs();
int i = 0;
while( (reg_def = _register->iter_RegDefs()) != NULL ) {
- fprintf(fp_hpp," %s_num,\t\t// %d\n", reg_def->_regname, i++);
+ fprintf(fp_hpp," %s_num,", reg_def->_regname);
+ for (int j = 0; j < 20-(int)strlen(reg_def->_regname); j++) fprintf(fp_hpp, " ");
+ fprintf(fp_hpp," // enum %3d, regnum %3d, reg encode %3s\n",
+ i++,
+ reg_def->register_num(),
+ reg_def->register_encode());
}
// Finish defining enumeration
- fprintf(fp_hpp, " _last_Mach_Reg\t// %d\n", i);
+ fprintf(fp_hpp, " _last_Mach_Reg // %d\n", i);
fprintf(fp_hpp, "};\n");
}
@@ -121,13 +128,24 @@
fprintf(fp_hpp, "// in the order of occurrence in the alloc_class(es).\n");
fprintf(fp_hpp, "enum MachRegisterEncodes {\n");
+ // Find max enum string length.
+ size_t maxlen = 0;
+ _register->reset_RegDefs();
+ reg_def = _register->iter_RegDefs();
+ while (reg_def != NULL) {
+ size_t len = strlen(reg_def->_regname);
+ if (len > maxlen) maxlen = len;
+ reg_def = _register->iter_RegDefs();
+ }
+
// Output the register encoding for each register in the allocation classes
_register->reset_RegDefs();
reg_def_next = _register->iter_RegDefs();
while( (reg_def = reg_def_next) != NULL ) {
reg_def_next = _register->iter_RegDefs();
- fprintf(fp_hpp," %s_enc = %s%s\n",
- reg_def->_regname, reg_def->register_encode(), reg_def_next == NULL? "" : "," );
+ fprintf(fp_hpp," %s_enc", reg_def->_regname);
+ for (size_t i = strlen(reg_def->_regname); i < maxlen; i++) fprintf(fp_hpp, " ");
+ fprintf(fp_hpp," = %3s%s\n", reg_def->register_encode(), reg_def_next == NULL? "" : "," );
}
// Finish defining enumeration
fprintf(fp_hpp, "};\n");
@@ -177,14 +195,6 @@
fprintf(fp," virtual const RegMask *in_RegMask(int index) const;\n");
}
-static void declare_hash(FILE *fp) {
- fprintf(fp," virtual uint hash() const;\n");
-}
-
-static void declare_cmp(FILE *fp) {
- fprintf(fp," virtual uint cmp( const MachOper &oper ) const;\n");
-}
-
static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper) {
int i = 0;
Component *comp;
@@ -207,6 +217,10 @@
if (i > 0) fprintf(fp,", ");
fprintf(fp," const TypeNarrowOop *_c%d;\n", i);
}
+ else if (!strcmp(type, "ConNKlass")) {
+ if (i > 0) fprintf(fp,", ");
+ fprintf(fp," const TypeNarrowKlass *_c%d;\n", i);
+ }
else if (!strcmp(type, "ConL")) {
if (i > 0) fprintf(fp,", ");
fprintf(fp," jlong _c%d;\n", i);
@@ -243,6 +257,10 @@
fprintf(fp," const TypePtr *_c%d;\n", i);
i++;
}
+ else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
+ fprintf(fp," const TypePtr *_c%d;\n", i);
+ i++;
+ }
else if (!strcmp(comp->base_type(globals), "ConL")) {
fprintf(fp," jlong _c%d;\n", i);
i++;
@@ -288,11 +306,12 @@
fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
break;
}
- case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
- case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; }
- case Form::idealL : { fprintf(fp,"jlong c%d", i); break; }
- case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; }
- case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; }
+ case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
+ case Form::idealNKlass : { fprintf(fp,"const TypeNarrowKlass *c%d", i); break; }
+ case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; }
+ case Form::idealL : { fprintf(fp,"jlong c%d", i); break; }
+ case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; }
+ case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; }
default:
assert(!is_ideal_bool, "Non-constant operand lacks component list.");
break;
@@ -316,6 +335,11 @@
fprintf(fp,"const TypePtr *c%d", i);
i++;
}
+ else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
+ if (i > 0) fprintf(fp,", ");
+ fprintf(fp,"const TypePtr *c%d", i);
+ i++;
+ }
else if (!strcmp(comp->base_type(globals), "ConL")) {
if (i > 0) fprintf(fp,", ");
fprintf(fp,"jlong c%d", i);
@@ -358,18 +382,19 @@
static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
assert(oper != NULL, "what");
CondInterface* cond = oper->_interface->is_CondInterface();
- fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
- fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
+ fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
+ fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
}
// Output code that dumps constant values, increment "i" if type is constant
static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, OperandForm* oper) {
if (!strcmp(ideal_type, "ConI")) {
fprintf(fp," st->print(\"#%%d\", _c%d);\n", i);
+ fprintf(fp," st->print(\"/0x%%08x\", _c%d);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConP")) {
@@ -380,16 +405,25 @@
fprintf(fp," _c%d->dump_on(st);\n", i);
++i;
}
+ else if (!strcmp(ideal_type, "ConNKlass")) {
+ fprintf(fp," _c%d->dump_on(st);\n", i);
+ ++i;
+ }
else if (!strcmp(ideal_type, "ConL")) {
fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
+ fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConF")) {
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
+ fprintf(fp," jint _c%di = JavaValue(_c%d).get_jint();\n", i, i);
+ fprintf(fp," st->print(\"/0x%%x/\", _c%di);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConD")) {
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
+ fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
+ fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
++i;
}
else if (!strcmp(ideal_type, "Bool")) {
@@ -411,7 +445,7 @@
}
// Local pointer indicates remaining part of format rule
- uint idx = 0; // position of operand in match rule
+ int idx = 0; // position of operand in match rule
// Generate internal format function, used when stored locally
fprintf(fp, "\n#ifndef PRODUCT\n");
@@ -426,13 +460,12 @@
oper._format->_rep_vars.reset();
oper._format->_strings.reset();
while ( (string = oper._format->_strings.iter()) != NULL ) {
- fprintf(fp," ");
// Check if this is a standard string or a replacement variable
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
- fprintf(fp,"st->print(\"%s\");\n", string);
+ fprintf(fp," st->print(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@@ -455,7 +488,7 @@
}
// output invocation of "$..."s format function
- if ( op != NULL ) op->int_format(fp, globals, idx);
+ if ( op != NULL ) op->int_format(fp, globals, idx);
if ( idx == -1 ) {
fprintf(stderr,
@@ -498,13 +531,12 @@
oper._format->_rep_vars.reset();
oper._format->_strings.reset();
while ( (string = oper._format->_strings.iter()) != NULL ) {
- fprintf(fp," ");
// Check if this is a standard string or a replacement variable
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
- fprintf(fp,"st->print(\"%s\");\n", string);
+ fprintf(fp," st->print(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@@ -529,7 +561,7 @@
if ( op != NULL ) op->ext_format(fp, globals, idx);
// Lookup the index position of the replacement variable
- idx = oper._components.operand_position_format(rep_var);
+ idx = oper._components.operand_position_format(rep_var, &oper);
if ( idx == -1 ) {
fprintf(stderr,
"Using a name, %s, that isn't in match rule\n", rep_var);
@@ -583,7 +615,7 @@
inst._format->_rep_vars.reset();
inst._format->_strings.reset();
while( (string = inst._format->_strings.iter()) != NULL ) {
- fprintf(fp," ");
+ fprintf(fp," ");
// Check if this is a standard string or a replacement variable
if( string == NameList::_signal ) { // Replacement variable
const char* rep_var = inst._format->_rep_vars.iter();
@@ -640,11 +672,12 @@
if( call_type != Form::invalid_type ) {
switch( call_type ) {
case Form::JAVA_DYNAMIC:
- fprintf(fp," _method->print_short_name();\n");
+ fprintf(fp," _method->print_short_name(st);\n");
break;
case Form::JAVA_STATIC:
- fprintf(fp," if( _method ) _method->print_short_name(st); else st->print(\" wrapper for: %%s\", _name);\n");
- fprintf(fp," if( !_method ) dump_trap_args(st);\n");
+ fprintf(fp," if( _method ) _method->print_short_name(st);\n");
+ fprintf(fp," else st->print(\" wrapper for: %%s\", _name);\n");
+ fprintf(fp," if( !_method ) dump_trap_args(st);\n");
break;
case Form::JAVA_COMPILED:
case Form::JAVA_INTERP:
@@ -652,52 +685,46 @@
case Form::JAVA_RUNTIME:
case Form::JAVA_LEAF:
case Form::JAVA_NATIVE:
- fprintf(fp," st->print(\" %%s\", _name);");
+ fprintf(fp," st->print(\" %%s\", _name);");
break;
default:
- assert(0,"ShouldNotReacHere");
+ assert(0,"ShouldNotReachHere");
}
- fprintf(fp, " st->print_cr(\"\");\n" );
- fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
- fprintf(fp, " st->print(\" # \");\n" );
- fprintf(fp, " if( _jvms ) _oop_map->print_on(st);\n");
+ fprintf(fp, " st->print_cr(\"\");\n" );
+ fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
+ fprintf(fp, " st->print(\" # \");\n" );
+ fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
}
else if(inst.is_ideal_safepoint()) {
- fprintf(fp, " st->print(\"\");\n" );
- fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
- fprintf(fp, " st->print(\" # \");\n" );
- fprintf(fp, " if( _jvms ) _oop_map->print_on(st);\n");
+ fprintf(fp, " st->print(\"\");\n" );
+ fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
+ fprintf(fp, " st->print(\" # \");\n" );
+ fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
}
else if( inst.is_ideal_if() ) {
- fprintf(fp, " st->print(\" P=%%f C=%%f\",_prob,_fcnt);\n" );
+ fprintf(fp, " st->print(\" P=%%f C=%%f\",_prob,_fcnt);\n" );
}
else if( inst.is_ideal_mem() ) {
// Print out the field name if available to improve readability
- fprintf(fp, " if (ra->C->alias_type(adr_type())->field() != NULL) {\n");
- fprintf(fp, " ciField* f = ra->C->alias_type(adr_type())->field();\n");
- fprintf(fp, " st->print(\" ! Field: \");\n");
- fprintf(fp, " if (f->is_volatile())\n");
- fprintf(fp, " st->print(\"volatile \");\n");
- fprintf(fp, " f->holder()->name()->print_symbol_on(st);\n");
- fprintf(fp, " st->print(\".\");\n");
- fprintf(fp, " f->name()->print_symbol_on(st);\n");
- fprintf(fp, " if (f->is_constant())\n");
- fprintf(fp, " st->print(\" (constant)\");\n");
- fprintf(fp, " } else\n");
+ fprintf(fp, " if (ra->C->alias_type(adr_type())->field() != NULL) {\n");
+ fprintf(fp, " ciField* f = ra->C->alias_type(adr_type())->field();\n");
+ fprintf(fp, " st->print(\" %s Field: \");\n", commentSeperator);
+ fprintf(fp, " if (f->is_volatile())\n");
+ fprintf(fp, " st->print(\"volatile \");\n");
+ fprintf(fp, " f->holder()->name()->print_symbol_on(st);\n");
+ fprintf(fp, " st->print(\".\");\n");
+ fprintf(fp, " f->name()->print_symbol_on(st);\n");
+ fprintf(fp, " if (f->is_constant())\n");
+ fprintf(fp, " st->print(\" (constant)\");\n");
+ fprintf(fp, " } else {\n");
// Make sure 'Volatile' gets printed out
fprintf(fp, " if (ra->C->alias_type(adr_type())->is_volatile())\n");
fprintf(fp, " st->print(\" volatile!\");\n");
+ fprintf(fp, " }\n");
}
// Complete the definition of the format function
- fprintf(fp, " }\n#endif\n");
-}
-
-static bool is_non_constant(char* x) {
- // Tells whether the string (part of an operator interface) is non-constant.
- // Simply detect whether there is an occurrence of a formal parameter,
- // which will always begin with '$'.
- return strchr(x, '$') == 0;
+ fprintf(fp, "}\n#endif\n");
}
void ArchDesc::declare_pipe_classes(FILE *fp_hpp) {
@@ -1089,7 +1116,7 @@
fprintf(fp_hpp, " static void initialize_nops(MachNode *nop_list[%d], Compile* C);\n\n",
_pipeline->_nopcnt);
fprintf(fp_hpp, "#ifndef PRODUCT\n");
- fprintf(fp_hpp, " void dump() const;\n");
+ fprintf(fp_hpp, " void dump(outputStream *st = tty) const;\n");
fprintf(fp_hpp, "#endif\n");
fprintf(fp_hpp, "};\n\n");
@@ -1234,12 +1261,12 @@
unsigned int position = 0;
const char *opret, *opname, *optype;
oper->_matrule->base_operand(position,_globalNames,opret,opname,optype);
- fprintf(fp," virtual const Type *type() const {");
+ fprintf(fp," virtual const Type *type() const {");
const char *type = getIdealType(optype);
if( type != NULL ) {
Form::DataType data_type = oper->is_base_constant(_globalNames);
// Check if we are an ideal pointer type
- if( data_type == Form::idealP || data_type == Form::idealN ) {
+ if( data_type == Form::idealP || data_type == Form::idealN || data_type == Form::idealNKlass ) {
// Return the ideal type we already have: <TypePtr *>
fprintf(fp," return _c0;");
} else {
@@ -1377,6 +1404,16 @@
fprintf(fp, " return _c0->get_ptrtype()->reloc();");
fprintf(fp, " }\n");
}
+ else if (!strcmp(oper->ideal_type(_globalNames), "ConNKlass")) {
+ // Access the locally stored constant
+ fprintf(fp," virtual intptr_t constant() const {");
+ fprintf(fp, " return _c0->get_ptrtype()->get_con();");
+ fprintf(fp, " }\n");
+ // Generate query to determine if this pointer is an oop
+ fprintf(fp," virtual relocInfo::relocType constant_reloc() const {");
+ fprintf(fp, " return _c0->get_ptrtype()->reloc();");
+ fprintf(fp, " }\n");
+ }
else if (!strcmp(oper->ideal_type(_globalNames), "ConL")) {
fprintf(fp," virtual intptr_t constant() const {");
// We don't support addressing modes with > 4Gig offsets.
@@ -1503,12 +1540,19 @@
fprintf(fp, " GrowableArray<Label*> _index2label;\n");
}
fprintf(fp,"public:\n");
- fprintf(fp," MachOper *opnd_array(uint operand_index) const { assert(operand_index < _num_opnds, \"invalid _opnd_array index\"); return _opnd_array[operand_index]; }\n");
- fprintf(fp," void set_opnd_array(uint operand_index, MachOper *operand) { assert(operand_index < _num_opnds, \"invalid _opnd_array index\"); _opnd_array[operand_index] = operand; }\n");
+ fprintf(fp," MachOper *opnd_array(uint operand_index) const {\n");
+ fprintf(fp," assert(operand_index < _num_opnds, \"invalid _opnd_array index\");\n");
+ fprintf(fp," return _opnd_array[operand_index];\n");
+ fprintf(fp," }\n");
+ fprintf(fp," void set_opnd_array(uint operand_index, MachOper *operand) {\n");
+ fprintf(fp," assert(operand_index < _num_opnds, \"invalid _opnd_array index\");\n");
+ fprintf(fp," _opnd_array[operand_index] = operand;\n");
+ fprintf(fp," }\n");
fprintf(fp,"private:\n");
if ( instr->is_ideal_jump() ) {
fprintf(fp," virtual void add_case_label(int index_num, Label* blockLabel) {\n");
- fprintf(fp," _index2label.at_put_grow(index_num, blockLabel);}\n");
+ fprintf(fp," _index2label.at_put_grow(index_num, blockLabel);\n");
+ fprintf(fp," }\n");
}
if( can_cisc_spill() && (instr->cisc_spill_alternate() != NULL) ) {
fprintf(fp," const RegMask *_cisc_RegMask;\n");
@@ -1544,7 +1588,7 @@
while (attr != NULL) {
if (strcmp(attr->_ident,"ins_cost") &&
strcmp(attr->_ident,"ins_short_branch")) {
- fprintf(fp," int %s() const { return %s; }\n",
+ fprintf(fp," int %s() const { return %s; }\n",
attr->_ident, attr->_val);
}
// Check value for ins_avoid_back_to_back, and if it is true (1), set the flag
@@ -1628,12 +1672,12 @@
// Output the declaration for number of relocation entries
if ( instr->reloc(_globalNames) != 0 ) {
- fprintf(fp," virtual int reloc() const;\n");
+ fprintf(fp," virtual int reloc() const;\n");
}
if (instr->alignment() != 1) {
- fprintf(fp," virtual int alignment_required() const { return %d; }\n", instr->alignment());
- fprintf(fp," virtual int compute_padding(int current_offset) const;\n");
+ fprintf(fp," virtual int alignment_required() const { return %d; }\n", instr->alignment());
+ fprintf(fp," virtual int compute_padding(int current_offset) const;\n");
}
// Starting point for inputs matcher wants.
@@ -1803,13 +1847,14 @@
// as is done for pointers
//
// Construct appropriate constant type containing the constant value.
- fprintf(fp," virtual const class Type *bottom_type() const{\n");
+ fprintf(fp," virtual const class Type *bottom_type() const {\n");
switch( data_type ) {
case Form::idealI:
fprintf(fp," return TypeInt::make(opnd_array(1)->constant());\n");
break;
case Form::idealP:
case Form::idealN:
+ case Form::idealNKlass:
fprintf(fp," return opnd_array(1)->type();\n");
break;
case Form::idealD:
@@ -1833,7 +1878,7 @@
// !!!!! !!!!!
// Provide explicit bottom type for conversions to int
// On Intel the result operand is a stackSlot, untyped.
- fprintf(fp," virtual const class Type *bottom_type() const{");
+ fprintf(fp," virtual const class Type *bottom_type() const {");
fprintf(fp, " return TypeInt::INT;");
fprintf(fp, " };\n");
}*/
@@ -1854,7 +1899,7 @@
// BoxNode provides the address of a stack slot.
// Define its bottom type to be TypeRawPtr::BOTTOM instead of TypePtr::BOTTOM
// This prevent s insert_anti_dependencies from complaining. It will
- // complain if it see that the pointer base is TypePtr::BOTTOM since
+ // complain if it sees that the pointer base is TypePtr::BOTTOM since
// it doesn't understand what that might alias.
fprintf(fp," const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } // Box?\n");
}
@@ -2017,7 +2062,7 @@
class OutputMachOperands : public OutputMap {
public:
OutputMachOperands(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "MachOperands") {};
void declaration() { }
void definition() { fprintf(_cpp, "enum MachOperands {\n"); }
@@ -2052,7 +2097,7 @@
int end_instructions;
public:
OutputMachOpcodes(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD),
+ : OutputMap(hpp, cpp, globals, AD, "MachOpcodes"),
begin_inst_chain_rule(-1), end_inst_chain_rule(-1), end_instructions(-1)
{};
--- a/hotspot/src/share/vm/asm/assembler.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/asm/assembler.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/asm/assembler.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/asm/assembler.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/asm/register.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/asm/register.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_CFGPrinter.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_Compilation.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -32,6 +32,7 @@
#include "c1/c1_ValueMap.hpp"
#include "c1/c1_ValueStack.hpp"
#include "code/debugInfoRec.hpp"
+#include "compiler/compileLog.hpp"
typedef enum {
@@ -67,10 +68,25 @@
class PhaseTraceTime: public TraceTime {
private:
JavaThread* _thread;
+ CompileLog* _log;
public:
- PhaseTraceTime(TimerName timer):
- TraceTime("", &timers[timer], CITime || CITimeEach, Verbose) {
+ PhaseTraceTime(TimerName timer)
+ : TraceTime("", &timers[timer], CITime || CITimeEach, Verbose), _log(NULL) {
+ if (Compilation::current() != NULL) {
+ _log = Compilation::current()->log();
+ }
+
+ if (_log != NULL) {
+ _log->begin_head("phase name='%s'", timer_name[timer]);
+ _log->stamp();
+ _log->end_head();
+ }
+ }
+
+ ~PhaseTraceTime() {
+ if (_log != NULL)
+ _log->done("phase");
}
};
@@ -390,6 +406,10 @@
PhaseTraceTime timeit(_t_codeinstall);
install_code(frame_size);
}
+
+ if (log() != NULL) // Print code cache state into compiler log
+ log()->code_cache_state();
+
totalInstructionNodes += Instruction::number_of_instructions();
}
@@ -456,6 +476,7 @@
int osr_bci, BufferBlob* buffer_blob)
: _compiler(compiler)
, _env(env)
+, _log(env->log())
, _method(method)
, _osr_bci(osr_bci)
, _hir(NULL)
--- a/hotspot/src/share/vm/c1/c1_Compilation.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -66,6 +66,7 @@
int _next_block_id;
AbstractCompiler* _compiler;
ciEnv* _env;
+ CompileLog* _log;
ciMethod* _method;
int _osr_bci;
IR* _hir;
@@ -123,6 +124,7 @@
// accessors
ciEnv* env() const { return _env; }
+ CompileLog* log() const { return _log; }
AbstractCompiler* compiler() const { return _compiler; }
bool has_exception_handlers() const { return _has_exception_handlers; }
bool has_fpu_code() const { return _has_fpu_code; }
--- a/hotspot/src/share/vm/c1/c1_Compiler.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Compiler.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1682,6 +1682,12 @@
ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder);
ciInstanceKlass* actual_recv = callee_holder;
+ CompileLog* log = compilation()->log();
+ if (log != NULL)
+ log->elem("call method='%d' instr='%s'",
+ log->identify(target),
+ Bytecodes::name(code));
+
// Some methods are obviously bindable without any type checks so
// convert them directly to an invokespecial or invokestatic.
if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) {
@@ -1826,6 +1832,7 @@
}
code = Bytecodes::_invokespecial;
}
+
// check if we could do inlining
if (!PatchALot && Inline && klass->is_loaded() &&
(klass->is_initialized() || klass->is_interface() && target->holder()->is_initialized())
@@ -2448,6 +2455,7 @@
#endif
_skip_block = false;
assert(state() != NULL, "ValueStack missing!");
+ CompileLog* log = compilation()->log();
ciBytecodeStream s(method());
s.reset_to_bci(bci);
int prev_bci = bci;
@@ -2466,6 +2474,9 @@
(block_at(s.cur_bci()) == NULL || block_at(s.cur_bci()) == block())) {
assert(state()->kind() == ValueStack::Parsing, "invalid state kind");
+ if (log != NULL)
+ log->set_context("bc code='%d' bci='%d'", (int)code, s.cur_bci());
+
// Check for active jsr during OSR compilation
if (compilation()->is_osr_compile()
&& scope()->is_top_scope()
@@ -2686,8 +2697,13 @@
case Bytecodes::_breakpoint : BAILOUT_("concurrent setting of breakpoint", NULL);
default : ShouldNotReachHere(); break;
}
+
+ if (log != NULL)
+ log->clear_context(); // skip marker if nothing was printed
+
// save current bci to setup Goto at the end
prev_bci = s.cur_bci();
+
}
CHECK_BAILOUT_(NULL);
// stop processing of this block (see try_inline_full)
@@ -3667,7 +3683,7 @@
INLINE_BAILOUT("total inlining greater than DesiredMethodLimit");
}
// printing
- print_inlining(callee, "");
+ print_inlining(callee);
}
// NOTE: Bailouts from this point on, which occur at the
@@ -4133,8 +4149,19 @@
void GraphBuilder::print_inlining(ciMethod* callee, const char* msg, bool success) {
+ CompileLog* log = compilation()->log();
+ if (log != NULL) {
+ if (success) {
+ if (msg != NULL)
+ log->inline_success(msg);
+ else
+ log->inline_success("receiver is statically known");
+ } else {
+ log->inline_fail(msg);
+ }
+ }
+
if (!PrintInlining) return;
- assert(msg != NULL, "must be");
CompileTask::print_inlining(callee, scope()->level(), bci(), msg);
if (success && CIPrintMethodCodes) {
callee->print_codes();
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -31,6 +31,7 @@
#include "c1/c1_ValueStack.hpp"
#include "ci/ciMethodData.hpp"
#include "ci/ciStreams.hpp"
+#include "compiler/compileLog.hpp"
class MemoryBuffer;
@@ -369,7 +370,7 @@
void append_unsafe_CAS(ciMethod* callee);
bool append_unsafe_get_and_set_obj(ciMethod* callee, bool is_add);
- void print_inlining(ciMethod* callee, const char* msg, bool success = true);
+ void print_inlining(ciMethod* callee, const char* msg = NULL, bool success = true);
void profile_call(ciMethod* callee, Value recv, ciKlass* predicted_holder);
void profile_invocation(ciMethod* inlinee, ValueStack* state);
--- a/hotspot/src/share/vm/c1/c1_IR.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_IR.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_IR.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_IR.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_InstructionPrinter.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1286,7 +1286,7 @@
if (x->needs_null_check()) {
info = state_for(x);
}
- __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), UseCompressedKlassPointers ? T_OBJECT : T_ADDRESS), result, info);
+ __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), result, info);
__ move_wide(new LIR_Address(result, in_bytes(Klass::java_mirror_offset()), T_OBJECT), result);
}
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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 "c1/c1_ValueSet.hpp"
#include "c1/c1_ValueStack.hpp"
#include "utilities/bitMap.inline.hpp"
+#include "compiler/compileLog.hpp"
define_array(ValueSetArray, ValueSet*);
define_stack(ValueSetList, ValueSetArray);
@@ -54,7 +55,18 @@
// substituted some ifops/phis, so resolve the substitution
SubstitutionResolver sr(_hir);
}
+
+ CompileLog* log = _hir->compilation()->log();
+ if (log != NULL)
+ log->set_context("optimize name='cee'");
}
+
+ ~CE_Eliminator() {
+ CompileLog* log = _hir->compilation()->log();
+ if (log != NULL)
+ log->clear_context(); // skip marker if nothing was printed
+ }
+
int cee_count() const { return _cee_count; }
int ifop_count() const { return _ifop_count; }
@@ -306,6 +318,15 @@
, _merge_count(0)
{
_hir->iterate_preorder(this);
+ CompileLog* log = _hir->compilation()->log();
+ if (log != NULL)
+ log->set_context("optimize name='eliminate_blocks'");
+ }
+
+ ~BlockMerger() {
+ CompileLog* log = _hir->compilation()->log();
+ if (log != NULL)
+ log->clear_context(); // skip marker if nothing was printed
}
bool try_merge(BlockBegin* block) {
@@ -574,6 +595,15 @@
, _work_list(new BlockList()) {
_visitable_instructions = new ValueSet();
_visitor.set_eliminator(this);
+ CompileLog* log = _opt->ir()->compilation()->log();
+ if (log != NULL)
+ log->set_context("optimize name='null_check_elimination'");
+ }
+
+ ~NullCheckEliminator() {
+ CompileLog* log = _opt->ir()->compilation()->log();
+ if (log != NULL)
+ log->clear_context(); // skip marker if nothing was printed
}
Optimizer* opt() { return _opt; }
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -327,7 +327,7 @@
// anymore after new_typeArray() and no GC can happen before.
// (This may have to change if this code changes!)
assert(klass->is_klass(), "not a class");
- BasicType elt_type = typeArrayKlass::cast(klass)->element_type();
+ BasicType elt_type = TypeArrayKlass::cast(klass)->element_type();
oop obj = oopFactory::new_typeArray(elt_type, length, CHECK);
thread->set_vm_result(obj);
// This is pretty rare but this runtime patch is stressful to deoptimization
@@ -346,7 +346,7 @@
// anymore after new_objArray() and no GC can happen before.
// (This may have to change if this code changes!)
assert(array_klass->is_klass(), "not a class");
- Klass* elem_klass = objArrayKlass::cast(array_klass)->element_klass();
+ Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass();
objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK);
thread->set_vm_result(obj);
// This is pretty rare but this runtime patch is stressful to deoptimization
@@ -362,7 +362,7 @@
assert(klass->is_klass(), "not a class");
assert(rank >= 1, "rank must be nonzero");
- oop obj = arrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK);
+ oop obj = ArrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK);
thread->set_vm_result(obj);
JRT_END
@@ -1234,8 +1234,8 @@
bs->write_ref_array((HeapWord*)dst_addr, length);
return ac_ok;
} else {
- Klass* bound = objArrayKlass::cast(dst->klass())->element_klass();
- Klass* stype = objArrayKlass::cast(src->klass())->element_klass();
+ Klass* bound = ObjArrayKlass::cast(dst->klass())->element_klass();
+ Klass* stype = ObjArrayKlass::cast(src->klass())->element_klass();
if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) {
// Elements are guaranteed to be subtypes, so no check necessary
bs->write_ref_array_pre(dst_addr, length);
@@ -1263,7 +1263,7 @@
if (src->is_typeArray()) {
Klass* const klass_oop = src->klass();
if (klass_oop != dst->klass()) return ac_failed;
- typeArrayKlass* klass = typeArrayKlass::cast(klass_oop);
+ TypeArrayKlass* klass = TypeArrayKlass::cast(klass_oop);
const int l2es = klass->log2_element_size();
const int ihs = klass->array_header_in_bytes() / wordSize;
char* src_addr = (char*) ((oopDesc**)src + ihs) + (src_pos << l2es);
--- a/hotspot/src/share/vm/c1/c1_ValueMap.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueMap.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_ValueStack.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueStack.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/c1/c1_ValueStack.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/c1/c1_ValueStack.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/ci/ciArrayKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciArrayKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -31,7 +31,7 @@
// ciArrayKlass
//
// This class represents a Klass* in the HotSpot virtual machine
-// whose Klass part in an arrayKlass.
+// whose Klass part in an ArrayKlass.
// ------------------------------------------------------------------
// ciArrayKlass::ciArrayKlass
@@ -39,7 +39,7 @@
// Loaded array klass.
ciArrayKlass::ciArrayKlass(KlassHandle h_k) : ciKlass(h_k) {
assert(get_Klass()->oop_is_array(), "wrong type");
- _dimension = get_arrayKlass()->dimension();
+ _dimension = get_ArrayKlass()->dimension();
}
// ------------------------------------------------------------------
--- a/hotspot/src/share/vm/ci/ciArrayKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciArrayKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -30,7 +30,7 @@
// ciArrayKlass
//
// This class, and its subclasses represent Klass*s in the
-// HotSpot virtual machine whose Klass part is an arrayKlass.
+// HotSpot virtual machine whose Klass part is an ArrayKlass.
class ciArrayKlass : public ciKlass {
CI_PACKAGE_ACCESS
private:
@@ -40,8 +40,8 @@
ciArrayKlass(KlassHandle h_k);
ciArrayKlass(ciSymbol* name, int dimension, BasicType bt);
- arrayKlass* get_arrayKlass() {
- return (arrayKlass*)get_Klass();
+ ArrayKlass* get_ArrayKlass() {
+ return (ArrayKlass*)get_Klass();
}
const char* type_string() { return "ciArrayKlass"; }
@@ -53,7 +53,7 @@
bool is_leaf_type(); // No subtypes of this array type.
ciInstance* component_mirror() {
- // This is a real field in arrayKlass, but we derive it from element_type.
+ // This is a real field in ArrayKlass, but we derive it from element_type.
return element_type()->java_mirror();
}
--- a/hotspot/src/share/vm/ci/ciEnv.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -326,7 +326,7 @@
if (resolved_klass->oop_is_objArray()) {
// Find the element klass, if this is an array.
- resolved_klass = objArrayKlass::cast(resolved_klass)->bottom_klass();
+ resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass();
}
if (resolved_klass->oop_is_instance()) {
return Reflection::verify_class_access(accessing_klass->get_Klass(),
@@ -1126,7 +1126,8 @@
if (all_tiers) {
log()->elem("method_not_compilable");
} else {
- log()->elem("method_not_compilable_at_tier");
+ log()->elem("method_not_compilable_at_tier level='%d'",
+ current()->task()->comp_level());
}
}
_compilable = new_compilable;
--- a/hotspot/src/share/vm/ci/ciKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -33,7 +33,7 @@
// HotSpot virtual machine. In the vm, each Klass* contains an
// embedded Klass object. ciKlass is subclassed to explicitly
// represent the kind of Klass embedded in the Klass*. For
-// example, a Klass* with an embedded objArrayKlass object is
+// example, a Klass* with an embedded ObjArrayKlass object is
// represented in the ciObject hierarchy by the class
// ciObjArrayKlass.
class ciKlass : public ciType {
--- a/hotspot/src/share/vm/ci/ciMethodHandle.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodHandle.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
--- a/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -32,7 +32,7 @@
// ciObjArrayKlass
//
// This class represents a Klass* in the HotSpot virtual machine
-// whose Klass part is an objArrayKlass.
+// whose Klass part is an ObjArrayKlass.
// ------------------------------------------------------------------
// ciObjArrayKlass::ciObjArrayKlass
@@ -40,7 +40,7 @@
// Constructor for loaded object array klasses.
ciObjArrayKlass::ciObjArrayKlass(KlassHandle h_k) : ciArrayKlass(h_k) {
assert(get_Klass()->oop_is_objArray(), "wrong type");
- Klass* element_Klass = get_objArrayKlass()->bottom_klass();
+ Klass* element_Klass = get_ObjArrayKlass()->bottom_klass();
_base_element_klass = CURRENT_ENV->get_klass(element_Klass);
assert(_base_element_klass->is_instance_klass() ||
_base_element_klass->is_type_array_klass(), "bad base klass");
@@ -83,7 +83,7 @@
// Produce the element klass.
if (is_loaded()) {
VM_ENTRY_MARK;
- Klass* element_Klass = get_objArrayKlass()->element_klass();
+ Klass* element_Klass = get_ObjArrayKlass()->element_klass();
_element_klass = CURRENT_THREAD_ENV->get_klass(element_Klass);
} else {
VM_ENTRY_MARK;
--- a/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciObjArrayKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -30,7 +30,7 @@
// ciObjArrayKlass
//
// This class represents a Klass* in the HotSpot virtual machine
-// whose Klass part is an objArrayKlass.
+// whose Klass part is an ObjArrayKlass.
class ciObjArrayKlass : public ciArrayKlass {
CI_PACKAGE_ACCESS
friend class ciEnv;
@@ -45,8 +45,8 @@
ciKlass* base_element_klass,
int dimension);
- objArrayKlass* get_objArrayKlass() {
- return (objArrayKlass*)get_Klass();
+ ObjArrayKlass* get_ObjArrayKlass() {
+ return (ObjArrayKlass*)get_Klass();
}
static ciObjArrayKlass* make_impl(ciKlass* element_klass);
--- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -146,7 +146,7 @@
for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
BasicType t = (BasicType)i;
- if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY && t != T_NARROWOOP) {
+ if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY && t != T_NARROWOOP && t != T_NARROWKLASS) {
ciType::_basic_types[t] = new (_arena) ciType(t);
init_ident_of(ciType::_basic_types[t]);
}
@@ -174,7 +174,7 @@
}
ciEnv::_unloaded_cisymbol = ciObjectFactory::get_symbol(vmSymbols::dummy_symbol());
- // Create dummy InstanceKlass and objArrayKlass object and assign them idents
+ // Create dummy InstanceKlass and ObjArrayKlass object and assign them idents
ciEnv::_unloaded_ciinstance_klass = new (_arena) ciInstanceKlass(ciEnv::_unloaded_cisymbol, NULL, NULL);
init_ident_of(ciEnv::_unloaded_ciinstance_klass);
ciEnv::_unloaded_ciobjarrayklass = new (_arena) ciObjArrayKlass(ciEnv::_unloaded_cisymbol, ciEnv::_unloaded_ciinstance_klass, 1);
@@ -454,7 +454,7 @@
// the cache.
ciKlass* new_klass = NULL;
- // Two cases: this is an unloaded objArrayKlass or an
+ // Two cases: this is an unloaded ObjArrayKlass or an
// unloaded InstanceKlass. Deal with both.
if (name->byte_at(0) == '[') {
// Decompose the name.'
@@ -480,7 +480,7 @@
// The type array itself takes care of one of the dimensions.
dimension--;
- // The element klass is a typeArrayKlass.
+ // The element klass is a TypeArrayKlass.
element_klass = ciTypeArrayKlass::make(element_type);
}
new_klass = new (arena()) ciObjArrayKlass(name, element_klass, dimension);
--- a/hotspot/src/share/vm/ci/ciSignature.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciSignature.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/ci/ciSymbol.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciSymbol.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -35,7 +35,7 @@
// ciTypeArrayKlass::ciTypeArrayKlass
ciTypeArrayKlass::ciTypeArrayKlass(KlassHandle h_k) : ciArrayKlass(h_k) {
assert(get_Klass()->oop_is_typeArray(), "wrong type");
- assert(element_type() == get_typeArrayKlass()->element_type(), "");
+ assert(element_type() == get_TypeArrayKlass()->element_type(), "");
}
// ------------------------------------------------------------------
--- a/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciTypeArrayKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -37,8 +37,8 @@
protected:
ciTypeArrayKlass(KlassHandle h_k);
- typeArrayKlass* get_typeArrayKlass() {
- return (typeArrayKlass*)get_Klass();
+ TypeArrayKlass* get_TypeArrayKlass() {
+ return (TypeArrayKlass*)get_Klass();
}
const char* type_string() { return "ciTypeArrayKlass"; }
--- a/hotspot/src/share/vm/ci/ciTypeFlow.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/ci/ciTypeFlow.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -782,7 +782,7 @@
Array<Klass*>* ClassFileParser::parse_interfaces(constantPoolHandle cp,
int length,
- ClassLoaderData* loader_data,
+ ClassLoaderData* loader_data,
Handle protection_domain,
Symbol* class_name,
TRAPS) {
@@ -816,9 +816,6 @@
unresolved_klass, class_loader, protection_domain,
false, CHECK_NULL);
interf = KlassHandle(THREAD, k);
-
- if (LinkWellKnownClasses) // my super type is well known to me
- cp->klass_at_put(interface_index, interf()); // eagerly resolve
}
if (!Klass::cast(interf())->is_interface()) {
@@ -1008,40 +1005,42 @@
BAD_ALLOCATION_TYPE, // 1
BAD_ALLOCATION_TYPE, // 2
BAD_ALLOCATION_TYPE, // 3
- NONSTATIC_BYTE , // T_BOOLEAN = 4,
- NONSTATIC_SHORT, // T_CHAR = 5,
- NONSTATIC_WORD, // T_FLOAT = 6,
- NONSTATIC_DOUBLE, // T_DOUBLE = 7,
- NONSTATIC_BYTE, // T_BYTE = 8,
- NONSTATIC_SHORT, // T_SHORT = 9,
- NONSTATIC_WORD, // T_INT = 10,
- NONSTATIC_DOUBLE, // T_LONG = 11,
- NONSTATIC_OOP, // T_OBJECT = 12,
- NONSTATIC_OOP, // T_ARRAY = 13,
- BAD_ALLOCATION_TYPE, // T_VOID = 14,
- BAD_ALLOCATION_TYPE, // T_ADDRESS = 15,
- BAD_ALLOCATION_TYPE, // T_NARROWOOP= 16,
- BAD_ALLOCATION_TYPE, // T_METADATA = 17,
- BAD_ALLOCATION_TYPE, // T_CONFLICT = 18,
+ NONSTATIC_BYTE , // T_BOOLEAN = 4,
+ NONSTATIC_SHORT, // T_CHAR = 5,
+ NONSTATIC_WORD, // T_FLOAT = 6,
+ NONSTATIC_DOUBLE, // T_DOUBLE = 7,
+ NONSTATIC_BYTE, // T_BYTE = 8,
+ NONSTATIC_SHORT, // T_SHORT = 9,
+ NONSTATIC_WORD, // T_INT = 10,
+ NONSTATIC_DOUBLE, // T_LONG = 11,
+ NONSTATIC_OOP, // T_OBJECT = 12,
+ NONSTATIC_OOP, // T_ARRAY = 13,
+ BAD_ALLOCATION_TYPE, // T_VOID = 14,
+ BAD_ALLOCATION_TYPE, // T_ADDRESS = 15,
+ BAD_ALLOCATION_TYPE, // T_NARROWOOP = 16,
+ BAD_ALLOCATION_TYPE, // T_METADATA = 17,
+ BAD_ALLOCATION_TYPE, // T_NARROWKLASS = 18,
+ BAD_ALLOCATION_TYPE, // T_CONFLICT = 19,
BAD_ALLOCATION_TYPE, // 0
BAD_ALLOCATION_TYPE, // 1
BAD_ALLOCATION_TYPE, // 2
BAD_ALLOCATION_TYPE, // 3
- STATIC_BYTE , // T_BOOLEAN = 4,
- STATIC_SHORT, // T_CHAR = 5,
- STATIC_WORD, // T_FLOAT = 6,
- STATIC_DOUBLE, // T_DOUBLE = 7,
- STATIC_BYTE, // T_BYTE = 8,
- STATIC_SHORT, // T_SHORT = 9,
- STATIC_WORD, // T_INT = 10,
- STATIC_DOUBLE, // T_LONG = 11,
- STATIC_OOP, // T_OBJECT = 12,
- STATIC_OOP, // T_ARRAY = 13,
- BAD_ALLOCATION_TYPE, // T_VOID = 14,
- BAD_ALLOCATION_TYPE, // T_ADDRESS = 15,
- BAD_ALLOCATION_TYPE, // T_NARROWOOP= 16,
- BAD_ALLOCATION_TYPE, // T_METADATA = 17,
- BAD_ALLOCATION_TYPE, // T_CONFLICT = 18,
+ STATIC_BYTE , // T_BOOLEAN = 4,
+ STATIC_SHORT, // T_CHAR = 5,
+ STATIC_WORD, // T_FLOAT = 6,
+ STATIC_DOUBLE, // T_DOUBLE = 7,
+ STATIC_BYTE, // T_BYTE = 8,
+ STATIC_SHORT, // T_SHORT = 9,
+ STATIC_WORD, // T_INT = 10,
+ STATIC_DOUBLE, // T_LONG = 11,
+ STATIC_OOP, // T_OBJECT = 12,
+ STATIC_OOP, // T_ARRAY = 13,
+ BAD_ALLOCATION_TYPE, // T_VOID = 14,
+ BAD_ALLOCATION_TYPE, // T_ADDRESS = 15,
+ BAD_ALLOCATION_TYPE, // T_NARROWOOP = 16,
+ BAD_ALLOCATION_TYPE, // T_METADATA = 17,
+ BAD_ALLOCATION_TYPE, // T_NARROWKLASS = 18,
+ BAD_ALLOCATION_TYPE, // T_CONFLICT = 19,
};
static FieldAllocationType basic_type_to_atype(bool is_static, BasicType type) {
@@ -1072,10 +1071,11 @@
Array<u2>* ClassFileParser::parse_fields(ClassLoaderData* loader_data,
Symbol* class_name,
- constantPoolHandle cp, bool is_interface,
- FieldAllocationCount *fac,
+ constantPoolHandle cp,
+ bool is_interface,
+ FieldAllocationCount *fac,
Array<AnnotationArray*>** fields_annotations,
- u2* java_fields_count_ptr, TRAPS) {
+ u2* java_fields_count_ptr, TRAPS) {
ClassFileStream* cfs = stream();
cfs->guarantee_more(2, CHECK_NULL); // length
u2 length = cfs->get_u2_fast();
@@ -2169,14 +2169,12 @@
}
// All sizing information for a Method* is finally available, now create it
- Method* m = Method::allocate(loader_data,
- code_length,
- access_flags,
- linenumber_table_length,
- total_lvt_length,
- exception_table_length,
- checked_exceptions_length,
- CHECK_(nullHandle));
+ Method* m = Method::allocate(loader_data, code_length, access_flags,
+ linenumber_table_length,
+ total_lvt_length,
+ exception_table_length,
+ checked_exceptions_length,
+ CHECK_(nullHandle));
ClassLoadingService::add_class_method_size(m->size()*HeapWordSize);
@@ -2351,14 +2349,14 @@
// are added to klass's access_flags.
Array<Method*>* ClassFileParser::parse_methods(ClassLoaderData* loader_data,
- constantPoolHandle cp,
- bool is_interface,
- AccessFlags* promoted_flags,
- bool* has_final_method,
- Array<AnnotationArray*>** methods_annotations,
- Array<AnnotationArray*>** methods_parameter_annotations,
- Array<AnnotationArray*>** methods_default_annotations,
- TRAPS) {
+ constantPoolHandle cp,
+ bool is_interface,
+ AccessFlags* promoted_flags,
+ bool* has_final_method,
+ Array<AnnotationArray*>** methods_annotations,
+ Array<AnnotationArray*>** methods_parameter_annotations,
+ Array<AnnotationArray*>** methods_default_annotations,
+ TRAPS) {
ClassFileStream* cfs = stream();
AnnotationArray* method_annotations = NULL;
AnnotationArray* method_parameter_annotations = NULL;
@@ -2450,10 +2448,9 @@
}
// Sort method array by ascending method name (for faster lookups & vtable construction)
// Note that the ordering is not alphabetical, see Symbol::fast_compare
- Method::sort_methods(methods,
- methods_annotations,
- methods_parameter_annotations,
- methods_default_annotations);
+ Method::sort_methods(methods, methods_annotations,
+ methods_parameter_annotations,
+ methods_default_annotations);
// If JVMTI original method ordering or sharing is enabled construct int
// array remembering the original ordering
@@ -2835,10 +2832,10 @@
}
AnnotationArray* annotations = assemble_annotations(loader_data,
runtime_visible_annotations,
- runtime_visible_annotations_length,
- runtime_invisible_annotations,
- runtime_invisible_annotations_length,
- CHECK);
+ runtime_visible_annotations_length,
+ runtime_invisible_annotations,
+ runtime_invisible_annotations_length,
+ CHECK);
set_class_annotations(annotations);
if (parsed_innerclasses_attribute || parsed_enclosingmethod_attribute) {
@@ -2884,9 +2881,9 @@
AnnotationArray* ClassFileParser::assemble_annotations(ClassLoaderData* loader_data,
u1* runtime_visible_annotations,
- int runtime_visible_annotations_length,
- u1* runtime_invisible_annotations,
- int runtime_invisible_annotations_length, TRAPS) {
+ int runtime_visible_annotations_length,
+ u1* runtime_invisible_annotations,
+ int runtime_invisible_annotations_length, TRAPS) {
AnnotationArray* annotations = NULL;
if (runtime_visible_annotations != NULL ||
runtime_invisible_annotations != NULL) {
@@ -3161,13 +3158,13 @@
Array<AnnotationArray*>* methods_parameter_annotations = NULL;
Array<AnnotationArray*>* methods_default_annotations = NULL;
Array<Method*>* methods = parse_methods(loader_data,
- cp, access_flags.is_interface(),
- &promoted_flags,
- &has_final_method,
- &methods_annotations,
- &methods_parameter_annotations,
- &methods_default_annotations,
- CHECK_(nullHandle));
+ cp, access_flags.is_interface(),
+ &promoted_flags,
+ &has_final_method,
+ &methods_annotations,
+ &methods_parameter_annotations,
+ &methods_default_annotations,
+ CHECK_(nullHandle));
// Additional attributes
ClassAnnotationCollector parsed_annotations;
@@ -3186,17 +3183,14 @@
"Interfaces must have java.lang.Object as superclass in class file %s",
CHECK_(nullHandle));
}
- Klass* k = SystemDictionary::resolve_super_or_fail(class_name,
- sk,
- class_loader,
- protection_domain,
- true,
- CHECK_(nullHandle));
+ Klass* k = SystemDictionary::resolve_super_or_fail(class_name, sk,
+ class_loader,
+ protection_domain,
+ true,
+ CHECK_(nullHandle));
KlassHandle kh (THREAD, k);
super_klass = instanceKlassHandle(THREAD, kh());
- if (LinkWellKnownClasses) // my super class is well known to me
- cp->klass_at_put(super_class_index, super_klass()); // eagerly resolve
}
if (super_klass.not_null()) {
if (super_klass->is_interface()) {
@@ -3222,10 +3216,10 @@
// sort methods
Array<int>* method_ordering = sort_methods(loader_data,
methods,
- methods_annotations,
- methods_parameter_annotations,
- methods_default_annotations,
- CHECK_(nullHandle));
+ methods_annotations,
+ methods_parameter_annotations,
+ methods_default_annotations,
+ CHECK_(nullHandle));
// promote flags from parse_methods() to the klass' flags
access_flags.add_promoted_flags(promoted_flags.as_int());
@@ -3591,16 +3585,16 @@
InstanceKlass::nonstatic_oop_map_size(total_oop_map_count);
Klass* ik = InstanceKlass::allocate_instance_klass(loader_data,
- vtable_size,
- itable_size,
- static_field_size,
- total_oop_map_size2,
- rt,
- access_flags,
- name,
- super_klass(),
- host_klass,
- CHECK_(nullHandle));
+ vtable_size,
+ itable_size,
+ static_field_size,
+ total_oop_map_size2,
+ rt,
+ access_flags,
+ name,
+ super_klass(),
+ host_klass,
+ CHECK_(nullHandle));
// Add all classes to our internal class loader list here,
// including classes in the bootstrap (NULL) class loader.
@@ -3642,7 +3636,7 @@
// has to be changed accordingly.
this_klass->set_initial_method_idnum(methods->length());
this_klass->set_name(cp->klass_name_at(this_class_index));
- if (LinkWellKnownClasses || is_anonymous()) // I am well known to myself
+ if (is_anonymous()) // I am well known to myself
cp->klass_at_put(this_class_index, this_klass()); // eagerly resolve
if (fields_annotations != NULL ||
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -148,7 +148,7 @@
// Interface parsing
Array<Klass*>* parse_interfaces(constantPoolHandle cp,
int length,
- ClassLoaderData* loader_data,
+ ClassLoaderData* loader_data,
Handle protection_domain,
Symbol* class_name,
TRAPS);
@@ -166,10 +166,10 @@
TRAPS);
Array<u2>* parse_fields(ClassLoaderData* loader_data,
Symbol* class_name,
- constantPoolHandle cp, bool is_interface,
- FieldAllocationCount *fac,
+ constantPoolHandle cp, bool is_interface,
+ FieldAllocationCount *fac,
Array<AnnotationArray*>** fields_annotations,
- u2* java_fields_count_ptr, TRAPS);
+ u2* java_fields_count_ptr, TRAPS);
// Method parsing
methodHandle parse_method(ClassLoaderData* loader_data,
@@ -181,13 +181,13 @@
AnnotationArray** method_default_annotations,
TRAPS);
Array<Method*>* parse_methods(ClassLoaderData* loader_data,
- constantPoolHandle cp,
- bool is_interface,
+ constantPoolHandle cp,
+ bool is_interface,
AccessFlags* promoted_flags,
bool* has_final_method,
- Array<AnnotationArray*>** methods_annotations,
- Array<AnnotationArray*>** methods_parameter_annotations,
- Array<AnnotationArray*>** methods_default_annotations,
+ Array<AnnotationArray*>** methods_annotations,
+ Array<AnnotationArray*>** methods_parameter_annotations,
+ Array<AnnotationArray*>** methods_default_annotations,
TRAPS);
Array<int>* sort_methods(ClassLoaderData* loader_data,
Array<Method*>* methods,
@@ -232,9 +232,9 @@
// Annotations handling
AnnotationArray* assemble_annotations(ClassLoaderData* loader_data,
u1* runtime_visible_annotations,
- int runtime_visible_annotations_length,
- u1* runtime_invisible_annotations,
- int runtime_invisible_annotations_length, TRAPS);
+ int runtime_visible_annotations_length,
+ u1* runtime_invisible_annotations,
+ int runtime_invisible_annotations_length, TRAPS);
int skip_annotation(u1* buffer, int limit, int index);
int skip_annotation_value(u1* buffer, int limit, int index);
void parse_annotations(u1* buffer, int limit, constantPoolHandle cp,
@@ -252,8 +252,8 @@
unsigned int* nonstatic_oop_counts);
void set_precomputed_flags(instanceKlassHandle k);
Array<Klass*>* compute_transitive_interfaces(ClassLoaderData* loader_data,
- instanceKlassHandle super,
- Array<Klass*>* local_ifs, TRAPS);
+ instanceKlassHandle super,
+ Array<Klass*>* local_ifs, TRAPS);
// Format checker methods
void classfile_parse_error(const char* msg, TRAPS);
@@ -344,7 +344,7 @@
// constant pool construction, but in later versions they can.
// %%% Let's phase out the old is_klass_reference.
bool is_klass_reference(constantPoolHandle cp, int index) {
- return ((LinkWellKnownClasses || EnableInvokeDynamic)
+ return (EnableInvokeDynamic
? cp->tag_at(index).is_klass_or_reference()
: cp->tag_at(index).is_klass_reference());
}
--- a/hotspot/src/share/vm/classfile/classLoader.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/classLoader.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/classfile/javaAssertions.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/javaAssertions.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -540,18 +540,18 @@
if (k->oop_is_array()) {
Handle comp_mirror;
if (k->oop_is_typeArray()) {
- BasicType type = typeArrayKlass::cast(k())->element_type();
+ BasicType type = TypeArrayKlass::cast(k())->element_type();
comp_mirror = Universe::java_mirror(type);
} else {
assert(k->oop_is_objArray(), "Must be");
- Klass* element_klass = objArrayKlass::cast(k())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(k())->element_klass();
assert(element_klass != NULL, "Must have an element klass");
comp_mirror = Klass::cast(element_klass)->java_mirror();
}
assert(comp_mirror.not_null(), "must have a mirror");
// Two-way link between the array klass and its component mirror:
- arrayKlass::cast(k())->set_component_mirror(comp_mirror());
+ ArrayKlass::cast(k())->set_component_mirror(comp_mirror());
set_array_klass(comp_mirror(), k());
} else {
assert(k->oop_is_instance(), "Must be");
@@ -704,7 +704,7 @@
#ifdef ASSERT
if (is_primitive) {
Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
- assert(k == NULL || is_java_primitive(arrayKlass::cast(k)->element_type()),
+ assert(k == NULL || is_java_primitive(ArrayKlass::cast(k)->element_type()),
"Should be either the T_VOID primitive or a java primitive");
}
#endif
@@ -719,7 +719,7 @@
BasicType type = T_VOID;
if (ak != NULL) {
// Note: create_basic_type_mirror above initializes ak to a non-null value.
- type = arrayKlass::cast(ak)->element_type();
+ type = ArrayKlass::cast(ak)->element_type();
} else {
assert(java_class == Universe::void_mirror(), "only valid non-array primitive");
}
@@ -846,7 +846,7 @@
typeArrayOop java_lang_Thread::name(oop java_thread) {
oop name = java_thread->obj_field(_name_offset);
- assert(name == NULL || (name->is_typeArray() && typeArrayKlass::cast(name->klass())->element_type() == T_CHAR), "just checking");
+ assert(name == NULL || (name->is_typeArray() && TypeArrayKlass::cast(name->klass())->element_type() == T_CHAR), "just checking");
return typeArrayOop(name);
}
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -244,7 +244,7 @@
}
} else {
k = Universe::typeArrayKlassObj(t);
- k = typeArrayKlass::cast(k)->array_klass(fd.dimension(), CHECK_NULL);
+ k = TypeArrayKlass::cast(k)->array_klass(fd.dimension(), CHECK_NULL);
}
return k;
}
@@ -291,16 +291,6 @@
Handle protection_domain,
bool is_superclass,
TRAPS) {
-
- // Try to get one of the well-known klasses.
- // They are trusted, and do not participate in circularities.
- if (LinkWellKnownClasses) {
- Klass* k = find_well_known_klass(class_name);
- if (k != NULL) {
- return k;
- }
- }
-
// Double-check, if child class is already loaded, just return super-class,interface
// Don't add a placedholder if already loaded, i.e. already in system dictionary
// Make sure there's a placeholder for the *child* before resolving.
@@ -920,20 +910,12 @@
// Look for a loaded instance or array klass by name. Do not do any loading.
// return NULL in case of error.
Klass* SystemDictionary::find_instance_or_array_klass(Symbol* class_name,
- Handle class_loader,
- Handle protection_domain,
- TRAPS) {
+ Handle class_loader,
+ Handle protection_domain,
+ TRAPS) {
Klass* k = NULL;
assert(class_name != NULL, "class name must be non NULL");
- // Try to get one of the well-known klasses.
- if (LinkWellKnownClasses) {
- k = find_well_known_klass(class_name);
- if (k != NULL) {
- return k;
- }
- }
-
if (FieldType::is_array(class_name)) {
// The name refers to an array. Parse the name.
// dimension and object_key in FieldArrayInfo are assigned as a
@@ -954,48 +936,16 @@
return k;
}
-// Quick range check for names of well-known classes:
-static Symbol* wk_klass_name_limits[2] = {NULL, NULL};
-
-#ifndef PRODUCT
-static int find_wkk_calls, find_wkk_probes, find_wkk_wins;
-// counts for "hello world": 3983, 1616, 1075
-// => 60% hit after limit guard, 25% total win rate
-#endif
-
-Klass* SystemDictionary::find_well_known_klass(Symbol* class_name) {
- // A bounds-check on class_name will quickly get a negative result.
- NOT_PRODUCT(find_wkk_calls++);
- if (class_name >= wk_klass_name_limits[0] &&
- class_name <= wk_klass_name_limits[1]) {
- NOT_PRODUCT(find_wkk_probes++);
- vmSymbols::SID sid = vmSymbols::find_sid(class_name);
- if (sid != vmSymbols::NO_SID) {
- Klass* k = NULL;
- switch (sid) {
- #define WK_KLASS_CASE(name, symbol, ignore_option) \
- case vmSymbols::VM_SYMBOL_ENUM_NAME(symbol): \
- k = WK_KLASS(name); break;
- WK_KLASSES_DO(WK_KLASS_CASE)
- #undef WK_KLASS_CASE
- }
- NOT_PRODUCT(if (k != NULL) find_wkk_wins++);
- return k;
- }
- }
- return NULL;
-}
-
// Note: this method is much like resolve_from_stream, but
// updates no supplemental data structures.
// TODO consolidate the two methods with a helper routine?
Klass* SystemDictionary::parse_stream(Symbol* class_name,
- Handle class_loader,
- Handle protection_domain,
- ClassFileStream* st,
- KlassHandle host_klass,
- GrowableArray<Handle>* cp_patches,
- TRAPS) {
+ Handle class_loader,
+ Handle protection_domain,
+ ClassFileStream* st,
+ KlassHandle host_klass,
+ GrowableArray<Handle>* cp_patches,
+ TRAPS) {
TempNewSymbol parsed_name = NULL;
// Parse the stream. Note that we do this even though this klass might
@@ -1076,11 +1026,11 @@
// the class until we have parsed the stream.
Klass* SystemDictionary::resolve_from_stream(Symbol* class_name,
- Handle class_loader,
- Handle protection_domain,
- ClassFileStream* st,
- bool verify,
- TRAPS) {
+ Handle class_loader,
+ Handle protection_domain,
+ ClassFileStream* st,
+ bool verify,
+ TRAPS) {
// Classloaders that support parallelism, e.g. bootstrap classloader,
// or all classloaders with UnsyncloadClass do not acquire lock here
@@ -1939,23 +1889,12 @@
int opt = (info & right_n_bits(CEIL_LG_OPTION_LIMIT));
initialize_wk_klass((WKID)id, opt, CHECK);
-
- // Update limits, so find_well_known_klass can be very fast:
- Symbol* s = vmSymbols::symbol_at((vmSymbols::SID)sid);
- if (wk_klass_name_limits[1] == NULL) {
- wk_klass_name_limits[0] = wk_klass_name_limits[1] = s;
- } else if (wk_klass_name_limits[1] < s) {
- wk_klass_name_limits[1] = s;
- } else if (wk_klass_name_limits[0] > s) {
- wk_klass_name_limits[0] = s;
- }
}
// move the starting value forward to the limit:
start_id = limit_id;
}
-
void SystemDictionary::initialize_preloaded_classes(TRAPS) {
assert(WK_KLASS(Object_klass) == NULL, "preloaded classes should only be initialized once");
// Preload commonly used klasses
@@ -2187,7 +2126,7 @@
// Force the protection domain to be null. (This removes protection checks.)
Handle no_protection_domain;
Klass* klass = find_instance_or_array_klass(class_name, class_loader,
- no_protection_domain, CHECK_NULL);
+ no_protection_domain, CHECK_NULL);
if (klass != NULL)
return klass;
@@ -2525,7 +2464,7 @@
mirror = NULL; // safety
// Emulate ConstantPool::verify_constant_pool_resolve.
if (Klass::cast(sel_klass)->oop_is_objArray())
- sel_klass = objArrayKlass::cast(sel_klass)->bottom_klass();
+ sel_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass();
if (Klass::cast(sel_klass)->oop_is_instance()) {
KlassHandle sel_kh(THREAD, sel_klass);
LinkResolver::check_klass_accessability(accessing_klass, sel_kh, CHECK_(empty));
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -92,93 +92,93 @@
// The order of these definitions is significant; it is the order in which
// preloading is actually performed by initialize_preloaded_classes.
-#define WK_KLASSES_DO(template) \
- /* well-known classes */ \
- template(Object_klass, java_lang_Object, Pre) \
- template(String_klass, java_lang_String, Pre) \
- template(Class_klass, java_lang_Class, Pre) \
- template(Cloneable_klass, java_lang_Cloneable, Pre) \
- template(ClassLoader_klass, java_lang_ClassLoader, Pre) \
- template(Serializable_klass, java_io_Serializable, Pre) \
- template(System_klass, java_lang_System, Pre) \
- template(Throwable_klass, java_lang_Throwable, Pre) \
- template(Error_klass, java_lang_Error, Pre) \
- template(ThreadDeath_klass, java_lang_ThreadDeath, Pre) \
- template(Exception_klass, java_lang_Exception, Pre) \
- template(RuntimeException_klass, java_lang_RuntimeException, Pre) \
- template(ProtectionDomain_klass, java_security_ProtectionDomain, Pre) \
- template(AccessControlContext_klass, java_security_AccessControlContext, Pre) \
- template(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre) \
- template(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre) \
- template(LinkageError_klass, java_lang_LinkageError, Pre) \
- template(ClassCastException_klass, java_lang_ClassCastException, Pre) \
- template(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre) \
- template(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre) \
- template(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre) \
- template(StackOverflowError_klass, java_lang_StackOverflowError, Pre) \
- template(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre) \
- template(Reference_klass, java_lang_ref_Reference, Pre) \
- \
- /* Preload ref klasses and set reference types */ \
- template(SoftReference_klass, java_lang_ref_SoftReference, Pre) \
- template(WeakReference_klass, java_lang_ref_WeakReference, Pre) \
- template(FinalReference_klass, java_lang_ref_FinalReference, Pre) \
- template(PhantomReference_klass, java_lang_ref_PhantomReference, Pre) \
- template(Finalizer_klass, java_lang_ref_Finalizer, Pre) \
- \
- template(Thread_klass, java_lang_Thread, Pre) \
- template(ThreadGroup_klass, java_lang_ThreadGroup, Pre) \
- template(Properties_klass, java_util_Properties, Pre) \
- template(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre) \
- template(reflect_Field_klass, java_lang_reflect_Field, Pre) \
- template(reflect_Method_klass, java_lang_reflect_Method, Pre) \
- template(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre) \
- \
+#define WK_KLASSES_DO(do_klass) \
+ /* well-known classes */ \
+ do_klass(Object_klass, java_lang_Object, Pre ) \
+ do_klass(String_klass, java_lang_String, Pre ) \
+ do_klass(Class_klass, java_lang_Class, Pre ) \
+ do_klass(Cloneable_klass, java_lang_Cloneable, Pre ) \
+ do_klass(ClassLoader_klass, java_lang_ClassLoader, Pre ) \
+ do_klass(Serializable_klass, java_io_Serializable, Pre ) \
+ do_klass(System_klass, java_lang_System, Pre ) \
+ do_klass(Throwable_klass, java_lang_Throwable, Pre ) \
+ do_klass(Error_klass, java_lang_Error, Pre ) \
+ do_klass(ThreadDeath_klass, java_lang_ThreadDeath, Pre ) \
+ do_klass(Exception_klass, java_lang_Exception, Pre ) \
+ do_klass(RuntimeException_klass, java_lang_RuntimeException, Pre ) \
+ do_klass(ProtectionDomain_klass, java_security_ProtectionDomain, Pre ) \
+ do_klass(AccessControlContext_klass, java_security_AccessControlContext, Pre ) \
+ do_klass(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre ) \
+ do_klass(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre ) \
+ do_klass(LinkageError_klass, java_lang_LinkageError, Pre ) \
+ do_klass(ClassCastException_klass, java_lang_ClassCastException, Pre ) \
+ do_klass(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre ) \
+ do_klass(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre ) \
+ do_klass(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre ) \
+ do_klass(StackOverflowError_klass, java_lang_StackOverflowError, Pre ) \
+ do_klass(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre ) \
+ do_klass(Reference_klass, java_lang_ref_Reference, Pre ) \
+ \
+ /* Preload ref klasses and set reference types */ \
+ do_klass(SoftReference_klass, java_lang_ref_SoftReference, Pre ) \
+ do_klass(WeakReference_klass, java_lang_ref_WeakReference, Pre ) \
+ do_klass(FinalReference_klass, java_lang_ref_FinalReference, Pre ) \
+ do_klass(PhantomReference_klass, java_lang_ref_PhantomReference, Pre ) \
+ do_klass(Finalizer_klass, java_lang_ref_Finalizer, Pre ) \
+ \
+ do_klass(Thread_klass, java_lang_Thread, Pre ) \
+ do_klass(ThreadGroup_klass, java_lang_ThreadGroup, Pre ) \
+ do_klass(Properties_klass, java_util_Properties, Pre ) \
+ do_klass(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre ) \
+ do_klass(reflect_Field_klass, java_lang_reflect_Field, Pre ) \
+ do_klass(reflect_Method_klass, java_lang_reflect_Method, Pre ) \
+ do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre ) \
+ \
/* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \
/* Universe::is_gte_jdk14x_version() is not set up by this point. */ \
/* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \
- template(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt) \
- template(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \
- template(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \
- template(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt) \
- template(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \
- template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \
- \
- /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
- template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \
- template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \
- template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \
- template(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt) \
- template(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292) \
- template(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292) \
- template(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292) \
- template(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292) \
- template(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292) \
- template(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292) \
- /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \
- \
- template(StringBuffer_klass, java_lang_StringBuffer, Pre) \
- template(StringBuilder_klass, java_lang_StringBuilder, Pre) \
- \
- /* It's NULL in non-1.4 JDKs. */ \
- template(StackTraceElement_klass, java_lang_StackTraceElement, Opt) \
- /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \
- /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \
- template(nio_Buffer_klass, java_nio_Buffer, Opt) \
- \
- template(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \
- \
- template(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt) \
- \
- /* Preload boxing klasses */ \
- template(Boolean_klass, java_lang_Boolean, Pre) \
- template(Character_klass, java_lang_Character, Pre) \
- template(Float_klass, java_lang_Float, Pre) \
- template(Double_klass, java_lang_Double, Pre) \
- template(Byte_klass, java_lang_Byte, Pre) \
- template(Short_klass, java_lang_Short, Pre) \
- template(Integer_klass, java_lang_Integer, Pre) \
- template(Long_klass, java_lang_Long, Pre) \
+ do_klass(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt ) \
+ do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \
+ do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \
+ do_klass(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt ) \
+ do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15 ) \
+ do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15 ) \
+ \
+ /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \
+ do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292 ) \
+ do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292 ) \
+ do_klass(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292 ) \
+ do_klass(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt ) \
+ do_klass(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292 ) \
+ do_klass(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292 ) \
+ do_klass(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292 ) \
+ do_klass(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292 ) \
+ do_klass(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292 ) \
+ do_klass(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292 ) \
+ /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \
+ \
+ do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre ) \
+ do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre ) \
+ \
+ /* It's NULL in non-1.4 JDKs. */ \
+ do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \
+ /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \
+ /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \
+ do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \
+ \
+ do_klass(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel ) \
+ \
+ do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \
+ \
+ /* Preload boxing klasses */ \
+ do_klass(Boolean_klass, java_lang_Boolean, Pre ) \
+ do_klass(Character_klass, java_lang_Character, Pre ) \
+ do_klass(Float_klass, java_lang_Float, Pre ) \
+ do_klass(Double_klass, java_lang_Double, Pre ) \
+ do_klass(Byte_klass, java_lang_Byte, Pre ) \
+ do_klass(Short_klass, java_lang_Short, Pre ) \
+ do_klass(Integer_klass, java_lang_Integer, Pre ) \
+ do_klass(Long_klass, java_lang_Long, Pre ) \
/*end*/
@@ -280,9 +280,6 @@
Handle protection_domain,
TRAPS);
- // If the given name is known to vmSymbols, return the well-know klass:
- static Klass* find_well_known_klass(Symbol* class_name);
-
// Lookup an instance or array class that has already been loaded
// either into the given class loader, or else into another class
// loader that is constrained (via loader constraints) to produce
@@ -392,9 +389,9 @@
return k;
}
- static Klass* check_klass_Pre(Klass* k) { return check_klass(k); }
+ static Klass* check_klass_Pre( Klass* k) { return check_klass(k); }
static Klass* check_klass_Pre_JSR292(Klass* k) { return EnableInvokeDynamic ? check_klass(k) : k; }
- static Klass* check_klass_Opt(Klass* k) { return k; }
+ static Klass* check_klass_Opt( Klass* k) { return k; }
static Klass* check_klass_Opt_Kernel(Klass* k) { return k; } //== Opt
static Klass* check_klass_Opt_Only_JDK15(Klass* k) {
assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only");
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -324,24 +324,6 @@
return vmIntrinsics::_none;
}
-Method* vmIntrinsics::method_for(vmIntrinsics::ID id) {
- if (id == _none) return NULL;
- Symbol* cname = vmSymbols::symbol_at(class_for(id));
- Symbol* mname = vmSymbols::symbol_at(name_for(id));
- Symbol* msig = vmSymbols::symbol_at(signature_for(id));
- if (cname == NULL || mname == NULL || msig == NULL) return NULL;
- Klass* k = SystemDictionary::find_well_known_klass(cname);
- if (k == NULL) return NULL;
- Method* m = InstanceKlass::cast(k)->find_method(mname, msig);
- if (m == NULL &&
- cname == vmSymbols::java_lang_invoke_MethodHandle() &&
- msig == vmSymbols::star_name()) {
- // Any signature polymorphic method is represented by a fixed concrete signature:
- m = InstanceKlass::cast(k)->find_method(mname, vmSymbols::object_array_object_signature());
- }
- return m;
-}
-
#define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0"
static const char* vm_intrinsic_name_bodies =
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1138,9 +1138,6 @@
static const char* short_name_as_C_string(ID id, char* buf, int size);
- // Access to intrinsic methods:
- static Method* method_for(ID id);
-
// Wrapper object methods:
static ID for_boxing(BasicType type);
static ID for_unboxing(BasicType type);
--- a/hotspot/src/share/vm/code/dependencies.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/code/dependencies.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -333,12 +333,14 @@
for (int j = 0; j < stride; j++) {
if (j == skipj) continue;
ciBaseObject* v = deps->at(i+j);
+ int idx;
if (v->is_object()) {
- bytes.write_int(_oop_recorder->find_index(v->as_object()->constant_encoding()));
+ idx = _oop_recorder->find_index(v->as_object()->constant_encoding());
} else {
ciMetadata* meta = v->as_metadata();
- bytes.write_int(_oop_recorder->find_index(meta->constant_encoding()));
+ idx = _oop_recorder->find_index(meta->constant_encoding());
}
+ bytes.write_int(idx);
}
}
}
@@ -573,8 +575,8 @@
if (type() == call_site_target_value) {
args[j] = argument_oop(j);
} else {
- args[j] = argument(j);
- }
+ args[j] = argument(j);
+ }
}
if (_deps != NULL && _deps->log() != NULL) {
Dependencies::write_dependency_to(_deps->log(),
@@ -665,6 +667,14 @@
Metadata* Dependencies::DepStream::argument(int i) {
Metadata* result = recorded_metadata_at(argument_index(i));
+
+ if (result == NULL) { // Explicit context argument can be compressed
+ int ctxkj = dep_context_arg(type()); // -1 if no explicit context arg
+ if (ctxkj >= 0 && i == ctxkj && ctxkj+1 < argument_count()) {
+ result = ctxk_encoded_as_null(type(), argument(ctxkj+1));
+ }
+ }
+
assert(result == NULL || result->is_klass() || result->is_method(), "must be");
return result;
}
@@ -680,25 +690,21 @@
// Most dependencies have an explicit context type argument.
{
- int ctxkj = dep_context_arg(_type); // -1 if no explicit context arg
+ int ctxkj = dep_context_arg(type()); // -1 if no explicit context arg
if (ctxkj >= 0) {
Metadata* k = argument(ctxkj);
- if (k != NULL) { // context type was not compressed away
- assert(k->is_klass(), "type check");
- return (Klass*) k;
- }
- // recompute "default" context type
- return ctxk_encoded_as_null(_type, argument(ctxkj+1));
+ assert(k != NULL && k->is_klass(), "type check");
+ return (Klass*)k;
}
}
// Some dependencies are using the klass of the first object
// argument as implicit context type (e.g. call_site_target_value).
{
- int ctxkj = dep_implicit_context_arg(_type);
+ int ctxkj = dep_implicit_context_arg(type());
if (ctxkj >= 0) {
Klass* k = argument_oop(ctxkj)->klass();
- assert(k->is_klass(), "type check");
+ assert(k != NULL && k->is_klass(), "type check");
return (Klass*) k;
}
}
--- a/hotspot/src/share/vm/code/stubs.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/code/stubs.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/code/stubs.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/code/stubs.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/code/vmreg.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/code/vmreg.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1570,7 +1570,8 @@
}
CompileLog* log = thread->log();
if (log != NULL) {
- log->begin_elem("start_compile_thread thread='" UINTX_FORMAT "' process='%d'",
+ log->begin_elem("start_compile_thread name='%s' thread='" UINTX_FORMAT "' process='%d'",
+ thread->name(),
os::current_thread_id(),
os::current_process_id());
log->stamp();
--- a/hotspot/src/share/vm/compiler/compileLog.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/compiler/compileLog.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -302,3 +302,48 @@
char buf[4 * K];
finish_log_on_error(file, buf, sizeof(buf));
}
+
+// ------------------------------------------------------------------
+// CompileLog::inline_success
+//
+// Print about successful method inlining.
+void CompileLog::inline_success(const char* reason) {
+ begin_elem("inline_success reason='");
+ text(reason);
+ end_elem("'");
+}
+
+// ------------------------------------------------------------------
+// CompileLog::inline_fail
+//
+// Print about failed method inlining.
+void CompileLog::inline_fail(const char* reason) {
+ begin_elem("inline_fail reason='");
+ text(reason);
+ end_elem("'");
+}
+
+// ------------------------------------------------------------------
+// CompileLog::set_context
+//
+// Set XML tag as an optional marker - it is printed only if
+// there are other entries after until it is reset.
+void CompileLog::set_context(const char* format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ clear_context();
+ _context.print("<");
+ _context.vprint(format, ap);
+ _context.print_cr("/>");
+ va_end(ap);
+}
+
+// ------------------------------------------------------------------
+// CompileLog::code_cache_state
+//
+// Print code cache state.
+void CompileLog::code_cache_state() {
+ begin_elem("code_cache");
+ CodeCache::log_state(this);
+ end_elem("");
+}
--- a/hotspot/src/share/vm/compiler/compileLog.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/compiler/compileLog.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -62,7 +62,13 @@
intx thread_id() { return _thread_id; }
const char* file() { return _file; }
+
+ // Optional context marker, to help place actions that occur during
+ // parsing. If there is no log output until the next context string
+ // or reset, context string will be silently ignored
stringStream* context() { return &_context; }
+ void clear_context() { context()->reset(); }
+ void set_context(const char* format, ...);
void name(ciSymbol* s); // name='s'
void name(Symbol* s) { xmlStream::name(s); }
@@ -71,6 +77,9 @@
int identify(ciBaseObject* obj);
void clear_identities();
+ void inline_fail (const char* reason);
+ void inline_success(const char* reason);
+
// virtuals
virtual void see_tag(const char* tag, bool push);
virtual void pop_tag(const char* tag);
@@ -78,6 +87,9 @@
// make a provisional end of log mark
void mark_file_end() { _file_end = out()->count(); }
+ // Print code cache statistics
+ void code_cache_state();
+
// copy all logs to the given stream
static void finish_log(outputStream* out);
static void finish_log_on_error(outputStream* out, char *buf, int buflen);
--- a/hotspot/src/share/vm/compiler/oopMap.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/compiler/oopMap.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -222,7 +222,7 @@
// depends on this property.
debug_only(
FreeChunk* junk = NULL;
- assert(UseCompressedOops ||
+ assert(UseCompressedKlassPointers ||
junk->prev_addr() == (void*)(oop(junk)->klass_addr()),
"Offset of FreeChunk::_prev within FreeChunk must match"
" that of OopDesc::_klass within OopDesc");
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/objectStartArray.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -204,7 +204,7 @@
int random_seed = 17;
do {
while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
- objArrayKlass* const k = (objArrayKlass*)task.obj()->klass();
+ ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
k->oop_follow_contents(cm, task.obj(), task.index());
cm->follow_marking_stacks();
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -188,10 +188,10 @@
// Process ObjArrays one at a time to avoid marking stack bloat.
ObjArrayTask task;
if (_objarray_stack.pop_overflow(task)) {
- objArrayKlass* const k = (objArrayKlass*)task.obj()->klass();
+ ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
k->oop_follow_contents(this, task.obj(), task.index());
} else if (_objarray_stack.pop_local(task)) {
- objArrayKlass* const k = (objArrayKlass*)task.obj()->klass();
+ ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
k->oop_follow_contents(this, task.obj(), task.index());
}
} while (!marking_stacks_empty());
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGenerationCounters.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/collectorCounters.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcPolicyCounters.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/gcStats.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcStats.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/generationCounters.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/hSpaceCounters.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/hSpaceCounters.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/hSpaceCounters.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/hSpaceCounters.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -115,7 +115,7 @@
// Process ObjArrays one at a time to avoid marking stack bloat.
if (!_objarray_stack.is_empty()) {
ObjArrayTask task = _objarray_stack.pop();
- objArrayKlass* const k = (objArrayKlass*)task.obj()->klass();
+ ObjArrayKlass* const k = (ObjArrayKlass*)task.obj()->klass();
k->oop_follow_contents(task.obj(), task.index());
}
} while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
--- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/spaceCounters.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1626,7 +1626,7 @@
if (rhsObject != NULL) {
/* Check assignability of rhsObject into arrObj */
Klass* rhsKlassOop = rhsObject->klass(); // EBX (subclass)
- Klass* elemKlassOop = objArrayKlass::cast(arrObj->klass())->element_klass(); // superklass EAX
+ Klass* elemKlassOop = ObjArrayKlass::cast(arrObj->klass())->element_klass(); // superklass EAX
//
// Check for compatibilty. This check must not GC!!
// Seems way more expensive now that we must dispatch
--- a/hotspot/src/share/vm/interpreter/interpreter.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -211,7 +211,7 @@
int n = Interpreter::local_offset_in_bytes(index)/jintSize;
dims[index] = first_size_address[n];
}
- oop obj = arrayKlass::cast(klass)->multi_allocate(nof_dims, dims, CHECK);
+ oop obj = ArrayKlass::cast(klass)->multi_allocate(nof_dims, dims, CHECK);
thread->set_vm_result(obj);
IRT_END
--- a/hotspot/src/share/vm/libadt/set.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/libadt/set.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/libadt/vectset.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/libadt/vectset.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/memory/allocation.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/allocation.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -27,6 +27,7 @@
#include "runtime/globals.hpp"
#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
#ifdef COMPILER1
#include "c1/c1_globals.hpp"
#endif
@@ -157,8 +158,16 @@
typedef unsigned short MEMFLAGS;
+#if INCLUDE_NMT
+
extern bool NMT_track_callsite;
+#else
+
+const bool NMT_track_callsite = false;
+
+#endif // INCLUDE_NMT
+
// debug build does not inline
#if defined(_DEBUG_)
#define CURRENT_PC (NMT_track_callsite ? os::get_caller_pc(1) : 0)
--- a/hotspot/src/share/vm/memory/allocation.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/allocation.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/memory/freeBlockDictionary.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/freeBlockDictionary.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/src/share/vm/memory/freeList.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/freeList.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/memory/freeList.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/freeList.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/memory/heap.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/heap.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/memory/heap.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/heap.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/memory/heapInspection.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/heapInspection.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, 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
@@ -28,7 +28,7 @@
#include "memory/allocation.inline.hpp"
#include "oops/oop.inline.hpp"
-#ifndef SERVICES_KERNEL
+#if INCLUDE_SERVICES
// HeapInspection
@@ -129,12 +129,12 @@
void sort();
};
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
class HeapInspection : public AllStatic {
public:
- static void heap_inspection(outputStream* st, bool need_prologue) KERNEL_RETURN;
- static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) KERNEL_RETURN;
+ static void heap_inspection(outputStream* st, bool need_prologue) NOT_SERVICES_RETURN;
+ static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
};
#endif // SHARE_VM_MEMORY_HEAPINSPECTION_HPP
--- a/hotspot/src/share/vm/memory/metaspace.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/metaspace.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -135,6 +135,8 @@
MetaWord* expand_and_allocate(size_t size,
MetadataType mdtype);
+ static bool is_initialized() { return _class_space_list != NULL; }
+
#ifndef PRODUCT
bool contains(const void *ptr) const;
bool contains_class(const void *ptr) const;
--- a/hotspot/src/share/vm/memory/metaspaceShared.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -42,14 +42,8 @@
int MetaspaceShared::_max_alignment = 0;
-int MetaspaceShared::max_alignment() { return _max_alignment; }
-void MetaspaceShared::set_max_alignment(int alignment) { _max_alignment = alignment; }
-// Accessor functions to save shared space created for metadata, which has
-// extra space allocated at the end for miscellaneous data and code.
ReservedSpace* MetaspaceShared::_shared_rs = NULL;
-ReservedSpace* MetaspaceShared::shared_rs() { return _shared_rs; }
-void MetaspaceShared::set_shared_rs(ReservedSpace* rs) { _shared_rs = rs; }
// Read/write a data stream for restoring/preserving metadata pointers and
// miscellaneous data from/to the shared archive file.
--- a/hotspot/src/share/vm/memory/metaspaceShared.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -56,18 +56,33 @@
n_regions = 4
};
- static void set_max_alignment(int alignment) KERNEL_RETURN;
- static int max_alignment() KERNEL_RETURN_(0);
+ // Accessor functions to save shared space created for metadata, which has
+ // extra space allocated at the end for miscellaneous data and code.
+ static void set_max_alignment(int alignment) {
+ CDS_ONLY(_max_alignment = alignment);
+ }
+
+ static int max_alignment() {
+ CDS_ONLY(return _max_alignment);
+ NOT_CDS(return 0);
+ }
- static void preload_and_dump(TRAPS) KERNEL_RETURN;
- static ReservedSpace* shared_rs();
- static void set_shared_rs(ReservedSpace* rs) KERNEL_RETURN;
+ static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
+
+ static ReservedSpace* shared_rs() {
+ CDS_ONLY(return _shared_rs);
+ NOT_CDS(return NULL);
+ }
- static bool map_shared_spaces(FileMapInfo* mapinfo) KERNEL_RETURN_(false);
- static void initialize_shared_spaces() KERNEL_RETURN;
+ static void set_shared_rs(ReservedSpace* rs) {
+ CDS_ONLY(_shared_rs = rs;)
+ }
+
+ static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false);
+ static void initialize_shared_spaces() NOT_CDS_RETURN;
// Return true if given address is in the mapped shared space.
- static bool is_in_shared_space(const void* p) KERNEL_RETURN_(false);
+ static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
static void generate_vtable_methods(void** vtbl_list,
void** vtable,
@@ -79,7 +94,7 @@
// Remap the shared readonly space to shared readwrite, private if
// sharing is enabled. Simply returns true if sharing is not enabled
// or if the remapping has already been done by a prior call.
- static bool remap_shared_readonly_as_readwrite() KERNEL_RETURN_(true);
+ static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true);
static void print_shared_spaces();
};
--- a/hotspot/src/share/vm/memory/oopFactory.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/oopFactory.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -47,12 +47,12 @@
}
typeArrayOop oopFactory::new_tenured_charArray(int length, TRAPS) {
- return typeArrayKlass::cast(Universe::charArrayKlassObj())->allocate(length, THREAD);
+ return TypeArrayKlass::cast(Universe::charArrayKlassObj())->allocate(length, THREAD);
}
typeArrayOop oopFactory::new_typeArray(BasicType type, int length, TRAPS) {
Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);
- typeArrayKlass* type_asArrayKlass = typeArrayKlass::cast(type_asKlassOop);
+ TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
typeArrayOop result = type_asArrayKlass->allocate(length, THREAD);
return result;
}
@@ -66,14 +66,14 @@
typeArrayOop oopFactory::new_metaDataArray(int length, TRAPS) {
BasicType type = LP64_ONLY(T_LONG) NOT_LP64(T_INT);
Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);
- typeArrayKlass* type_asArrayKlass = typeArrayKlass::cast(type_asKlassOop);
+ TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
typeArrayOop result = type_asArrayKlass->allocate_common(length, true, THREAD);
return result;
}
typeArrayOop oopFactory::new_typeArray_nozero(BasicType type, int length, TRAPS) {
Klass* type_asKlassOop = Universe::typeArrayKlassObj(type);
- typeArrayKlass* type_asArrayKlass = typeArrayKlass::cast(type_asKlassOop);
+ TypeArrayKlass* type_asArrayKlass = TypeArrayKlass::cast(type_asKlassOop);
typeArrayOop result = type_asArrayKlass->allocate_common(length, false, THREAD);
return result;
}
@@ -82,7 +82,7 @@
objArrayOop oopFactory::new_objArray(Klass* klass, int length, TRAPS) {
assert(klass->is_klass(), "must be instance class");
if (klass->oop_is_array()) {
- return ((arrayKlass*)klass)->allocate_arrayArray(1, length, THREAD);
+ return ((ArrayKlass*)klass)->allocate_arrayArray(1, length, THREAD);
} else {
assert (klass->oop_is_instance(), "new object array with klass not an InstanceKlass");
return ((InstanceKlass*)klass)->allocate_objArray(1, length, THREAD);
--- a/hotspot/src/share/vm/memory/oopFactory.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/oopFactory.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -40,19 +40,19 @@
class oopFactory: AllStatic {
public:
// Basic type leaf array allocation
- static typeArrayOop new_boolArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::boolArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_charArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::charArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_singleArray(int length, TRAPS) { return typeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_doubleArray(int length, TRAPS) { return typeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_byteArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::byteArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_shortArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_intArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::intArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_longArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::longArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_boolArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::boolArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_charArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::charArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_singleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_doubleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_byteArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::byteArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_shortArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_intArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::intArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_longArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::longArrayKlassObj ())->allocate(length, CHECK_NULL); }
// create java.lang.Object[]
static objArrayOop new_objectArray(int length, TRAPS) {
assert(Universe::objectArrayKlassObj() != NULL, "Too early?");
- return objArrayKlass::
+ return ObjArrayKlass::
cast(Universe::objectArrayKlassObj())->allocate(length, CHECK_NULL);
}
--- a/hotspot/src/share/vm/memory/referencePolicy.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/referencePolicy.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/memory/space.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/space.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/memory/specialized_oop_closures.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/specialized_oop_closures.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -200,7 +200,7 @@
enum Kind {
ik, // InstanceKlass
irk, // InstanceRefKlass
- oa, // objArrayKlass
+ oa, // ObjArrayKlass
NUM_Kinds
};
--- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/memory/universe.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/universe.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -151,7 +151,9 @@
CollectedHeap* Universe::_collectedHeap = NULL;
-NarrowOopStruct Universe::_narrow_oop = { NULL, 0, true };
+NarrowPtrStruct Universe::_narrow_oop = { NULL, 0, true };
+NarrowPtrStruct Universe::_narrow_klass = { NULL, 0, true };
+address Universe::_narrow_ptrs_base;
void Universe::basic_type_classes_do(void f(Klass*)) {
@@ -265,14 +267,14 @@
compute_base_vtable_size();
if (!UseSharedSpaces) {
- _boolArrayKlassObj = typeArrayKlass::create_klass(T_BOOLEAN, sizeof(jboolean), CHECK);
- _charArrayKlassObj = typeArrayKlass::create_klass(T_CHAR, sizeof(jchar), CHECK);
- _singleArrayKlassObj = typeArrayKlass::create_klass(T_FLOAT, sizeof(jfloat), CHECK);
- _doubleArrayKlassObj = typeArrayKlass::create_klass(T_DOUBLE, sizeof(jdouble), CHECK);
- _byteArrayKlassObj = typeArrayKlass::create_klass(T_BYTE, sizeof(jbyte), CHECK);
- _shortArrayKlassObj = typeArrayKlass::create_klass(T_SHORT, sizeof(jshort), CHECK);
- _intArrayKlassObj = typeArrayKlass::create_klass(T_INT, sizeof(jint), CHECK);
- _longArrayKlassObj = typeArrayKlass::create_klass(T_LONG, sizeof(jlong), CHECK);
+ _boolArrayKlassObj = TypeArrayKlass::create_klass(T_BOOLEAN, sizeof(jboolean), CHECK);
+ _charArrayKlassObj = TypeArrayKlass::create_klass(T_CHAR, sizeof(jchar), CHECK);
+ _singleArrayKlassObj = TypeArrayKlass::create_klass(T_FLOAT, sizeof(jfloat), CHECK);
+ _doubleArrayKlassObj = TypeArrayKlass::create_klass(T_DOUBLE, sizeof(jdouble), CHECK);
+ _byteArrayKlassObj = TypeArrayKlass::create_klass(T_BYTE, sizeof(jbyte), CHECK);
+ _shortArrayKlassObj = TypeArrayKlass::create_klass(T_SHORT, sizeof(jshort), CHECK);
+ _intArrayKlassObj = TypeArrayKlass::create_klass(T_INT, sizeof(jint), CHECK);
+ _longArrayKlassObj = TypeArrayKlass::create_klass(T_LONG, sizeof(jlong), CHECK);
_typeArrayKlassObjs[T_BOOLEAN] = _boolArrayKlassObj;
_typeArrayKlassObjs[T_CHAR] = _charArrayKlassObj;
@@ -440,8 +442,8 @@
{ InstanceClassLoaderKlass o; add_vtable(list, &n, &o, count); }
{ InstanceMirrorKlass o; add_vtable(list, &n, &o, count); }
{ InstanceRefKlass o; add_vtable(list, &n, &o, count); }
- { typeArrayKlass o; add_vtable(list, &n, &o, count); }
- { objArrayKlass o; add_vtable(list, &n, &o, count); }
+ { TypeArrayKlass o; add_vtable(list, &n, &o, count); }
+ { ObjArrayKlass o; add_vtable(list, &n, &o, count); }
{ Method o; add_vtable(list, &n, &o, count); }
{ ConstantPool o; add_vtable(list, &n, &o, count); }
}
@@ -752,7 +754,7 @@
#ifndef SERIALGC
Universe::_collectedHeap = new ParallelScavengeHeap();
#else // SERIALGC
- fatal("UseParallelGC not supported in java kernel vm.");
+ fatal("UseParallelGC not supported in this VM.");
#endif // SERIALGC
} else if (UseG1GC) {
@@ -777,7 +779,7 @@
gc_policy = new ConcurrentMarkSweepPolicy();
}
#else // SERIALGC
- fatal("UseConcMarkSweepGC not supported in java kernel vm.");
+ fatal("UseConcMarkSweepGC not supported in this VM.");
#endif // SERIALGC
} else { // default old generation
gc_policy = new MarkSweepPolicy();
@@ -807,7 +809,7 @@
}
if ((uint64_t)Universe::heap()->reserved_region().end() > OopEncodingHeapMax) {
// Can't reserve heap below 32Gb.
- Universe::set_narrow_oop_base(Universe::heap()->base() - os::vm_page_size());
+ // keep the Universe::narrow_oop_base() set in Universe::reserve_heap()
Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
if (verbose) {
tty->print(", Compressed Oops with base: "PTR_FORMAT, Universe::narrow_oop_base());
@@ -838,8 +840,16 @@
tty->cr();
tty->cr();
}
+ if (UseCompressedKlassPointers) {
+ Universe::set_narrow_klass_base(Universe::narrow_oop_base());
+ Universe::set_narrow_klass_shift(MIN2(Universe::narrow_oop_shift(), LogKlassAlignmentInBytes));
+ }
+ Universe::set_narrow_ptrs_base(Universe::narrow_oop_base());
}
- assert(Universe::narrow_oop_base() == (Universe::heap()->base() - os::vm_page_size()) ||
+ // Universe::narrow_oop_base() is one page below the metaspace
+ // base. The actual metaspace base depends on alignment constraints
+ // so we don't know its exact location here.
+ assert((intptr_t)Universe::narrow_oop_base() <= (intptr_t)(Universe::heap()->base() - os::vm_page_size() - ClassMetaspaceSize) ||
Universe::narrow_oop_base() == NULL, "invalid value");
assert(Universe::narrow_oop_shift() == LogMinObjAlignmentInBytes ||
Universe::narrow_oop_shift() == 0, "invalid value");
@@ -861,7 +871,10 @@
ReservedSpace Universe::reserve_heap(size_t heap_size, size_t alignment) {
// Add in the class metaspace area so the classes in the headers can
// be compressed the same as instances.
- size_t total_reserved = align_size_up(heap_size + ClassMetaspaceSize, alignment);
+ // Need to round class space size up because it's below the heap and
+ // the actual alignment depends on its size.
+ size_t metaspace_size = align_size_up(ClassMetaspaceSize, alignment);
+ size_t total_reserved = align_size_up(heap_size + metaspace_size, alignment);
char* addr = Universe::preferred_heap_base(total_reserved, Universe::UnscaledNarrowOop);
ReservedHeapSpace total_rs(total_reserved, alignment, UseLargePages, addr);
@@ -895,11 +908,23 @@
return total_rs;
}
- // Split the reserved space into main Java heap and a space for classes
- // so that they can be compressed using the same algorithm as compressed oops
- ReservedSpace heap_rs = total_rs.first_part(heap_size);
- ReservedSpace class_rs = total_rs.last_part(heap_size, alignment);
+ // Split the reserved space into main Java heap and a space for
+ // classes so that they can be compressed using the same algorithm
+ // as compressed oops. If compress oops and compress klass ptrs are
+ // used we need the meta space first: if the alignment used for
+ // compressed oops is greater than the one used for compressed klass
+ // ptrs, a metadata space on top of the heap could become
+ // unreachable.
+ ReservedSpace class_rs = total_rs.first_part(metaspace_size);
+ ReservedSpace heap_rs = total_rs.last_part(metaspace_size, alignment);
Metaspace::initialize_class_space(class_rs);
+
+ if (UseCompressedOops) {
+ // Universe::initialize_heap() will reset this to NULL if unscaled
+ // or zero-based narrow oops are actually used.
+ address base = (address)(total_rs.base() - os::vm_page_size());
+ Universe::set_narrow_oop_base(base);
+ }
return heap_rs;
}
--- a/hotspot/src/share/vm/memory/universe.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/memory/universe.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -105,16 +105,16 @@
Method* get_Method();
};
-// For UseCompressedOops.
-struct NarrowOopStruct {
- // Base address for oop-within-java-object materialization.
- // NULL if using wide oops or zero based narrow oops.
+// For UseCompressedOops and UseCompressedKlassPointers.
+struct NarrowPtrStruct {
+ // Base address for oop/klass-within-java-object materialization.
+ // NULL if using wide oops/klasses or zero based narrow oops/klasses.
address _base;
- // Number of shift bits for encoding/decoding narrow oops.
- // 0 if using wide oops or zero based unscaled narrow oops,
- // LogMinObjAlignmentInBytes otherwise.
+ // Number of shift bits for encoding/decoding narrow ptrs.
+ // 0 if using wide ptrs or zero based unscaled narrow ptrs,
+ // LogMinObjAlignmentInBytes/LogKlassAlignmentInBytes otherwise.
int _shift;
- // Generate code with implicit null checks for narrow oops.
+ // Generate code with implicit null checks for narrow ptrs.
bool _use_implicit_null_checks;
};
@@ -206,7 +206,10 @@
static CollectedHeap* _collectedHeap;
// For UseCompressedOops.
- static struct NarrowOopStruct _narrow_oop;
+ static struct NarrowPtrStruct _narrow_oop;
+ // For UseCompressedKlassPointers.
+ static struct NarrowPtrStruct _narrow_klass;
+ static address _narrow_ptrs_base;
// array of dummy objects used with +FullGCAlot
debug_only(static objArrayOop _fullgc_alot_dummy_array;)
@@ -259,8 +262,21 @@
HeapBasedNarrowOop = 2
};
static char* preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode);
- static void set_narrow_oop_base(address base) { _narrow_oop._base = base; }
- static void set_narrow_oop_use_implicit_null_checks(bool use) { _narrow_oop._use_implicit_null_checks = use; }
+ static char* preferred_metaspace_base(size_t heap_size, NARROW_OOP_MODE mode);
+ static void set_narrow_oop_base(address base) {
+ assert(UseCompressedOops, "no compressed oops?");
+ _narrow_oop._base = base;
+ }
+ static void set_narrow_klass_base(address base) {
+ assert(UseCompressedKlassPointers, "no compressed klass ptrs?");
+ _narrow_klass._base = base;
+ }
+ static void set_narrow_oop_use_implicit_null_checks(bool use) {
+ assert(UseCompressedOops, "no compressed ptrs?");
+ _narrow_oop._use_implicit_null_checks = use;
+ }
+ static bool reserve_metaspace_helper(bool with_base = false);
+ static ReservedHeapSpace reserve_heap_metaspace(size_t heap_size, size_t alignment, bool& contiguous);
// Debugging
static int _verify_count; // number of verifies done
@@ -354,14 +370,30 @@
static CollectedHeap* heap() { return _collectedHeap; }
// For UseCompressedOops
- static address* narrow_oop_base_addr() { return &_narrow_oop._base; }
- static address narrow_oop_base() { return _narrow_oop._base; }
- static bool is_narrow_oop_base(void* addr) { return (narrow_oop_base() == (address)addr); }
- static int narrow_oop_shift() { return _narrow_oop._shift; }
- static bool narrow_oop_use_implicit_null_checks() { return _narrow_oop._use_implicit_null_checks; }
+ static address narrow_oop_base() { return _narrow_oop._base; }
+ static bool is_narrow_oop_base(void* addr) { return (narrow_oop_base() == (address)addr); }
+ static int narrow_oop_shift() { return _narrow_oop._shift; }
+ static bool narrow_oop_use_implicit_null_checks() { return _narrow_oop._use_implicit_null_checks; }
+
+ // For UseCompressedKlassPointers
+ static address narrow_klass_base() { return _narrow_klass._base; }
+ static bool is_narrow_klass_base(void* addr) { return (narrow_klass_base() == (address)addr); }
+ static int narrow_klass_shift() { return _narrow_klass._shift; }
+ static bool narrow_klass_use_implicit_null_checks() { return _narrow_klass._use_implicit_null_checks; }
+
+ static address* narrow_ptrs_base_addr() { return &_narrow_ptrs_base; }
+ static void set_narrow_ptrs_base(address a) { _narrow_ptrs_base = a; }
+ static address narrow_ptrs_base() { return _narrow_ptrs_base; }
// this is set in vm_version on sparc (and then reset in universe afaict)
- static void set_narrow_oop_shift(int shift) { _narrow_oop._shift = shift; }
+ static void set_narrow_oop_shift(int shift) {
+ _narrow_oop._shift = shift;
+ }
+
+ static void set_narrow_klass_shift(int shift) {
+ assert(shift == 0 || shift == LogKlassAlignmentInBytes, "invalid shift for klass ptrs");
+ _narrow_klass._shift = shift;
+ }
// Reserve Java heap and determine CompressedOops mode
static ReservedSpace reserve_heap(size_t heap_size, size_t alignment);
--- a/hotspot/src/share/vm/oops/arrayKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/arrayKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -36,7 +36,7 @@
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
-int arrayKlass::static_size(int header_size) {
+int ArrayKlass::static_size(int header_size) {
// size of an array klass object
assert(header_size <= InstanceKlass::header_size(), "bad header size");
// If this assert fails, see comments in base_create_array_klass.
@@ -51,7 +51,7 @@
}
-Klass* arrayKlass::java_super() const {
+Klass* ArrayKlass::java_super() const {
if (super() == NULL) return NULL; // bootstrap case
// Array klasses have primary supertypes which are not reported to Java.
// Example super chain: String[][] -> Object[][] -> Object[] -> Object
@@ -59,18 +59,18 @@
}
-oop arrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
+oop ArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
ShouldNotReachHere();
return NULL;
}
-Method* arrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
+Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
// There are no methods in an array klass but the super class (Object) has some
assert(super(), "super klass must be present");
return Klass::cast(super())->uncached_lookup_method(name, signature);
}
-arrayKlass::arrayKlass(Symbol* name) {
+ArrayKlass::ArrayKlass(Symbol* name) {
set_alloc_size(0);
set_name(name);
@@ -89,15 +89,15 @@
// Initialization of vtables and mirror object is done separatly from base_create_array_klass,
-// since a GC can happen. At this point all instance variables of the arrayKlass must be setup.
-void arrayKlass::complete_create_array_klass(arrayKlass* k, KlassHandle super_klass, TRAPS) {
+// since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
+void ArrayKlass::complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS) {
ResourceMark rm(THREAD);
k->initialize_supers(super_klass(), CHECK);
k->vtable()->initialize_vtable(false, CHECK);
java_lang_Class::create_mirror(k, CHECK);
}
-GrowableArray<Klass*>* arrayKlass::compute_secondary_supers(int num_extra_slots) {
+GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots) {
// interfaces = { cloneable_klass, serializable_klass };
assert(num_extra_slots == 0, "sanity of primitive array type");
// Must share this for correct bootstrapping!
@@ -105,7 +105,7 @@
return NULL;
}
-bool arrayKlass::compute_is_subtype_of(Klass* k) {
+bool ArrayKlass::compute_is_subtype_of(Klass* k) {
// An array is a subtype of Serializable, Clonable, and Object
return k == SystemDictionary::Object_klass()
|| k == SystemDictionary::Cloneable_klass()
@@ -113,19 +113,19 @@
}
-inline intptr_t* arrayKlass::start_of_vtable() const {
+inline intptr_t* ArrayKlass::start_of_vtable() const {
// all vtables start at the same place, that's why we use InstanceKlass::header_size here
return ((intptr_t*)this) + InstanceKlass::header_size();
}
-klassVtable* arrayKlass::vtable() const {
+klassVtable* ArrayKlass::vtable() const {
KlassHandle kh(Thread::current(), this);
return new klassVtable(kh, start_of_vtable(), vtable_length() / vtableEntry::size());
}
-objArrayOop arrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
+objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
if (length < 0) {
THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
}
@@ -136,40 +136,40 @@
}
int size = objArrayOopDesc::object_size(length);
Klass* k = array_klass(n+dimension(), CHECK_0);
- arrayKlass* ak = arrayKlass::cast(k);
+ ArrayKlass* ak = ArrayKlass::cast(k);
objArrayOop o =
(objArrayOop)CollectedHeap::array_allocate(ak, size, length, CHECK_0);
// initialization to NULL not necessary, area already cleared
return o;
}
-void arrayKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
+void ArrayKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
Klass* k = this;
// Iterate over this array klass and all higher dimensions
while (k != NULL) {
f(k, CHECK);
- k = arrayKlass::cast(k)->higher_dimension();
+ k = ArrayKlass::cast(k)->higher_dimension();
}
}
-void arrayKlass::array_klasses_do(void f(Klass* k)) {
+void ArrayKlass::array_klasses_do(void f(Klass* k)) {
Klass* k = this;
// Iterate over this array klass and all higher dimensions
while (k != NULL) {
f(k);
- k = arrayKlass::cast(k)->higher_dimension();
+ k = ArrayKlass::cast(k)->higher_dimension();
}
}
-void arrayKlass::with_array_klasses_do(void f(Klass* k)) {
+void ArrayKlass::with_array_klasses_do(void f(Klass* k)) {
array_klasses_do(f);
}
// GC support
-void arrayKlass::oops_do(OopClosure* cl) {
+void ArrayKlass::oops_do(OopClosure* cl) {
Klass::oops_do(cl);
cl->do_oop(adr_component_mirror());
@@ -177,42 +177,42 @@
// JVM support
-jint arrayKlass::compute_modifier_flags(TRAPS) const {
+jint ArrayKlass::compute_modifier_flags(TRAPS) const {
return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
}
// JVMTI support
-jint arrayKlass::jvmti_class_status() const {
+jint ArrayKlass::jvmti_class_status() const {
return JVMTI_CLASS_STATUS_ARRAY;
}
-void arrayKlass::remove_unshareable_info() {
+void ArrayKlass::remove_unshareable_info() {
Klass::remove_unshareable_info();
// Clear the java mirror
set_component_mirror(NULL);
}
-void arrayKlass::restore_unshareable_info(TRAPS) {
+void ArrayKlass::restore_unshareable_info(TRAPS) {
Klass::restore_unshareable_info(CHECK);
// Klass recreates the component mirror also
}
// Printing
-void arrayKlass::print_on(outputStream* st) const {
+void ArrayKlass::print_on(outputStream* st) const {
assert(is_klass(), "must be klass");
Klass::print_on(st);
}
-void arrayKlass::print_value_on(outputStream* st) const {
+void ArrayKlass::print_value_on(outputStream* st) const {
assert(is_klass(), "must be klass");
for(int index = 0; index < dimension(); index++) {
st->print("[]");
}
}
-void arrayKlass::oop_print_on(oop obj, outputStream* st) {
+void ArrayKlass::oop_print_on(oop obj, outputStream* st) {
assert(obj->is_array(), "must be array");
Klass::oop_print_on(obj, st);
st->print_cr(" - length: %d", arrayOop(obj)->length());
@@ -221,7 +221,7 @@
// Verification
-void arrayKlass::verify_on(outputStream* st) {
+void ArrayKlass::verify_on(outputStream* st) {
Klass::verify_on(st);
if (component_mirror() != NULL) {
@@ -229,7 +229,7 @@
}
}
-void arrayKlass::oop_verify_on(oop obj, outputStream* st) {
+void ArrayKlass::oop_verify_on(oop obj, outputStream* st) {
guarantee(obj->is_array(), "must be array");
arrayOop a = arrayOop(obj);
guarantee(a->length() >= 0, "array with negative length?");
--- a/hotspot/src/share/vm/oops/arrayKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/arrayKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -30,9 +30,9 @@
class klassVtable;
-// arrayKlass is the abstract baseclass for all array classes
+// ArrayKlass is the abstract baseclass for all array classes
-class arrayKlass: public Klass {
+class ArrayKlass: public Klass {
friend class VMStructs;
private:
int _dimension; // This is n'th-dimensional array.
@@ -46,8 +46,8 @@
// Constructors
// The constructor with the Symbol argument does the real array
// initialization, the other is a dummy
- arrayKlass(Symbol* name);
- arrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
+ ArrayKlass(Symbol* name);
+ ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
public:
// Testing operation
@@ -80,7 +80,7 @@
oop* adr_component_mirror() { return (oop*)&this->_component_mirror;}
// Compiler/Interpreter offset
- static ByteSize component_mirror_offset() { return in_ByteSize(offset_of(arrayKlass, _component_mirror)); }
+ static ByteSize component_mirror_offset() { return in_ByteSize(offset_of(ArrayKlass, _component_mirror)); }
virtual Klass* java_super() const;//{ return SystemDictionary::Object_klass(); }
@@ -94,16 +94,16 @@
Method* uncached_lookup_method(Symbol* name, Symbol* signature) const;
// Casting from Klass*
- static arrayKlass* cast(Klass* k) {
- assert(k->oop_is_array(), "cast to arrayKlass");
- return (arrayKlass*) k;
+ static ArrayKlass* cast(Klass* k) {
+ assert(k->oop_is_array(), "cast to ArrayKlass");
+ return (ArrayKlass*) k;
}
GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots);
bool compute_is_subtype_of(Klass* k);
// Sizing
- static int header_size() { return sizeof(arrayKlass)/HeapWordSize; }
+ static int header_size() { return sizeof(ArrayKlass)/HeapWordSize; }
static int static_size(int header_size);
// Java vtable
@@ -124,7 +124,7 @@
virtual void oops_do(OopClosure* cl);
// Return a handle.
- static void complete_create_array_klass(arrayKlass* k, KlassHandle super_klass, TRAPS);
+ static void complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS);
// jvm support
--- a/hotspot/src/share/vm/oops/constantPool.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/constantPool.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -533,7 +533,7 @@
void ConstantPool::verify_constant_pool_resolve(constantPoolHandle this_oop, KlassHandle k, TRAPS) {
if (k->oop_is_instance() || k->oop_is_objArray()) {
instanceKlassHandle holder (THREAD, this_oop->pool_holder());
- Klass* elem_oop = k->oop_is_instance() ? k() : objArrayKlass::cast(k())->bottom_klass();
+ Klass* elem_oop = k->oop_is_instance() ? k() : ObjArrayKlass::cast(k())->bottom_klass();
KlassHandle element (THREAD, elem_oop);
// The element type could be a typeArray - we only need the access check if it is
--- a/hotspot/src/share/vm/oops/constantPool.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/constantPool.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -468,7 +468,7 @@
assert(tag_at(which).is_string(), "Corrupted constant pool");
// Must do an acquire here in case another thread resolved the klass
// behind our back, lest we later load stale values thru the oop.
- // we might want a volatile_obj_at in objArrayKlass.
+ // we might want a volatile_obj_at in ObjArrayKlass.
int obj_index = cp_to_object_index(which);
return resolved_references()->obj_at(obj_index);
}
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -989,13 +989,13 @@
// Check if update has already taken place
if (this_oop->array_klasses() == NULL) {
- Klass* k = objArrayKlass::allocate_objArray_klass(this_oop->class_loader_data(), 1, this_oop, CHECK_NULL);
+ Klass* k = ObjArrayKlass::allocate_objArray_klass(this_oop->class_loader_data(), 1, this_oop, CHECK_NULL);
this_oop->set_array_klasses(k);
}
}
}
// _this will always be set at this point
- objArrayKlass* oak = (objArrayKlass*)this_oop->array_klasses();
+ ObjArrayKlass* oak = (ObjArrayKlass*)this_oop->array_klasses();
if (or_null) {
return oak->array_klass_or_null(n);
}
@@ -1224,12 +1224,12 @@
void InstanceKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
if (array_klasses() != NULL)
- arrayKlass::cast(array_klasses())->array_klasses_do(f, THREAD);
+ ArrayKlass::cast(array_klasses())->array_klasses_do(f, THREAD);
}
void InstanceKlass::array_klasses_do(void f(Klass* k)) {
if (array_klasses() != NULL)
- arrayKlass::cast(array_klasses())->array_klasses_do(f);
+ ArrayKlass::cast(array_klasses())->array_klasses_do(f);
}
@@ -2310,7 +2310,7 @@
Symbol* classname1 = Klass::cast(class1)->name();
if (Klass::cast(class2)->oop_is_objArray()) {
- class2 = objArrayKlass::cast(class2)->bottom_klass();
+ class2 = ObjArrayKlass::cast(class2)->bottom_klass();
}
oop classloader2;
if (Klass::cast(class2)->oop_is_instance()) {
--- a/hotspot/src/share/vm/oops/instanceOop.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/instanceOop.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -37,7 +37,9 @@
// If compressed, the offset of the fields of the instance may not be aligned.
static int base_offset_in_bytes() {
- return UseCompressedKlassPointers ?
+ // offset computation code breaks if UseCompressedKlassPointers
+ // only is true
+ return (UseCompressedOops && UseCompressedKlassPointers) ?
klass_gap_offset_in_bytes() :
sizeof(instanceOopDesc);
}
--- a/hotspot/src/share/vm/oops/klass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/klass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -532,13 +532,13 @@
Klass* Klass::array_klass_impl(bool or_null, int rank, TRAPS) {
- fatal("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
+ fatal("array_klass should be dispatched to InstanceKlass, ObjArrayKlass or TypeArrayKlass");
return NULL;
}
Klass* Klass::array_klass_impl(bool or_null, TRAPS) {
- fatal("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
+ fatal("array_klass should be dispatched to InstanceKlass, ObjArrayKlass or TypeArrayKlass");
return NULL;
}
@@ -674,7 +674,7 @@
assert(i>=0 && i<((InstanceKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds");
} else {
assert(oop_is_array(), "Must be");
- assert(i>=0 && i<((arrayKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds");
+ assert(i>=0 && i<((ArrayKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds");
}
}
--- a/hotspot/src/share/vm/oops/klassVtable.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1096,7 +1096,7 @@
SystemDictionary::classes_do(do_class);
fixed = no_klasses * oopSize; // vtable length
// filler size is a conservative approximation
- filler = oopSize * (no_klasses - no_instance_klasses) * (sizeof(InstanceKlass) - sizeof(arrayKlass) - 1);
+ filler = oopSize * (no_klasses - no_instance_klasses) * (sizeof(InstanceKlass) - sizeof(ArrayKlass) - 1);
entries = sizeof(vtableEntry) * sum_of_vtable_len;
array_entries = sizeof(vtableEntry) * sum_of_array_vtable_len;
}
--- a/hotspot/src/share/vm/oops/klassVtable.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/klassVtable.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -31,7 +31,7 @@
#include "utilities/growableArray.hpp"
// A klassVtable abstracts the variable-length vtable that is embedded in InstanceKlass
-// and arrayKlass. klassVtable objects are used just as convenient transient accessors to the vtable,
+// and ArrayKlass. klassVtable objects are used just as convenient transient accessors to the vtable,
// not to actually hold the vtable data.
// Note: the klassVtable should not be accessed before the class has been verified
// (until that point, the vtable is uninitialized).
--- a/hotspot/src/share/vm/oops/method.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/method.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -712,7 +712,8 @@
}
if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) {
ttyLocker ttyl;
- xtty->begin_elem("make_not_%scompilable thread='%d'", is_osr ? "osr_" : "", (int) os::current_thread_id());
+ xtty->begin_elem("make_not_%scompilable thread='" UINTX_FORMAT "'",
+ is_osr ? "osr_" : "", os::current_thread_id());
xtty->method(this);
xtty->stamp();
xtty->end_elem();
@@ -1065,7 +1066,7 @@
Klass* Method::check_non_bcp_klass(Klass* klass) {
if (klass != NULL && Klass::cast(klass)->class_loader() != NULL) {
if (Klass::cast(klass)->oop_is_objArray())
- klass = objArrayKlass::cast(klass)->bottom_klass();
+ klass = ObjArrayKlass::cast(klass)->bottom_klass();
return klass;
}
return NULL;
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -56,16 +56,16 @@
#include "oops/oop.pcgc.inline.hpp"
#endif
-objArrayKlass* objArrayKlass::allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS) {
- assert(objArrayKlass::header_size() <= InstanceKlass::header_size(),
+ObjArrayKlass* ObjArrayKlass::allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS) {
+ assert(ObjArrayKlass::header_size() <= InstanceKlass::header_size(),
"array klasses must be same size as InstanceKlass");
- int size = arrayKlass::static_size(objArrayKlass::header_size());
+ int size = ArrayKlass::static_size(ObjArrayKlass::header_size());
- return new (loader_data, size, THREAD) objArrayKlass(n, klass_handle, name);
+ return new (loader_data, size, THREAD) ObjArrayKlass(n, klass_handle, name);
}
-Klass* objArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data,
+Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data,
int n, KlassHandle element_klass, TRAPS) {
// Eagerly allocate the direct array supertype.
@@ -145,7 +145,7 @@
}
// Initialize instance variables
- objArrayKlass* oak = objArrayKlass::allocate(loader_data, n, element_klass, name, CHECK_0);
+ ObjArrayKlass* oak = ObjArrayKlass::allocate(loader_data, n, element_klass, name, CHECK_0);
// Add all classes to our internal class loader list here,
// including classes in the bootstrap (NULL) class loader.
@@ -153,12 +153,12 @@
loader_data->add_class(oak);
// Call complete_create_array_klass after all instance variables has been initialized.
- arrayKlass::complete_create_array_klass(oak, super_klass, CHECK_0);
+ ArrayKlass::complete_create_array_klass(oak, super_klass, CHECK_0);
return oak;
}
-objArrayKlass::objArrayKlass(int n, KlassHandle element_klass, Symbol* name) : arrayKlass(name) {
+ObjArrayKlass::ObjArrayKlass(int n, KlassHandle element_klass, Symbol* name) : ArrayKlass(name) {
this->set_dimension(n);
this->set_element_klass(element_klass());
// decrement refcount because object arrays are not explicitly freed. The
@@ -168,7 +168,7 @@
Klass* bk;
if (element_klass->oop_is_objArray()) {
- bk = objArrayKlass::cast(element_klass())->bottom_klass();
+ bk = ObjArrayKlass::cast(element_klass())->bottom_klass();
} else {
bk = element_klass();
}
@@ -181,12 +181,12 @@
assert(this->oop_is_objArray(), "sanity");
}
-int objArrayKlass::oop_size(oop obj) const {
+int ObjArrayKlass::oop_size(oop obj) const {
assert(obj->is_objArray(), "must be object array");
return objArrayOop(obj)->object_size();
}
-objArrayOop objArrayKlass::allocate(int length, TRAPS) {
+objArrayOop ObjArrayKlass::allocate(int length, TRAPS) {
if (length >= 0) {
if (length <= arrayOopDesc::max_array_length(T_OBJECT)) {
int size = objArrayOopDesc::object_size(length);
@@ -204,7 +204,7 @@
static int multi_alloc_counter = 0;
-oop objArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
+oop ObjArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
int length = *sizes;
// Call to lower_dimension uses this pointer, so most be called before a
// possible GC
@@ -215,7 +215,7 @@
if (rank > 1) {
if (length != 0) {
for (int index = 0; index < length; index++) {
- arrayKlass* ak = arrayKlass::cast(h_lower_dimension());
+ ArrayKlass* ak = ArrayKlass::cast(h_lower_dimension());
oop sub_array = ak->multi_allocate(rank-1, &sizes[1], CHECK_NULL);
h_array->obj_at_put(index, sub_array);
}
@@ -235,7 +235,7 @@
}
// Either oop or narrowOop depending on UseCompressedOops.
-template <class T> void objArrayKlass::do_copy(arrayOop s, T* src,
+template <class T> void ObjArrayKlass::do_copy(arrayOop s, T* src,
arrayOop d, T* dst, int length, TRAPS) {
BarrierSet* bs = Universe::heap()->barrier_set();
@@ -252,8 +252,8 @@
Copy::conjoint_oops_atomic(src, dst, length);
} else {
// We have to make sure all elements conform to the destination array
- Klass* bound = objArrayKlass::cast(d->klass())->element_klass();
- Klass* stype = objArrayKlass::cast(s->klass())->element_klass();
+ Klass* bound = ObjArrayKlass::cast(d->klass())->element_klass();
+ Klass* stype = ObjArrayKlass::cast(s->klass())->element_klass();
if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) {
// elements are guaranteed to be subtypes, so no check necessary
bs->write_ref_array_pre(dst, length);
@@ -290,7 +290,7 @@
bs->write_ref_array((HeapWord*)dst, length);
}
-void objArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d,
+void ObjArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d,
int dst_pos, int length, TRAPS) {
assert(s->is_objArray(), "must be obj array");
@@ -327,7 +327,7 @@
}
-Klass* objArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
+Klass* ObjArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
assert(dimension() <= n, "check order of chain");
int dim = dimension();
@@ -348,30 +348,30 @@
// Create multi-dim klass object and link them together
Klass* k =
- objArrayKlass::allocate_objArray_klass(class_loader_data(), dim + 1, this, CHECK_NULL);
- objArrayKlass* ak = objArrayKlass::cast(k);
+ ObjArrayKlass::allocate_objArray_klass(class_loader_data(), dim + 1, this, CHECK_NULL);
+ ObjArrayKlass* ak = ObjArrayKlass::cast(k);
ak->set_lower_dimension(this);
OrderAccess::storestore();
set_higher_dimension(ak);
- assert(ak->oop_is_objArray(), "incorrect initialization of objArrayKlass");
+ assert(ak->oop_is_objArray(), "incorrect initialization of ObjArrayKlass");
}
}
} else {
CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
}
- objArrayKlass *ak = objArrayKlass::cast(higher_dimension());
+ ObjArrayKlass *ak = ObjArrayKlass::cast(higher_dimension());
if (or_null) {
return ak->array_klass_or_null(n);
}
return ak->array_klass(n, CHECK_NULL);
}
-Klass* objArrayKlass::array_klass_impl(bool or_null, TRAPS) {
+Klass* ObjArrayKlass::array_klass_impl(bool or_null, TRAPS) {
return array_klass_impl(or_null, dimension() + 1, CHECK_NULL);
}
-bool objArrayKlass::can_be_primary_super_slow() const {
+bool ObjArrayKlass::can_be_primary_super_slow() const {
if (!bottom_klass()->can_be_primary_super())
// array of interfaces
return false;
@@ -379,7 +379,7 @@
return Klass::can_be_primary_super_slow();
}
-GrowableArray<Klass*>* objArrayKlass::compute_secondary_supers(int num_extra_slots) {
+GrowableArray<Klass*>* ObjArrayKlass::compute_secondary_supers(int num_extra_slots) {
// interfaces = { cloneable_klass, serializable_klass, elemSuper[], ... };
Array<Klass*>* elem_supers = Klass::cast(element_klass())->secondary_supers();
int num_elem_supers = elem_supers == NULL ? 0 : elem_supers->length();
@@ -402,16 +402,16 @@
}
}
-bool objArrayKlass::compute_is_subtype_of(Klass* k) {
+bool ObjArrayKlass::compute_is_subtype_of(Klass* k) {
if (!k->oop_is_objArray())
- return arrayKlass::compute_is_subtype_of(k);
+ return ArrayKlass::compute_is_subtype_of(k);
- objArrayKlass* oak = objArrayKlass::cast(k);
+ ObjArrayKlass* oak = ObjArrayKlass::cast(k);
return element_klass()->is_subtype_of(oak->element_klass());
}
-void objArrayKlass::initialize(TRAPS) {
- Klass::cast(bottom_klass())->initialize(THREAD); // dispatches to either InstanceKlass or typeArrayKlass
+void ObjArrayKlass::initialize(TRAPS) {
+ Klass::cast(bottom_klass())->initialize(THREAD); // dispatches to either InstanceKlass or TypeArrayKlass
}
#define ObjArrayKlass_SPECIALIZED_OOP_ITERATE(T, a, p, do_oop) \
@@ -456,7 +456,7 @@
a, p, low, high, do_oop) \
}
-void objArrayKlass::oop_follow_contents(oop obj) {
+void ObjArrayKlass::oop_follow_contents(oop obj) {
assert (obj->is_array(), "obj must be array");
MarkSweep::follow_klass(obj->klass());
if (UseCompressedOops) {
@@ -467,7 +467,7 @@
}
#ifndef SERIALGC
-void objArrayKlass::oop_follow_contents(ParCompactionManager* cm,
+void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm,
oop obj) {
assert(obj->is_array(), "obj must be array");
PSParallelCompact::follow_klass(cm, obj->klass());
@@ -487,7 +487,7 @@
#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\
-int objArrayKlass::oop_oop_iterate##nv_suffix(oop obj, \
+int ObjArrayKlass::oop_oop_iterate##nv_suffix(oop obj, \
OopClosureType* closure) { \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
assert (obj->is_array(), "obj must be array"); \
@@ -504,7 +504,7 @@
#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN_m(OopClosureType, nv_suffix) \
\
-int objArrayKlass::oop_oop_iterate##nv_suffix##_m(oop obj, \
+int ObjArrayKlass::oop_oop_iterate##nv_suffix##_m(oop obj, \
OopClosureType* closure, \
MemRegion mr) { \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
@@ -526,7 +526,7 @@
// for objArrayOops.
#define ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r(OopClosureType, nv_suffix) \
\
-int objArrayKlass::oop_oop_iterate_range##nv_suffix(oop obj, \
+int ObjArrayKlass::oop_oop_iterate_range##nv_suffix(oop obj, \
OopClosureType* closure, \
int start, int end) { \
SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::oa); \
@@ -567,7 +567,7 @@
ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r)
ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayKlass_OOP_OOP_ITERATE_DEFN_r)
-int objArrayKlass::oop_adjust_pointers(oop obj) {
+int ObjArrayKlass::oop_adjust_pointers(oop obj) {
assert(obj->is_objArray(), "obj must be obj array");
objArrayOop a = objArrayOop(obj);
// Get size before changing pointers.
@@ -579,7 +579,7 @@
}
#ifndef SERIALGC
-void objArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
+void ObjArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
assert(obj->is_objArray(), "obj must be obj array");
ObjArrayKlass_OOP_ITERATE( \
objArrayOop(obj), p, \
@@ -588,7 +588,7 @@
})
}
-int objArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
+int ObjArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
assert (obj->is_objArray(), "obj must be obj array");
objArrayOop a = objArrayOop(obj);
int size = a->object_size();
@@ -600,7 +600,7 @@
// JVM support
-jint objArrayKlass::compute_modifier_flags(TRAPS) const {
+jint ObjArrayKlass::compute_modifier_flags(TRAPS) const {
// The modifier for an objectArray is the same as its element
if (element_klass() == NULL) {
assert(Universe::is_bootstrapping(), "partial objArray only at startup");
@@ -616,7 +616,7 @@
// Printing
-void objArrayKlass::print_on(outputStream* st) const {
+void ObjArrayKlass::print_on(outputStream* st) const {
#ifndef PRODUCT
Klass::print_on(st);
st->print(" - instance klass: ");
@@ -625,7 +625,7 @@
#endif //PRODUCT
}
-void objArrayKlass::print_value_on(outputStream* st) const {
+void ObjArrayKlass::print_value_on(outputStream* st) const {
assert(is_klass(), "must be klass");
element_klass()->print_value_on(st);
@@ -634,8 +634,8 @@
#ifndef PRODUCT
-void objArrayKlass::oop_print_on(oop obj, outputStream* st) {
- arrayKlass::oop_print_on(obj, st);
+void ObjArrayKlass::oop_print_on(oop obj, outputStream* st) {
+ ArrayKlass::oop_print_on(obj, st);
assert(obj->is_objArray(), "must be objArray");
objArrayOop oa = objArrayOop(obj);
int print_len = MIN2((intx) oa->length(), MaxElementPrintSize);
@@ -654,7 +654,7 @@
static int max_objArray_print_length = 4;
-void objArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
+void ObjArrayKlass::oop_print_value_on(oop obj, outputStream* st) {
assert(obj->is_objArray(), "must be objArray");
st->print("a ");
element_klass()->print_value_on(st);
@@ -673,15 +673,15 @@
}
}
-const char* objArrayKlass::internal_name() const {
+const char* ObjArrayKlass::internal_name() const {
return external_name();
}
// Verification
-void objArrayKlass::verify_on(outputStream* st) {
- arrayKlass::verify_on(st);
+void ObjArrayKlass::verify_on(outputStream* st) {
+ ArrayKlass::verify_on(st);
guarantee(element_klass()->is_metadata(), "should be in metaspace");
guarantee(element_klass()->is_klass(), "should be klass");
guarantee(bottom_klass()->is_metadata(), "should be in metaspace");
@@ -690,8 +690,8 @@
guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass");
}
-void objArrayKlass::oop_verify_on(oop obj, outputStream* st) {
- arrayKlass::oop_verify_on(obj, st);
+void ObjArrayKlass::oop_verify_on(oop obj, outputStream* st) {
+ ArrayKlass::oop_verify_on(obj, st);
guarantee(obj->is_objArray(), "must be objArray");
objArrayOop oa = objArrayOop(obj);
for(int index = 0; index < oa->length(); index++) {
--- a/hotspot/src/share/vm/oops/objArrayKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -29,20 +29,20 @@
#include "memory/specialized_oop_closures.hpp"
#include "oops/arrayKlass.hpp"
-// objArrayKlass is the klass for objArrays
+// ObjArrayKlass is the klass for objArrays
-class objArrayKlass : public arrayKlass {
+class ObjArrayKlass : public ArrayKlass {
friend class VMStructs;
private:
Klass* _element_klass; // The klass of the elements of this array type
- Klass* _bottom_klass; // The one-dimensional type (InstanceKlass or typeArrayKlass)
+ Klass* _bottom_klass; // The one-dimensional type (InstanceKlass or TypeArrayKlass)
// Constructor
- objArrayKlass(int n, KlassHandle element_klass, Symbol* name);
- static objArrayKlass* allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS);
+ ObjArrayKlass(int n, KlassHandle element_klass, Symbol* name);
+ static ObjArrayKlass* allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS);
public:
// For dummy objects
- objArrayKlass() {}
+ ObjArrayKlass() {}
// Instance variables
Klass* element_klass() const { return _element_klass; }
@@ -54,7 +54,7 @@
Klass** bottom_klass_addr() { return &_bottom_klass; }
// Compiler/Interpreter offset
- static ByteSize element_klass_offset() { return in_ByteSize(offset_of(objArrayKlass, _element_klass)); }
+ static ByteSize element_klass_offset() { return in_ByteSize(offset_of(ObjArrayKlass, _element_klass)); }
// Dispatched operation
bool can_be_primary_super_slow() const;
@@ -78,11 +78,11 @@
private:
// Either oop or narrowOop depending on UseCompressedOops.
- // must be called from within objArrayKlass.cpp
+ // must be called from within ObjArrayKlass.cpp
template <class T> void do_copy(arrayOop s, T* src, arrayOop d,
T* dst, int length, TRAPS);
protected:
- // Returns the objArrayKlass for n'th dimension.
+ // Returns the ObjArrayKlass for n'th dimension.
virtual Klass* array_klass_impl(bool or_null, int n, TRAPS);
// Returns the array class with this class as element type.
@@ -90,14 +90,14 @@
public:
// Casting from Klass*
- static objArrayKlass* cast(Klass* k) {
- assert(k->oop_is_objArray(), "cast to objArrayKlass");
- return (objArrayKlass*) k;
+ static ObjArrayKlass* cast(Klass* k) {
+ assert(k->oop_is_objArray(), "cast to ObjArrayKlass");
+ return (ObjArrayKlass*) k;
}
// Sizing
- static int header_size() { return sizeof(objArrayKlass)/HeapWordSize; }
- int size() const { return arrayKlass::static_size(header_size()); }
+ static int header_size() { return sizeof(ObjArrayKlass)/HeapWordSize; }
+ int size() const { return ArrayKlass::static_size(header_size()); }
// Initialization (virtual from Klass)
void initialize(TRAPS);
--- a/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/objArrayKlass.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -32,7 +32,7 @@
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
#endif
-void objArrayKlass::oop_follow_contents(oop obj, int index) {
+void ObjArrayKlass::oop_follow_contents(oop obj, int index) {
if (UseCompressedOops) {
objarray_follow_contents<narrowOop>(obj, index);
} else {
@@ -41,7 +41,7 @@
}
template <class T>
-void objArrayKlass::objarray_follow_contents(oop obj, int index) {
+void ObjArrayKlass::objarray_follow_contents(oop obj, int index) {
objArrayOop a = objArrayOop(obj);
const size_t len = size_t(a->length());
const size_t beg_index = size_t(index);
@@ -64,7 +64,7 @@
}
#ifndef SERIALGC
-void objArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj,
+void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj,
int index) {
if (UseCompressedOops) {
objarray_follow_contents<narrowOop>(cm, obj, index);
@@ -74,7 +74,7 @@
}
template <class T>
-void objArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj,
+void ObjArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj,
int index) {
objArrayOop a = objArrayOop(obj);
const size_t len = size_t(a->length());
--- a/hotspot/src/share/vm/oops/objArrayOop.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/objArrayOop.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -31,7 +31,7 @@
\
int objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { \
SpecializationStats::record_call(); \
- return ((objArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \
+ return ((ObjArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \
}
ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayOop_OOP_ITERATE_DEFN)
--- a/hotspot/src/share/vm/oops/objArrayOop.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/objArrayOop.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -31,7 +31,7 @@
// Evaluating "String arg[10]" will create an objArrayOop.
class objArrayOopDesc : public arrayOopDesc {
- friend class objArrayKlass;
+ friend class ObjArrayKlass;
friend class Runtime1;
friend class psPromotionManager;
friend class CSetMarkOopClosure;
--- a/hotspot/src/share/vm/oops/oop.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -185,8 +185,8 @@
inline bool check_obj_alignment(oop obj) {
return (intptr_t)obj % MinObjAlignmentInBytes == 0;
}
-inline bool check_obj_alignment(Klass* obj) {
- return (intptr_t)obj % MinObjAlignmentInBytes == 0;
+inline bool check_klass_alignment(Klass* obj) {
+ return (intptr_t)obj % KlassAlignmentInBytes == 0;
}
inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) {
@@ -228,9 +228,9 @@
inline narrowOop oopDesc::encode_klass_not_null(Klass* v) {
assert(!is_null(v), "oop value can never be zero");
- assert(check_obj_alignment(v), "Address not aligned");
- address base = Universe::narrow_oop_base();
- int shift = Universe::narrow_oop_shift();
+ assert(check_klass_alignment(v), "Address not aligned");
+ address base = Universe::narrow_klass_base();
+ int shift = Universe::narrow_klass_shift();
uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1));
assert(OopEncodingHeapMax > pd, "change encoding max if new encoding");
uint64_t result = pd >> shift;
@@ -245,10 +245,10 @@
inline Klass* oopDesc::decode_klass_not_null(narrowOop v) {
assert(!is_null(v), "narrow oop value can never be zero");
- address base = Universe::narrow_oop_base();
- int shift = Universe::narrow_oop_shift();
+ address base = Universe::narrow_klass_base();
+ int shift = Universe::narrow_klass_shift();
Klass* result = (Klass*)(void*)((uintptr_t)base + ((uintptr_t)v << shift));
- assert(check_obj_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result));
+ assert(check_klass_alignment(result), err_msg("address not aligned: " PTR_FORMAT, (void*) result));
return result;
}
--- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -44,7 +44,7 @@
// It might contain oops beyond the header, so take the virtual call.
new_klass->oop_update_pointers(cm, this);
}
- // Else skip it. The typeArrayKlass in the header never needs scavenging.
+ // Else skip it. The TypeArrayKlass in the header never needs scavenging.
}
inline void oopDesc::follow_contents(ParCompactionManager* cm) {
--- a/hotspot/src/share/vm/oops/oop.psgc.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/oop.psgc.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -39,7 +39,7 @@
// It might contain oops beyond the header, so take the virtual call.
k->oop_push_contents(pm, this);
}
- // Else skip it. The typeArrayKlass in the header never needs scavenging.
+ // Else skip it. The TypeArrayKlass in the header never needs scavenging.
}
#endif // SHARE_VM_OOPS_OOP_PSGC_INLINE_HPP
--- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -128,7 +128,7 @@
#endif
// from parNewGeneration and other things that want to get to the end of
- // an oop for stuff (like objArrayKlass.cpp)
+ // an oop for stuff (like ObjArrayKlass.cpp)
operator oop* () const { return (oop *)obj(); }
};
@@ -172,8 +172,8 @@
class InstanceMirrorKlass;
class InstanceClassLoaderKlass;
class InstanceRefKlass;
-class arrayKlass;
-class objArrayKlass;
-class typeArrayKlass;
+class ArrayKlass;
+class ObjArrayKlass;
+class TypeArrayKlass;
#endif // SHARE_VM_OOPS_OOPSHIERARCHY_HPP
--- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -40,18 +40,18 @@
#include "oops/typeArrayOop.hpp"
#include "runtime/handles.inline.hpp"
-bool typeArrayKlass::compute_is_subtype_of(Klass* k) {
+bool TypeArrayKlass::compute_is_subtype_of(Klass* k) {
if (!k->oop_is_typeArray()) {
- return arrayKlass::compute_is_subtype_of(k);
+ return ArrayKlass::compute_is_subtype_of(k);
}
- typeArrayKlass* tak = typeArrayKlass::cast(k);
+ TypeArrayKlass* tak = TypeArrayKlass::cast(k);
if (dimension() != tak->dimension()) return false;
return element_type() == tak->element_type();
}
-typeArrayKlass* typeArrayKlass::create_klass(BasicType type,
+TypeArrayKlass* TypeArrayKlass::create_klass(BasicType type,
const char* name_str, TRAPS) {
Symbol* sym = NULL;
if (name_str != NULL) {
@@ -60,7 +60,7 @@
ClassLoaderData* null_loader_data = ClassLoaderData::the_null_class_loader_data();
- typeArrayKlass* ak = typeArrayKlass::allocate(null_loader_data, type, sym, CHECK_NULL);
+ TypeArrayKlass* ak = TypeArrayKlass::allocate(null_loader_data, type, sym, CHECK_NULL);
// Add all classes to our internal class loader list here,
// including classes in the bootstrap (NULL) class loader.
@@ -73,27 +73,27 @@
return ak;
}
-typeArrayKlass* typeArrayKlass::allocate(ClassLoaderData* loader_data, BasicType type, Symbol* name, TRAPS) {
- assert(typeArrayKlass::header_size() <= InstanceKlass::header_size(),
+TypeArrayKlass* TypeArrayKlass::allocate(ClassLoaderData* loader_data, BasicType type, Symbol* name, TRAPS) {
+ assert(TypeArrayKlass::header_size() <= InstanceKlass::header_size(),
"array klasses must be same size as InstanceKlass");
- int size = arrayKlass::static_size(typeArrayKlass::header_size());
+ int size = ArrayKlass::static_size(TypeArrayKlass::header_size());
- return new (loader_data, size, THREAD) typeArrayKlass(type, name);
+ return new (loader_data, size, THREAD) TypeArrayKlass(type, name);
}
-typeArrayKlass::typeArrayKlass(BasicType type, Symbol* name) : arrayKlass(name) {
+TypeArrayKlass::TypeArrayKlass(BasicType type, Symbol* name) : ArrayKlass(name) {
set_layout_helper(array_layout_helper(type));
assert(oop_is_array(), "sanity");
assert(oop_is_typeArray(), "sanity");
set_max_length(arrayOopDesc::max_array_length(type));
- assert(size() >= typeArrayKlass::header_size(), "bad size");
+ assert(size() >= TypeArrayKlass::header_size(), "bad size");
set_class_loader_data(ClassLoaderData::the_null_class_loader_data());
}
-typeArrayOop typeArrayKlass::allocate_common(int length, bool do_zero, TRAPS) {
+typeArrayOop TypeArrayKlass::allocate_common(int length, bool do_zero, TRAPS) {
assert(log2_element_size() >= 0, "bad scale");
if (length >= 0) {
if (length <= max_length()) {
@@ -117,7 +117,7 @@
}
}
-oop typeArrayKlass::multi_allocate(int rank, jint* last_size, TRAPS) {
+oop TypeArrayKlass::multi_allocate(int rank, jint* last_size, TRAPS) {
// For typeArrays this is only called for the last dimension
assert(rank == 1, "just checking");
int length = *last_size;
@@ -125,11 +125,11 @@
}
-void typeArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS) {
+void TypeArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS) {
assert(s->is_typeArray(), "must be type array");
// Check destination
- if (!d->is_typeArray() || element_type() != typeArrayKlass::cast(d->klass())->element_type()) {
+ if (!d->is_typeArray() || element_type() != TypeArrayKlass::cast(d->klass())->element_type()) {
THROW(vmSymbols::java_lang_ArrayStoreException());
}
@@ -156,7 +156,7 @@
// create a klass of array holding typeArrays
-Klass* typeArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
+Klass* TypeArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
int dim = dimension();
assert(dim <= n, "check order of chain");
if (dim == n)
@@ -173,92 +173,92 @@
MutexLocker mu(MultiArray_lock, THREAD);
if (higher_dimension() == NULL) {
- Klass* oak = objArrayKlass::allocate_objArray_klass(
+ Klass* oak = ObjArrayKlass::allocate_objArray_klass(
class_loader_data(), dim + 1, this, CHECK_NULL);
- objArrayKlass* h_ak = objArrayKlass::cast(oak);
+ ObjArrayKlass* h_ak = ObjArrayKlass::cast(oak);
h_ak->set_lower_dimension(this);
OrderAccess::storestore();
set_higher_dimension(h_ak);
- assert(h_ak->oop_is_objArray(), "incorrect initialization of objArrayKlass");
+ assert(h_ak->oop_is_objArray(), "incorrect initialization of ObjArrayKlass");
}
}
} else {
CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
}
- objArrayKlass* h_ak = objArrayKlass::cast(higher_dimension());
+ ObjArrayKlass* h_ak = ObjArrayKlass::cast(higher_dimension());
if (or_null) {
return h_ak->array_klass_or_null(n);
}
return h_ak->array_klass(n, CHECK_NULL);
}
-Klass* typeArrayKlass::array_klass_impl(bool or_null, TRAPS) {
+Klass* TypeArrayKlass::array_klass_impl(bool or_null, TRAPS) {
return array_klass_impl(or_null, dimension() + 1, THREAD);
}
-int typeArrayKlass::oop_size(oop obj) const {
+int TypeArrayKlass::oop_size(oop obj) const {
assert(obj->is_typeArray(),"must be a type array");
typeArrayOop t = typeArrayOop(obj);
return t->object_size();
}
-void typeArrayKlass::oop_follow_contents(oop obj) {
+void TypeArrayKlass::oop_follow_contents(oop obj) {
assert(obj->is_typeArray(),"must be a type array");
// Performance tweak: We skip iterating over the klass pointer since we
- // know that Universe::typeArrayKlass never moves.
+ // know that Universe::TypeArrayKlass never moves.
}
#ifndef SERIALGC
-void typeArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) {
+void TypeArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) {
assert(obj->is_typeArray(),"must be a type array");
// Performance tweak: We skip iterating over the klass pointer since we
- // know that Universe::typeArrayKlass never moves.
+ // know that Universe::TypeArrayKlass never moves.
}
#endif // SERIALGC
-int typeArrayKlass::oop_adjust_pointers(oop obj) {
+int TypeArrayKlass::oop_adjust_pointers(oop obj) {
assert(obj->is_typeArray(),"must be a type array");
typeArrayOop t = typeArrayOop(obj);
// Performance tweak: We skip iterating over the klass pointer since we
- // know that Universe::typeArrayKlass never moves.
+ // know that Universe::TypeArrayKlass never moves.
return t->object_size();
}
-int typeArrayKlass::oop_oop_iterate(oop obj, ExtendedOopClosure* blk) {
+int TypeArrayKlass::oop_oop_iterate(oop obj, ExtendedOopClosure* blk) {
assert(obj->is_typeArray(),"must be a type array");
typeArrayOop t = typeArrayOop(obj);
// Performance tweak: We skip iterating over the klass pointer since we
- // know that Universe::typeArrayKlass never moves.
+ // know that Universe::TypeArrayKlass never moves.
return t->object_size();
}
-int typeArrayKlass::oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) {
+int TypeArrayKlass::oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) {
assert(obj->is_typeArray(),"must be a type array");
typeArrayOop t = typeArrayOop(obj);
// Performance tweak: We skip iterating over the klass pointer since we
- // know that Universe::typeArrayKlass never moves.
+ // know that Universe::TypeArrayKlass never moves.
return t->object_size();
}
#ifndef SERIALGC
-void typeArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
+void TypeArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
ShouldNotReachHere();
assert(obj->is_typeArray(),"must be a type array");
}
int
-typeArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
+TypeArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
assert(obj->is_typeArray(),"must be a type array");
return typeArrayOop(obj)->object_size();
}
#endif // SERIALGC
-void typeArrayKlass::initialize(TRAPS) {
+void TypeArrayKlass::initialize(TRAPS) {
// Nothing to do. Having this function is handy since objArrayKlasses can be
- // initialized by calling initialize on their bottom_klass, see objArrayKlass::initialize
+ // initialized by calling initialize on their bottom_klass, see ObjArrayKlass::initialize
}
-const char* typeArrayKlass::external_name(BasicType type) {
+const char* TypeArrayKlass::external_name(BasicType type) {
switch (type) {
case T_BOOLEAN: return "[Z";
case T_CHAR: return "[C";
@@ -276,7 +276,7 @@
// Printing
-void typeArrayKlass::print_on(outputStream* st) const {
+void TypeArrayKlass::print_on(outputStream* st) const {
#ifndef PRODUCT
assert(is_klass(), "must be klass");
print_value_on(st);
@@ -284,7 +284,7 @@
#endif //PRODUCT
}
-void typeArrayKlass::print_value_on(outputStream* st) const {
+void TypeArrayKlass::print_value_on(outputStream* st) const {
assert(is_klass(), "must be klass");
st->print("{type array ");
switch (element_type()) {
@@ -364,8 +364,8 @@
}
-void typeArrayKlass::oop_print_on(oop obj, outputStream* st) {
- arrayKlass::oop_print_on(obj, st);
+void TypeArrayKlass::oop_print_on(oop obj, outputStream* st) {
+ ArrayKlass::oop_print_on(obj, st);
typeArrayOop ta = typeArrayOop(obj);
int print_len = MIN2((intx) ta->length(), MaxElementPrintSize);
switch (element_type()) {
@@ -387,6 +387,6 @@
#endif // PRODUCT
-const char* typeArrayKlass::internal_name() const {
+const char* TypeArrayKlass::internal_name() const {
return Klass::external_name();
}
--- a/hotspot/src/share/vm/oops/typeArrayKlass.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/typeArrayKlass.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -28,19 +28,19 @@
#include "classfile/classLoaderData.hpp"
#include "oops/arrayKlass.hpp"
-// A typeArrayKlass is the klass of a typeArray
+// A TypeArrayKlass is the klass of a typeArray
// It contains the type and size of the elements
-class typeArrayKlass : public arrayKlass {
+class TypeArrayKlass : public ArrayKlass {
friend class VMStructs;
private:
jint _max_length; // maximum number of elements allowed in an array
// Constructor
- typeArrayKlass(BasicType type, Symbol* name);
- static typeArrayKlass* allocate(ClassLoaderData* loader_data, BasicType type, Symbol* name, TRAPS);
+ TypeArrayKlass(BasicType type, Symbol* name);
+ static TypeArrayKlass* allocate(ClassLoaderData* loader_data, BasicType type, Symbol* name, TRAPS);
public:
- typeArrayKlass() {} // For dummy objects.
+ TypeArrayKlass() {} // For dummy objects.
// instance variables
jint max_length() { return _max_length; }
@@ -50,10 +50,10 @@
bool oop_is_typeArray_slow() const { return true; }
// klass allocation
- static typeArrayKlass* create_klass(BasicType type, const char* name_str,
+ static TypeArrayKlass* create_klass(BasicType type, const char* name_str,
TRAPS);
static inline Klass* create_klass(BasicType type, int scale, TRAPS) {
- typeArrayKlass* tak = create_klass(type, external_name(type), CHECK_NULL);
+ TypeArrayKlass* tak = create_klass(type, external_name(type), CHECK_NULL);
assert(scale == (1 << tak->log2_element_size()), "scale must check out");
return tak;
}
@@ -90,17 +90,17 @@
public:
// Casting from Klass*
- static typeArrayKlass* cast(Klass* k) {
- assert(k->oop_is_typeArray(), "cast to typeArrayKlass");
- return (typeArrayKlass*) k;
+ static TypeArrayKlass* cast(Klass* k) {
+ assert(k->oop_is_typeArray(), "cast to TypeArrayKlass");
+ return (TypeArrayKlass*) k;
}
// Naming
static const char* external_name(BasicType type);
// Sizing
- static int header_size() { return sizeof(typeArrayKlass)/HeapWordSize; }
- int size() const { return arrayKlass::static_size(header_size()); }
+ static int header_size() { return sizeof(TypeArrayKlass)/HeapWordSize; }
+ int size() const { return ArrayKlass::static_size(header_size()); }
// Initialization (virtual from Klass)
void initialize(TRAPS);
--- a/hotspot/src/share/vm/oops/typeArrayOop.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/oops/typeArrayOop.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -73,7 +73,7 @@
jfloat* float_base() const { return (jfloat*) base(T_FLOAT); }
jdouble* double_base() const { return (jdouble*) base(T_DOUBLE); }
- friend class typeArrayKlass;
+ friend class TypeArrayKlass;
public:
jbyte* byte_at_addr(int which) const {
@@ -190,7 +190,7 @@
public:
int object_size() {
- typeArrayKlass* tk = typeArrayKlass::cast(klass());
+ TypeArrayKlass* tk = TypeArrayKlass::cast(klass());
return object_size(tk->layout_helper(), length());
}
};
--- a/hotspot/src/share/vm/opto/addnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/addnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/block.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/block.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/block.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/block.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -439,9 +439,7 @@
WarmCallInfo wci = *(initial_wci);
failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, &wci);
if (failure_msg != NULL && C->log() != NULL) {
- C->log()->begin_elem("inline_fail reason='");
- C->log()->text("%s", failure_msg);
- C->log()->end_elem("'");
+ C->log()->inline_fail(failure_msg);
}
#ifndef PRODUCT
--- a/hotspot/src/share/vm/opto/callGenerator.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/callGenerator.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/opto/cfgnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1386,7 +1386,7 @@
Node *n = phi->in(i);
if( !n ) return NULL;
if( phase->type(n) == Type::TOP ) return NULL;
- if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN )
+ if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN || n->Opcode() == Op_ConNKlass )
break;
}
if( i >= phi->req() ) // Only split for constants
@@ -1875,17 +1875,19 @@
}
#ifdef _LP64
- // Push DecodeN down through phi.
+ // Push DecodeN/DecodeNKlass down through phi.
// The rest of phi graph will transform by split EncodeP node though phis up.
- if (UseCompressedOops && can_reshape && progress == NULL) {
+ if ((UseCompressedOops || UseCompressedKlassPointers) && can_reshape && progress == NULL) {
bool may_push = true;
bool has_decodeN = false;
+ bool is_decodeN = false;
for (uint i=1; i<req(); ++i) {// For all paths in
Node *ii = in(i);
- if (ii->is_DecodeN() && ii->bottom_type() == bottom_type()) {
+ if (ii->is_DecodeNarrowPtr() && ii->bottom_type() == bottom_type()) {
// Do optimization if a non dead path exist.
if (ii->in(1)->bottom_type() != Type::TOP) {
has_decodeN = true;
+ is_decodeN = ii->is_DecodeN();
}
} else if (!ii->is_Phi()) {
may_push = false;
@@ -1895,13 +1897,18 @@
if (has_decodeN && may_push) {
PhaseIterGVN *igvn = phase->is_IterGVN();
// Make narrow type for new phi.
- const Type* narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr());
+ const Type* narrow_t;
+ if (is_decodeN) {
+ narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr());
+ } else {
+ narrow_t = TypeNarrowKlass::make(this->bottom_type()->is_ptr());
+ }
PhiNode* new_phi = new (phase->C) PhiNode(r, narrow_t);
uint orig_cnt = req();
for (uint i=1; i<req(); ++i) {// For all paths in
Node *ii = in(i);
Node* new_ii = NULL;
- if (ii->is_DecodeN()) {
+ if (ii->is_DecodeNarrowPtr()) {
assert(ii->bottom_type() == bottom_type(), "sanity");
new_ii = ii->in(1);
} else {
@@ -1909,14 +1916,22 @@
if (ii->as_Phi() == this) {
new_ii = new_phi;
} else {
- new_ii = new (phase->C) EncodePNode(ii, narrow_t);
+ if (is_decodeN) {
+ new_ii = new (phase->C) EncodePNode(ii, narrow_t);
+ } else {
+ new_ii = new (phase->C) EncodePKlassNode(ii, narrow_t);
+ }
igvn->register_new_node_with_optimizer(new_ii);
}
}
new_phi->set_req(i, new_ii);
}
igvn->register_new_node_with_optimizer(new_phi, this);
- progress = new (phase->C) DecodeNNode(new_phi, bottom_type());
+ if (is_decodeN) {
+ progress = new (phase->C) DecodeNNode(new_phi, bottom_type());
+ } else {
+ progress = new (phase->C) DecodeNKlassNode(new_phi, bottom_type());
+ }
}
}
#endif
--- a/hotspot/src/share/vm/opto/classes.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/classes.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -91,6 +91,7 @@
macro(GetAndSetN)
macro(Con)
macro(ConN)
+macro(ConNKlass)
macro(ConD)
macro(ConF)
macro(ConI)
@@ -118,6 +119,7 @@
macro(CountTrailingZerosL)
macro(CreateEx)
macro(DecodeN)
+macro(DecodeNKlass)
macro(DivD)
macro(DivF)
macro(DivI)
@@ -126,6 +128,7 @@
macro(DivModI)
macro(DivModL)
macro(EncodeP)
+macro(EncodePKlass)
macro(ExpD)
macro(FastLock)
macro(FastUnlock)
@@ -147,7 +150,6 @@
macro(LoadD_unaligned)
macro(LoadF)
macro(LoadI)
-macro(LoadUI2L)
macro(LoadKlass)
macro(LoadNKlass)
macro(LoadL)
@@ -233,6 +235,7 @@
macro(StoreL)
macro(StoreP)
macro(StoreN)
+macro(StoreNKlass)
macro(StrComp)
macro(StrEquals)
macro(StrIndexOf)
--- a/hotspot/src/share/vm/opto/compile.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -828,6 +828,9 @@
has_unsafe_access(),
SharedRuntime::is_wide_vector(max_vector_size())
);
+
+ if (log() != NULL) // Print code cache state into compiler log
+ log()->code_cache_state();
}
}
@@ -2236,6 +2239,7 @@
nop != Op_CreateEx &&
nop != Op_CheckCastPP &&
nop != Op_DecodeN &&
+ nop != Op_DecodeNKlass &&
!n->is_Mem() ) {
Node *x = n->clone();
call->set_req( TypeFunc::Parms, x );
@@ -2284,11 +2288,11 @@
case Op_GetAndSetN:
case Op_StoreP:
case Op_StoreN:
+ case Op_StoreNKlass:
case Op_LoadB:
case Op_LoadUB:
case Op_LoadUS:
case Op_LoadI:
- case Op_LoadUI2L:
case Op_LoadKlass:
case Op_LoadNKlass:
case Op_LoadL:
@@ -2318,7 +2322,7 @@
addp->in(AddPNode::Base) == n->in(AddPNode::Base),
"Base pointers must match" );
#ifdef _LP64
- if (UseCompressedOops &&
+ if ((UseCompressedOops || UseCompressedKlassPointers) &&
addp->Opcode() == Op_ConP &&
addp == n->in(AddPNode::Base) &&
n->in(AddPNode::Offset)->is_Con()) {
@@ -2327,16 +2331,18 @@
// instructions (4) then load 64-bits constant (7).
// Do this transformation here since IGVN will convert ConN back to ConP.
const Type* t = addp->bottom_type();
- if (t->isa_oopptr()) {
+ if (t->isa_oopptr() || t->isa_klassptr()) {
Node* nn = NULL;
+ int op = t->isa_oopptr() ? Op_ConN : Op_ConNKlass;
+
// Look for existing ConN node of the same exact type.
Compile* C = Compile::current();
Node* r = C->root();
uint cnt = r->outcnt();
for (uint i = 0; i < cnt; i++) {
Node* m = r->raw_out(i);
- if (m!= NULL && m->Opcode() == Op_ConN &&
+ if (m!= NULL && m->Opcode() == op &&
m->bottom_type()->make_ptr() == t) {
nn = m;
break;
@@ -2345,7 +2351,11 @@
if (nn != NULL) {
// Decode a narrow oop to match address
// [R12 + narrow_oop_reg<<3 + offset]
- nn = new (C) DecodeNNode(nn, t);
+ if (t->isa_oopptr()) {
+ nn = new (C) DecodeNNode(nn, t);
+ } else {
+ nn = new (C) DecodeNKlassNode(nn, t);
+ }
n->set_req(AddPNode::Base, nn);
n->set_req(AddPNode::Address, nn);
if (addp->outcnt() == 0) {
@@ -2400,22 +2410,24 @@
case Op_CmpP:
// Do this transformation here to preserve CmpPNode::sub() and
// other TypePtr related Ideal optimizations (for example, ptr nullness).
- if (n->in(1)->is_DecodeN() || n->in(2)->is_DecodeN()) {
+ if (n->in(1)->is_DecodeNarrowPtr() || n->in(2)->is_DecodeNarrowPtr()) {
Node* in1 = n->in(1);
Node* in2 = n->in(2);
- if (!in1->is_DecodeN()) {
+ if (!in1->is_DecodeNarrowPtr()) {
in2 = in1;
in1 = n->in(2);
}
- assert(in1->is_DecodeN(), "sanity");
+ assert(in1->is_DecodeNarrowPtr(), "sanity");
Compile* C = Compile::current();
Node* new_in2 = NULL;
- if (in2->is_DecodeN()) {
+ if (in2->is_DecodeNarrowPtr()) {
+ assert(in2->Opcode() == in1->Opcode(), "must be same node type");
new_in2 = in2->in(1);
} else if (in2->Opcode() == Op_ConP) {
const Type* t = in2->bottom_type();
if (t == TypePtr::NULL_PTR) {
+ assert(in1->is_DecodeN(), "compare klass to null?");
// Don't convert CmpP null check into CmpN if compressed
// oops implicit null check is not generated.
// This will allow to generate normal oop implicit null check.
@@ -2460,6 +2472,8 @@
//
} else if (t->isa_oopptr()) {
new_in2 = ConNode::make(C, t->make_narrowoop());
+ } else if (t->isa_klassptr()) {
+ new_in2 = ConNode::make(C, t->make_narrowklass());
}
}
if (new_in2 != NULL) {
@@ -2476,23 +2490,28 @@
break;
case Op_DecodeN:
- assert(!n->in(1)->is_EncodeP(), "should be optimized out");
+ case Op_DecodeNKlass:
+ assert(!n->in(1)->is_EncodeNarrowPtr(), "should be optimized out");
// DecodeN could be pinned when it can't be fold into
// an address expression, see the code for Op_CastPP above.
- assert(n->in(0) == NULL || !Matcher::narrow_oop_use_complex_address(), "no control");
+ assert(n->in(0) == NULL || (UseCompressedOops && !Matcher::narrow_oop_use_complex_address()), "no control");
break;
- case Op_EncodeP: {
+ case Op_EncodeP:
+ case Op_EncodePKlass: {
Node* in1 = n->in(1);
- if (in1->is_DecodeN()) {
+ if (in1->is_DecodeNarrowPtr()) {
n->subsume_by(in1->in(1));
} else if (in1->Opcode() == Op_ConP) {
Compile* C = Compile::current();
const Type* t = in1->bottom_type();
if (t == TypePtr::NULL_PTR) {
+ assert(t->isa_oopptr(), "null klass?");
n->subsume_by(ConNode::make(C, TypeNarrowOop::NULL_PTR));
} else if (t->isa_oopptr()) {
n->subsume_by(ConNode::make(C, t->make_narrowoop()));
+ } else if (t->isa_klassptr()) {
+ n->subsume_by(ConNode::make(C, t->make_narrowklass()));
}
}
if (in1->outcnt() == 0) {
@@ -2526,7 +2545,7 @@
}
case Op_Phi:
- if (n->as_Phi()->bottom_type()->isa_narrowoop()) {
+ if (n->as_Phi()->bottom_type()->isa_narrowoop() || n->as_Phi()->bottom_type()->isa_narrowklass()) {
// The EncodeP optimization may create Phi with the same edges
// for all paths. It is not handled well by Register Allocator.
Node* unique_in = n->in(1);
@@ -2689,12 +2708,13 @@
}
// Skip next transformation if compressed oops are not used.
- if (!UseCompressedOops || !Matcher::gen_narrow_oop_implicit_null_checks())
+ if ((UseCompressedOops && !Matcher::gen_narrow_oop_implicit_null_checks()) ||
+ (!UseCompressedOops && !UseCompressedKlassPointers))
return;
- // Go over safepoints nodes to skip DecodeN nodes for debug edges.
+ // Go over safepoints nodes to skip DecodeN/DecodeNKlass nodes for debug edges.
// It could be done for an uncommon traps or any safepoints/calls
- // if the DecodeN node is referenced only in a debug info.
+ // if the DecodeN/DecodeNKlass node is referenced only in a debug info.
while (sfpt.size() > 0) {
n = sfpt.pop();
JVMState *jvms = n->as_SafePoint()->jvms();
@@ -2705,7 +2725,7 @@
n->as_CallStaticJava()->uncommon_trap_request() != 0);
for (int j = start; j < end; j++) {
Node* in = n->in(j);
- if (in->is_DecodeN()) {
+ if (in->is_DecodeNarrowPtr()) {
bool safe_to_skip = true;
if (!is_uncommon ) {
// Is it safe to skip?
--- a/hotspot/src/share/vm/opto/connode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/connode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -45,16 +45,17 @@
//------------------------------make-------------------------------------------
ConNode *ConNode::make( Compile* C, const Type *t ) {
switch( t->basic_type() ) {
- case T_INT: return new (C) ConINode( t->is_int() );
- case T_LONG: return new (C) ConLNode( t->is_long() );
- case T_FLOAT: return new (C) ConFNode( t->is_float_constant() );
- case T_DOUBLE: return new (C) ConDNode( t->is_double_constant() );
- case T_VOID: return new (C) ConNode ( Type::TOP );
- case T_OBJECT: return new (C) ConPNode( t->is_ptr() );
- case T_ARRAY: return new (C) ConPNode( t->is_aryptr() );
- case T_ADDRESS: return new (C) ConPNode( t->is_ptr() );
- case T_NARROWOOP: return new (C) ConNNode( t->is_narrowoop() );
- case T_METADATA: return new (C) ConPNode( t->is_ptr() );
+ case T_INT: return new (C) ConINode( t->is_int() );
+ case T_LONG: return new (C) ConLNode( t->is_long() );
+ case T_FLOAT: return new (C) ConFNode( t->is_float_constant() );
+ case T_DOUBLE: return new (C) ConDNode( t->is_double_constant() );
+ case T_VOID: return new (C) ConNode ( Type::TOP );
+ case T_OBJECT: return new (C) ConPNode( t->is_ptr() );
+ case T_ARRAY: return new (C) ConPNode( t->is_aryptr() );
+ case T_ADDRESS: return new (C) ConPNode( t->is_ptr() );
+ case T_NARROWOOP: return new (C) ConNNode( t->is_narrowoop() );
+ case T_NARROWKLASS: return new (C) ConNKlassNode( t->is_narrowklass() );
+ case T_METADATA: return new (C) ConPNode( t->is_ptr() );
// Expected cases: TypePtr::NULL_PTR, any is_rawptr()
// Also seen: AnyPtr(TopPTR *+top); from command line:
// r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660
@@ -447,7 +448,7 @@
// If not converting int->oop, throw away cast after constant propagation
Node *CastPPNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
const Type *t = ccp->type(in(1));
- if (!t->isa_oop_ptr() || (in(1)->is_DecodeN() && Matcher::gen_narrow_oop_implicit_null_checks())) {
+ if (!t->isa_oop_ptr() || ((in(1)->is_DecodeN()) && Matcher::gen_narrow_oop_implicit_null_checks())) {
return NULL; // do not transform raw pointers or narrow oops
}
return ConstraintCastNode::Ideal_DU_postCCP(ccp);
@@ -607,15 +608,56 @@
if (t == Type::TOP) return Type::TOP;
if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
- assert(t->isa_oop_ptr() || UseCompressedKlassPointers && t->isa_klassptr(), "only oopptr here");
+ assert(t->isa_oop_ptr(), "only oopptr here");
return t->make_narrowoop();
}
-Node *EncodePNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
+Node *EncodeNarrowPtrNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1));
}
+Node* DecodeNKlassNode::Identity(PhaseTransform* phase) {
+ const Type *t = phase->type( in(1) );
+ if( t == Type::TOP ) return in(1);
+
+ if (in(1)->is_EncodePKlass()) {
+ // (DecodeNKlass (EncodePKlass p)) -> p
+ return in(1)->in(1);
+ }
+ return this;
+}
+
+const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const {
+ const Type *t = phase->type( in(1) );
+ if (t == Type::TOP) return Type::TOP;
+ assert(t != TypeNarrowKlass::NULL_PTR, "null klass?");
+
+ assert(t->isa_narrowklass(), "only narrow klass ptr here");
+ return t->make_ptr();
+}
+
+Node* EncodePKlassNode::Identity(PhaseTransform* phase) {
+ const Type *t = phase->type( in(1) );
+ if( t == Type::TOP ) return in(1);
+
+ if (in(1)->is_DecodeNKlass()) {
+ // (EncodePKlass (DecodeNKlass p)) -> p
+ return in(1)->in(1);
+ }
+ return this;
+}
+
+const Type *EncodePKlassNode::Value( PhaseTransform *phase ) const {
+ const Type *t = phase->type( in(1) );
+ if (t == Type::TOP) return Type::TOP;
+ assert (t != TypePtr::NULL_PTR, "null klass?");
+
+ assert(UseCompressedKlassPointers && t->isa_klassptr(), "only klass ptr here");
+ return t->make_narrowklass();
+}
+
+
//=============================================================================
//------------------------------Identity---------------------------------------
Node *Conv2BNode::Identity( PhaseTransform *phase ) {
--- a/hotspot/src/share/vm/opto/connode.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/connode.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -88,6 +88,14 @@
virtual int Opcode() const;
};
+//------------------------------ConNKlassNode---------------------------------
+// Simple narrow klass constants
+class ConNKlassNode : public ConNode {
+public:
+ ConNKlassNode( const TypeNarrowKlass *t ) : ConNode(t) {}
+ virtual int Opcode() const;
+};
+
//------------------------------ConLNode---------------------------------------
// Simple long constants
@@ -270,42 +278,91 @@
};
+//------------------------------EncodeNarrowPtr--------------------------------
+class EncodeNarrowPtrNode : public TypeNode {
+ protected:
+ EncodeNarrowPtrNode(Node* value, const Type* type):
+ TypeNode(type, 2) {
+ init_class_id(Class_EncodeNarrowPtr);
+ init_req(0, NULL);
+ init_req(1, value);
+ }
+ public:
+ virtual uint ideal_reg() const { return Op_RegN; }
+ virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
+};
+
//------------------------------EncodeP--------------------------------
// Encodes an oop pointers into its compressed form
// Takes an extra argument which is the real heap base as a long which
// may be useful for code generation in the backend.
-class EncodePNode : public TypeNode {
+class EncodePNode : public EncodeNarrowPtrNode {
public:
EncodePNode(Node* value, const Type* type):
- TypeNode(type, 2) {
+ EncodeNarrowPtrNode(value, type) {
init_class_id(Class_EncodeP);
- init_req(0, NULL);
- init_req(1, value);
}
virtual int Opcode() const;
virtual Node *Identity( PhaseTransform *phase );
virtual const Type *Value( PhaseTransform *phase ) const;
- virtual uint ideal_reg() const { return Op_RegN; }
+};
- virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
+//------------------------------EncodePKlass--------------------------------
+// Encodes a klass pointer into its compressed form
+// Takes an extra argument which is the real heap base as a long which
+// may be useful for code generation in the backend.
+class EncodePKlassNode : public EncodeNarrowPtrNode {
+ public:
+ EncodePKlassNode(Node* value, const Type* type):
+ EncodeNarrowPtrNode(value, type) {
+ init_class_id(Class_EncodePKlass);
+ }
+ virtual int Opcode() const;
+ virtual Node *Identity( PhaseTransform *phase );
+ virtual const Type *Value( PhaseTransform *phase ) const;
+};
+
+//------------------------------DecodeNarrowPtr--------------------------------
+class DecodeNarrowPtrNode : public TypeNode {
+ protected:
+ DecodeNarrowPtrNode(Node* value, const Type* type):
+ TypeNode(type, 2) {
+ init_class_id(Class_DecodeNarrowPtr);
+ init_req(0, NULL);
+ init_req(1, value);
+ }
+ public:
+ virtual uint ideal_reg() const { return Op_RegP; }
};
//------------------------------DecodeN--------------------------------
// Converts a narrow oop into a real oop ptr.
// Takes an extra argument which is the real heap base as a long which
// may be useful for code generation in the backend.
-class DecodeNNode : public TypeNode {
+class DecodeNNode : public DecodeNarrowPtrNode {
public:
DecodeNNode(Node* value, const Type* type):
- TypeNode(type, 2) {
+ DecodeNarrowPtrNode(value, type) {
init_class_id(Class_DecodeN);
- init_req(0, NULL);
- init_req(1, value);
}
virtual int Opcode() const;
- virtual Node *Identity( PhaseTransform *phase );
virtual const Type *Value( PhaseTransform *phase ) const;
- virtual uint ideal_reg() const { return Op_RegP; }
+ virtual Node *Identity( PhaseTransform *phase );
+};
+
+//------------------------------DecodeNKlass--------------------------------
+// Converts a narrow klass pointer into a real klass ptr.
+// Takes an extra argument which is the real heap base as a long which
+// may be useful for code generation in the backend.
+class DecodeNKlassNode : public DecodeNarrowPtrNode {
+ public:
+ DecodeNKlassNode(Node* value, const Type* type):
+ DecodeNarrowPtrNode(value, type) {
+ init_class_id(Class_DecodeNKlass);
+ }
+ virtual int Opcode() const;
+ virtual const Type *Value( PhaseTransform *phase ) const;
+ virtual Node *Identity( PhaseTransform *phase );
};
//------------------------------Conv2BNode-------------------------------------
--- a/hotspot/src/share/vm/opto/divnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/divnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/domgraph.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/domgraph.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/escape.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/escape.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -368,7 +368,9 @@
case Op_CastPP:
case Op_CheckCastPP:
case Op_EncodeP:
- case Op_DecodeN: {
+ case Op_DecodeN:
+ case Op_EncodePKlass:
+ case Op_DecodeNKlass: {
add_local_var_and_edge(n, PointsToNode::NoEscape,
n->in(1), delayed_worklist);
break;
@@ -381,7 +383,8 @@
break;
}
case Op_ConP:
- case Op_ConN: {
+ case Op_ConN:
+ case Op_ConNKlass: {
// assume all oop constants globally escape except for null
PointsToNode::EscapeState es;
if (igvn->type(n) == TypePtr::NULL_PTR ||
@@ -458,6 +461,7 @@
}
case Op_StoreP:
case Op_StoreN:
+ case Op_StoreNKlass:
case Op_StorePConditional:
case Op_CompareAndSwapP:
case Op_CompareAndSwapN: {
@@ -465,7 +469,7 @@
const Type *adr_type = igvn->type(adr);
adr_type = adr_type->make_ptr();
if (adr_type->isa_oopptr() ||
- (opcode == Op_StoreP || opcode == Op_StoreN) &&
+ (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) &&
(adr_type == TypeRawPtr::NOTNULL &&
adr->in(AddPNode::Address)->is_Proj() &&
adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
@@ -572,7 +576,9 @@
case Op_CastPP:
case Op_CheckCastPP:
case Op_EncodeP:
- case Op_DecodeN: {
+ case Op_DecodeN:
+ case Op_EncodePKlass:
+ case Op_DecodeNKlass: {
add_local_var_and_edge(n, PointsToNode::NoEscape,
n->in(1), NULL);
break;
@@ -646,6 +652,7 @@
}
case Op_StoreP:
case Op_StoreN:
+ case Op_StoreNKlass:
case Op_StorePConditional:
case Op_CompareAndSwapP:
case Op_CompareAndSwapN:
@@ -661,7 +668,7 @@
const Type *adr_type = _igvn->type(adr);
adr_type = adr_type->make_ptr();
if (adr_type->isa_oopptr() ||
- (opcode == Op_StoreP || opcode == Op_StoreN) &&
+ (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) &&
(adr_type == TypeRawPtr::NOTNULL &&
adr->in(AddPNode::Address)->is_Proj() &&
adr->in(AddPNode::Address)->in(0)->is_Allocate())) {
@@ -2088,7 +2095,7 @@
Node* uncast_base = base->uncast();
int opcode = uncast_base->Opcode();
assert(opcode == Op_ConP || opcode == Op_ThreadLocal ||
- opcode == Op_CastX2P || uncast_base->is_DecodeN() ||
+ opcode == Op_CastX2P || uncast_base->is_DecodeNarrowPtr() ||
(uncast_base->is_Mem() && uncast_base->bottom_type() == TypeRawPtr::NOTNULL) ||
(uncast_base->is_Proj() && uncast_base->in(0)->is_Allocate()), "sanity");
}
@@ -2837,8 +2844,8 @@
alloc_worklist.append_if_missing(use);
} else if (use->is_Phi() ||
use->is_CheckCastPP() ||
- use->is_EncodeP() ||
- use->is_DecodeN() ||
+ use->is_EncodeNarrowPtr() ||
+ use->is_DecodeNarrowPtr() ||
(use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) {
alloc_worklist.append_if_missing(use);
#ifdef ASSERT
--- a/hotspot/src/share/vm/opto/gcm.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/gcm.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/generateOptoStub.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/generateOptoStub.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/opto/graphKit.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/graphKit.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1115,7 +1115,7 @@
// short-circuit a common case
jint offset_con = find_int_con(offset, Type::OffsetBot);
if (offset_con != Type::OffsetBot) {
- return longcon((long) offset_con);
+ return longcon((jlong) offset_con);
}
return _gvn.transform( new (C) ConvI2LNode(offset));
}
--- a/hotspot/src/share/vm/opto/idealKit.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/idealKit.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/opto/idealKit.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/idealKit.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/opto/ifnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/ifnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/opto/lcm.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/lcm.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -164,6 +164,7 @@
case Op_StoreL:
case Op_StoreP:
case Op_StoreN:
+ case Op_StoreNKlass:
was_store = true; // Memory op is a store op
// Stores will have their address in slot 2 (memory in slot 1).
// If the value being nul-checked is in another slot, it means we
--- a/hotspot/src/share/vm/opto/library_call.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -2378,13 +2378,15 @@
}
}
- if (sharpened_klass != NULL) {
+ // The sharpened class might be unloaded if there is no class loader
+ // contraint in place.
+ if (sharpened_klass != NULL && sharpened_klass->is_loaded()) {
const TypeOopPtr* tjp = TypeOopPtr::make_from_klass(sharpened_klass);
#ifndef PRODUCT
if (PrintIntrinsics || PrintInlining || PrintOptoInlining) {
- tty->print(" from base type: "); adr_type->dump();
- tty->print(" sharpened value: "); tjp->dump();
+ tty->print(" from base type: "); adr_type->dump();
+ tty->print(" sharpened value: "); tjp->dump();
}
#endif
// Sharpen the value type.
@@ -3435,7 +3437,7 @@
if (generate_array_guard(kls, region) != NULL) {
// Be sure to pin the oop load to the guard edge just created:
Node* is_array_ctrl = region->in(region->req()-1);
- Node* cma = basic_plus_adr(kls, in_bytes(arrayKlass::component_mirror_offset()));
+ Node* cma = basic_plus_adr(kls, in_bytes(ArrayKlass::component_mirror_offset()));
Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT);
phi->add_req(cmo);
}
@@ -4381,7 +4383,7 @@
// 12 - 64-bit VM, compressed klass
// 16 - 64-bit VM, normal klass
if (base_off % BytesPerLong != 0) {
- assert(UseCompressedOops, "");
+ assert(UseCompressedKlassPointers, "");
if (is_array) {
// Exclude length to copy by 8 bytes words.
base_off += sizeof(int);
@@ -5032,7 +5034,7 @@
PreserveJVMState pjvms(this);
set_control(not_subtype_ctrl);
// (At this point we can assume disjoint_bases, since types differ.)
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
Node* p1 = basic_plus_adr(dest_klass, ek_offset);
Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM);
Node* dest_elem_klass = _gvn.transform(n1);
--- a/hotspot/src/share/vm/opto/live.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/live.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -331,6 +331,7 @@
#ifdef _LP64
UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_CastPP ||
UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_DecodeN ||
+ UseCompressedKlassPointers && check->as_Mach()->ideal_Opcode() == Op_DecodeNKlass ||
#endif
check->as_Mach()->ideal_Opcode() == Op_LoadP ||
check->as_Mach()->ideal_Opcode() == Op_LoadKlass)) {
--- a/hotspot/src/share/vm/opto/locknode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/locknode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/opto/locknode.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/locknode.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/opto/loopPredicate.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/loopPredicate.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/share/vm/opto/loopTransform.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -92,10 +92,10 @@
limit_n != NULL && limit_n->is_Con()) {
// Use longs to avoid integer overflow.
int stride_con = cl->stride_con();
- long init_con = cl->init_trip()->get_int();
- long limit_con = cl->limit()->get_int();
+ jlong init_con = cl->init_trip()->get_int();
+ jlong limit_con = cl->limit()->get_int();
int stride_m = stride_con - (stride_con > 0 ? 1 : -1);
- long trip_count = (limit_con - init_con + stride_m)/stride_con;
+ jlong trip_count = (limit_con - init_con + stride_m)/stride_con;
if (trip_count > 0 && (julong)trip_count < (julong)max_juint) {
// Set exact trip count.
cl->set_exact_trip_count((uint)trip_count);
@@ -1212,16 +1212,16 @@
} else if (loop_head->has_exact_trip_count() && init->is_Con()) {
// Loop's limit is constant. Loop's init could be constant when pre-loop
// become peeled iteration.
- long init_con = init->get_int();
+ jlong init_con = init->get_int();
// We can keep old loop limit if iterations count stays the same:
// old_trip_count == new_trip_count * 2
// Note: since old_trip_count >= 2 then new_trip_count >= 1
// so we also don't need to adjust zero trip test.
- long limit_con = limit->get_int();
+ jlong limit_con = limit->get_int();
// (stride_con*2) not overflow since stride_con <= 8.
int new_stride_con = stride_con * 2;
int stride_m = new_stride_con - (stride_con > 0 ? 1 : -1);
- long trip_count = (limit_con - init_con + stride_m)/new_stride_con;
+ jlong trip_count = (limit_con - init_con + stride_m)/new_stride_con;
// New trip count should satisfy next conditions.
assert(trip_count > 0 && (julong)trip_count < (julong)max_juint/2, "sanity");
uint new_trip_count = (uint)trip_count;
@@ -2413,7 +2413,7 @@
break;
}
int opc = n->Opcode();
- if (opc == Op_StoreP || opc == Op_StoreN || opc == Op_StoreCM) {
+ if (opc == Op_StoreP || opc == Op_StoreN || opc == Op_StoreNKlass || opc == Op_StoreCM) {
msg = "oop fills not handled";
break;
}
--- a/hotspot/src/share/vm/opto/loopUnswitch.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/loopUnswitch.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2012, 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
--- a/hotspot/src/share/vm/opto/loopnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/loopnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -328,12 +328,12 @@
const TypeInt* limit_t = gvn->type(limit)->is_int();
if (stride_con > 0) {
- long init_p = (long)init_t->_lo + stride_con;
- if (init_p > (long)max_jint || init_p > (long)limit_t->_hi)
+ jlong init_p = (jlong)init_t->_lo + stride_con;
+ if (init_p > (jlong)max_jint || init_p > (jlong)limit_t->_hi)
return false; // cyclic loop or this loop trips only once
} else {
- long init_p = (long)init_t->_hi + stride_con;
- if (init_p < (long)min_jint || init_p < (long)limit_t->_lo)
+ jlong init_p = (jlong)init_t->_hi + stride_con;
+ if (init_p < (jlong)min_jint || init_p < (jlong)limit_t->_lo)
return false; // cyclic loop or this loop trips only once
}
@@ -716,16 +716,16 @@
#endif
if (cl->has_exact_trip_count()) {
// Simple case: loop has constant boundaries.
- // Use longs to avoid integer overflow.
+ // Use jlongs to avoid integer overflow.
int stride_con = cl->stride_con();
- long init_con = cl->init_trip()->get_int();
- long limit_con = cl->limit()->get_int();
+ jlong init_con = cl->init_trip()->get_int();
+ jlong limit_con = cl->limit()->get_int();
julong trip_cnt = cl->trip_count();
- long final_con = init_con + trip_cnt*stride_con;
+ jlong final_con = init_con + trip_cnt*stride_con;
int final_int = (int)final_con;
// The final value should be in integer range since the loop
// is counted and the limit was checked for overflow.
- assert(final_con == (long)final_int, "final value should be integer");
+ assert(final_con == (jlong)final_int, "final value should be integer");
limit = _igvn.intcon(final_int);
} else {
// Create new LoopLimit node to get exact limit (final iv value).
@@ -790,16 +790,16 @@
return NULL; // Identity
if (init_t->is_int()->is_con() && limit_t->is_int()->is_con()) {
- // Use longs to avoid integer overflow.
- long init_con = init_t->is_int()->get_con();
- long limit_con = limit_t->is_int()->get_con();
+ // Use jlongs to avoid integer overflow.
+ jlong init_con = init_t->is_int()->get_con();
+ jlong limit_con = limit_t->is_int()->get_con();
int stride_m = stride_con - (stride_con > 0 ? 1 : -1);
- long trip_count = (limit_con - init_con + stride_m)/stride_con;
- long final_con = init_con + stride_con*trip_count;
+ jlong trip_count = (limit_con - init_con + stride_m)/stride_con;
+ jlong final_con = init_con + stride_con*trip_count;
int final_int = (int)final_con;
// The final value should be in integer range since the loop
// is counted and the limit was checked for overflow.
- assert(final_con == (long)final_int, "final value should be integer");
+ assert(final_con == (jlong)final_int, "final value should be integer");
return TypeInt::make(final_int);
}
@@ -829,7 +829,7 @@
const TypeInt* init_t = phase->type(in(Init) )->is_int();
const TypeInt* limit_t = phase->type(in(Limit))->is_int();
int stride_p;
- long lim, ini;
+ jlong lim, ini;
julong max;
if (stride_con > 0) {
stride_p = stride_con;
--- a/hotspot/src/share/vm/opto/loopnode.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/loopnode.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/opto/loopopts.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/loopopts.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -550,7 +550,7 @@
// This will likely Split-If, a higher-payoff operation.
for (DUIterator_Fast kmax, k = phi->fast_outs(kmax); k < kmax; k++) {
Node* use = phi->fast_out(k);
- if (use->is_Cmp() || use->is_DecodeN() || use->is_EncodeP())
+ if (use->is_Cmp() || use->is_DecodeNarrowPtr() || use->is_EncodeNarrowPtr())
cost += ConditionalMoveLimit;
// Is there a use inside the loop?
// Note: check only basic types since CMoveP is pinned.
@@ -1006,7 +1006,7 @@
// to fold a StoreP and an AddP together (as part of an
// address expression) and the AddP and StoreP have
// different controls.
- if( !x->is_Load() && !x->is_DecodeN() ) _igvn._worklist.yank(x);
+ if (!x->is_Load() && !x->is_DecodeNarrowPtr()) _igvn._worklist.yank(x);
}
_igvn.remove_dead_node(n);
}
--- a/hotspot/src/share/vm/opto/machnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/machnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -265,7 +265,8 @@
// See if it adds up to a base + offset.
if (index != NULL) {
const Type* t_index = index->bottom_type();
- if (t_index->isa_narrowoop()) { // EncodeN, LoadN, LoadConN, LoadNKlass.
+ if (t_index->isa_narrowoop() || t_index->isa_narrowklass()) { // EncodeN, LoadN, LoadConN, LoadNKlass,
+ // EncodeNKlass, LoadConNklass.
// Memory references through narrow oops have a
// funny base so grab the type from the index:
// [R12 + narrow_oop_reg<<3 + offset]
@@ -352,6 +353,10 @@
// 32-bit unscaled narrow oop can be the base of any address expression
t = t->make_ptr();
}
+ if (UseCompressedKlassPointers && Universe::narrow_klass_shift() == 0) {
+ // 32-bit unscaled narrow oop can be the base of any address expression
+ t = t->make_ptr();
+ }
if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
// We cannot assert that the offset does not look oop-ish here.
// Depending on the heap layout the cardmark base could land
--- a/hotspot/src/share/vm/opto/macro.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/macro.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -2125,7 +2125,7 @@
Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) );
#ifdef _LP64
- if (UseCompressedOops && klass_node->is_DecodeN()) {
+ if (UseCompressedKlassPointers && klass_node->is_DecodeNKlass()) {
assert(klass_node->in(1)->Opcode() == Op_LoadNKlass, "sanity");
klass_node->in(1)->init_req(0, ctrl);
} else
--- a/hotspot/src/share/vm/opto/macro.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/macro.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
--- a/hotspot/src/share/vm/opto/matcher.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/matcher.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1058,7 +1058,7 @@
Node *m = n->in(i); // Get input
int op = m->Opcode();
assert((op == Op_BoxLock) == jvms->is_monitor_use(i), "boxes only at monitor sites");
- if( op == Op_ConI || op == Op_ConP || op == Op_ConN ||
+ if( op == Op_ConI || op == Op_ConP || op == Op_ConN || op == Op_ConNKlass ||
op == Op_ConF || op == Op_ConD || op == Op_ConL
// || op == Op_BoxLock // %%%% enable this and remove (+++) in chaitin.cpp
) {
@@ -1450,7 +1450,8 @@
if (j == max_scan) // No post-domination before scan end?
return true; // Then break the match tree up
}
- if (m->is_DecodeN() && Matcher::narrow_oop_use_complex_address()) {
+ if ((m->is_DecodeN() && Matcher::narrow_oop_use_complex_address()) ||
+ (m->is_DecodeNKlass() && Matcher::narrow_klass_use_complex_address())) {
// These are commonly used in address expressions and can
// efficiently fold into them on X64 in some cases.
return false;
@@ -1574,14 +1575,14 @@
// program. The register allocator is free to split uses later to
// split live ranges.
MachNode* Matcher::find_shared_node(Node* leaf, uint rule) {
- if (!leaf->is_Con() && !leaf->is_DecodeN()) return NULL;
+ if (!leaf->is_Con() && !leaf->is_DecodeNarrowPtr()) return NULL;
// See if this Con has already been reduced using this rule.
if (_shared_nodes.Size() <= leaf->_idx) return NULL;
MachNode* last = (MachNode*)_shared_nodes.at(leaf->_idx);
if (last != NULL && rule == last->rule()) {
// Don't expect control change for DecodeN
- if (leaf->is_DecodeN())
+ if (leaf->is_DecodeNarrowPtr())
return last;
// Get the new space root.
Node* xroot = new_node(C->root());
@@ -1671,12 +1672,12 @@
// DecodeN node consumed by an address may have different type
// then its input. Don't compare types for such case.
if (m->adr_type() != mach_at &&
- (m->in(MemNode::Address)->is_DecodeN() ||
+ (m->in(MemNode::Address)->is_DecodeNarrowPtr() ||
m->in(MemNode::Address)->is_AddP() &&
- m->in(MemNode::Address)->in(AddPNode::Address)->is_DecodeN() ||
+ m->in(MemNode::Address)->in(AddPNode::Address)->is_DecodeNarrowPtr() ||
m->in(MemNode::Address)->is_AddP() &&
m->in(MemNode::Address)->in(AddPNode::Address)->is_AddP() &&
- m->in(MemNode::Address)->in(AddPNode::Address)->in(AddPNode::Address)->is_DecodeN())) {
+ m->in(MemNode::Address)->in(AddPNode::Address)->in(AddPNode::Address)->is_DecodeNarrowPtr())) {
mach_at = m->adr_type();
}
if (m->adr_type() != mach_at) {
@@ -1721,7 +1722,7 @@
guarantee(_proj_list.size() == num_proj, "no allocation during spill generation");
}
- if (leaf->is_Con() || leaf->is_DecodeN()) {
+ if (leaf->is_Con() || leaf->is_DecodeNarrowPtr()) {
// Record the con for sharing
_shared_nodes.map(leaf->_idx, ex);
}
@@ -2038,7 +2039,7 @@
continue; // for(int i = ...)
}
- if( mop == Op_AddP && m->in(AddPNode::Base)->Opcode() == Op_DecodeN ) {
+ if( mop == Op_AddP && m->in(AddPNode::Base)->is_DecodeNarrowPtr()) {
// Bases used in addresses must be shared but since
// they are shared through a DecodeN they may appear
// to have a single use so force sharing here.
@@ -2277,7 +2278,7 @@
if (has_new_node(val)) {
Node* new_val = new_node(val);
if (is_decoden) {
- assert(val->is_DecodeN() && val->in(0) == NULL, "sanity");
+ assert(val->is_DecodeNarrowPtr() && val->in(0) == NULL, "sanity");
// Note: new_val may have a control edge if
// the original ideal node DecodeN was matched before
// it was unpinned in Matcher::collect_null_checks().
--- a/hotspot/src/share/vm/opto/matcher.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/matcher.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -380,6 +380,7 @@
static const bool clone_shift_expressions;
static bool narrow_oop_use_complex_address();
+ static bool narrow_klass_use_complex_address();
// Generate implicit null check for narrow oops if it can fold
// into address expression (x64).
--- a/hotspot/src/share/vm/opto/memnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -714,10 +714,12 @@
continue;
case Op_DecodeN: // No change to NULL-ness, so peek thru
+ case Op_DecodeNKlass:
adr = adr->in(1);
continue;
case Op_EncodeP:
+ case Op_EncodePKlass:
// EncodeP node's control edge could be set by this method
// when EncodeP node depends on CastPP node.
//
@@ -794,6 +796,7 @@
case Op_LoadNKlass: // Loading from within a klass
case Op_ConP: // Loading from a klass
case Op_ConN: // Loading from a klass
+ case Op_ConNKlass: // Loading from a klass
case Op_CreateEx: // Sucking up the guts of an exception oop
case Op_Con: // Reading from TLS
case Op_CMoveP: // CMoveP is pinned
@@ -900,7 +903,7 @@
} else
#endif
{
- assert(!adr->bottom_type()->is_ptr_to_narrowoop(), "should have got back a narrow oop");
+ assert(!adr->bottom_type()->is_ptr_to_narrowoop() && !adr->bottom_type()->is_ptr_to_narrowklass(), "should have got back a narrow oop");
return new (C) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr());
}
}
@@ -1671,9 +1674,9 @@
}
const Type* aift = load_array_final_field(tkls, klass);
if (aift != NULL) return aift;
- if (tkls->offset() == in_bytes(arrayKlass::component_mirror_offset())
+ if (tkls->offset() == in_bytes(ArrayKlass::component_mirror_offset())
&& klass->is_array_klass()) {
- // The field is arrayKlass::_component_mirror. Return its (constant) value.
+ // The field is ArrayKlass::_component_mirror. Return its (constant) value.
// (Folds up aClassConstant.getComponentType, common in Arrays.copyOf.)
assert(Opcode() == Op_LoadP, "must load an oop from _component_mirror");
return TypeInstPtr::make(klass->as_array_klass()->component_mirror());
@@ -1894,13 +1897,13 @@
const TypePtr *adr_type = adr->bottom_type()->isa_ptr();
assert(adr_type != NULL, "expecting TypeKlassPtr");
#ifdef _LP64
- if (adr_type->is_ptr_to_narrowoop()) {
+ if (adr_type->is_ptr_to_narrowklass()) {
assert(UseCompressedKlassPointers, "no compressed klasses");
- Node* load_klass = gvn.transform(new (C) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowoop()));
- return new (C) DecodeNNode(load_klass, load_klass->bottom_type()->make_ptr());
+ Node* load_klass = gvn.transform(new (C) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowklass()));
+ return new (C) DecodeNKlassNode(load_klass, load_klass->bottom_type()->make_ptr());
}
#endif
- assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop");
+ assert(!adr_type->is_ptr_to_narrowklass() && !adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop");
return new (C) LoadKlassNode(ctl, mem, adr, at, tk);
}
@@ -2014,7 +2017,7 @@
if( !klass->is_loaded() )
return _type; // Bail out if not loaded
if( klass->is_obj_array_klass() &&
- tkls->offset() == in_bytes(objArrayKlass::element_klass_offset())) {
+ tkls->offset() == in_bytes(ObjArrayKlass::element_klass_offset())) {
ciKlass* elem = klass->as_obj_array_klass()->element_klass();
// // Always returning precise element type is incorrect,
// // e.g., element type could be object and array may contain strings
@@ -2067,7 +2070,7 @@
}
// Simplify k.java_mirror.as_klass to plain k, where k is a Klass*.
- // Simplify ak.component_mirror.array_klass to plain ak, ak an arrayKlass.
+ // Simplify ak.component_mirror.array_klass to plain ak, ak an ArrayKlass.
// See inline_native_Class_query for occurrences of these patterns.
// Java Example: x.getClass().isAssignableFrom(y)
// Java Example: Array.newInstance(x.getClass().getComponentType(), n)
@@ -2080,7 +2083,7 @@
&& (offset == java_lang_Class::klass_offset_in_bytes() ||
offset == java_lang_Class::array_klass_offset_in_bytes())) {
// We are loading a special hidden field from a Class mirror,
- // the field which points to its Klass or arrayKlass metaobject.
+ // the field which points to its Klass or ArrayKlass metaobject.
if (base->is_Load()) {
Node* adr2 = base->in(MemNode::Address);
const TypeKlassPtr* tkls = phase->type(adr2)->isa_klassptr();
@@ -2091,7 +2094,7 @@
) {
int mirror_field = in_bytes(Klass::java_mirror_offset());
if (offset == java_lang_Class::array_klass_offset_in_bytes()) {
- mirror_field = in_bytes(arrayKlass::component_mirror_offset());
+ mirror_field = in_bytes(ArrayKlass::component_mirror_offset());
}
if (tkls->offset() == mirror_field) {
return adr2->in(AddPNode::Base);
@@ -2110,7 +2113,7 @@
if (t == Type::TOP)
return t;
- return t->make_narrowoop();
+ return t->make_narrowklass();
}
//------------------------------Identity---------------------------------------
@@ -2121,9 +2124,10 @@
const Type *t = phase->type( x );
if( t == Type::TOP ) return x;
- if( t->isa_narrowoop()) return x;
-
- return phase->transform(new (phase->C) EncodePNode(x, t->make_narrowoop()));
+ if( t->isa_narrowklass()) return x;
+ assert (!t->isa_narrowoop(), "no narrow oop here");
+
+ return phase->transform(new (phase->C) EncodePKlassNode(x, t->make_narrowklass()));
}
//------------------------------Value-----------------------------------------
@@ -2228,12 +2232,15 @@
case T_ADDRESS:
case T_OBJECT:
#ifdef _LP64
- if (adr->bottom_type()->is_ptr_to_narrowoop() ||
- (UseCompressedKlassPointers && val->bottom_type()->isa_klassptr() &&
- adr->bottom_type()->isa_rawptr())) {
+ if (adr->bottom_type()->is_ptr_to_narrowoop()) {
val = gvn.transform(new (C) EncodePNode(val, val->bottom_type()->make_narrowoop()));
return new (C) StoreNNode(ctl, mem, adr, adr_type, val);
- } else
+ } else if (adr->bottom_type()->is_ptr_to_narrowklass() ||
+ (UseCompressedKlassPointers && val->bottom_type()->isa_klassptr() &&
+ adr->bottom_type()->isa_rawptr())) {
+ val = gvn.transform(new (C) EncodePKlassNode(val, val->bottom_type()->make_narrowklass()));
+ return new (C) StoreNKlassNode(ctl, mem, adr, adr_type, val);
+ }
#endif
{
return new (C) StorePNode(ctl, mem, adr, adr_type, val);
--- a/hotspot/src/share/vm/opto/memnode.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/memnode.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -274,18 +274,6 @@
virtual BasicType memory_type() const { return T_INT; }
};
-//------------------------------LoadUI2LNode-----------------------------------
-// Load an unsigned integer into long from memory
-class LoadUI2LNode : public LoadNode {
-public:
- LoadUI2LNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeLong* t = TypeLong::UINT)
- : LoadNode(c, mem, adr, at, t) {}
- virtual int Opcode() const;
- virtual uint ideal_reg() const { return Op_RegL; }
- virtual int store_Opcode() const { return Op_StoreL; }
- virtual BasicType memory_type() const { return T_LONG; }
-};
-
//------------------------------LoadRangeNode----------------------------------
// Load an array length from the array
class LoadRangeNode : public LoadINode {
@@ -437,12 +425,12 @@
// Load a narrow Klass from an object.
class LoadNKlassNode : public LoadNNode {
public:
- LoadNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowOop *tk )
+ LoadNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowKlass *tk )
: LoadNNode(c,mem,adr,at,tk) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegN; }
- virtual int store_Opcode() const { return Op_StoreN; }
- virtual BasicType memory_type() const { return T_NARROWOOP; }
+ virtual int store_Opcode() const { return Op_StoreNKlass; }
+ virtual BasicType memory_type() const { return T_NARROWKLASS; }
virtual const Type *Value( PhaseTransform *phase ) const;
virtual Node *Identity( PhaseTransform *phase );
@@ -593,6 +581,15 @@
virtual BasicType memory_type() const { return T_NARROWOOP; }
};
+//------------------------------StoreNKlassNode--------------------------------------
+// Store narrow klass to memory
+class StoreNKlassNode : public StoreNNode {
+public:
+ StoreNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNNode(c,mem,adr,at,val) {}
+ virtual int Opcode() const;
+ virtual BasicType memory_type() const { return T_NARROWKLASS; }
+};
+
//------------------------------StoreCMNode-----------------------------------
// Store card-mark byte to memory for CM
// The last StoreCM before a SafePoint must be preserved and occur after its "oop" store
--- a/hotspot/src/share/vm/opto/mulnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/mulnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -599,20 +599,6 @@
Node* in1 = in(1);
uint op = in1->Opcode();
- // Masking sign bits off of an integer? Do an unsigned integer to
- // long load.
- // NOTE: This check must be *before* we try to convert the AndLNode
- // to an AndINode and commute it with ConvI2LNode because
- // 0xFFFFFFFFL masks the whole integer and we get a sign extension,
- // which is wrong.
- if (op == Op_ConvI2L && in1->in(1)->Opcode() == Op_LoadI && mask == CONST64(0x00000000FFFFFFFF)) {
- Node* load = in1->in(1);
- return new (phase->C) LoadUI2LNode(load->in(MemNode::Control),
- load->in(MemNode::Memory),
- load->in(MemNode::Address),
- load->adr_type());
- }
-
// Are we masking a long that was converted from an int with a mask
// that fits in 32-bits? Commute them and use an AndINode. Don't
// convert masks which would cause a sign extension of the integer
--- a/hotspot/src/share/vm/opto/node.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/node.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -62,8 +62,12 @@
class ConNode;
class CountedLoopNode;
class CountedLoopEndNode;
+class DecodeNarrowPtrNode;
class DecodeNNode;
+class DecodeNKlassNode;
+class EncodeNarrowPtrNode;
class EncodePNode;
+class EncodePKlassNode;
class FastLockNode;
class FastUnlockNode;
class IfNode;
@@ -585,8 +589,12 @@
DEFINE_CLASS_ID(CheckCastPP, Type, 2)
DEFINE_CLASS_ID(CMove, Type, 3)
DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
- DEFINE_CLASS_ID(DecodeN, Type, 5)
- DEFINE_CLASS_ID(EncodeP, Type, 6)
+ DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5)
+ DEFINE_CLASS_ID(DecodeN, DecodeNarrowPtr, 0)
+ DEFINE_CLASS_ID(DecodeNKlass, DecodeNarrowPtr, 1)
+ DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6)
+ DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0)
+ DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1)
DEFINE_CLASS_ID(Proj, Node, 3)
DEFINE_CLASS_ID(CatchProj, Proj, 0)
@@ -706,8 +714,12 @@
DEFINE_CLASS_QUERY(Cmp)
DEFINE_CLASS_QUERY(CountedLoop)
DEFINE_CLASS_QUERY(CountedLoopEnd)
+ DEFINE_CLASS_QUERY(DecodeNarrowPtr)
DEFINE_CLASS_QUERY(DecodeN)
+ DEFINE_CLASS_QUERY(DecodeNKlass)
+ DEFINE_CLASS_QUERY(EncodeNarrowPtr)
DEFINE_CLASS_QUERY(EncodeP)
+ DEFINE_CLASS_QUERY(EncodePKlass)
DEFINE_CLASS_QUERY(FastLock)
DEFINE_CLASS_QUERY(FastUnlock)
DEFINE_CLASS_QUERY(If)
--- a/hotspot/src/share/vm/opto/parse.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/parse.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/parse1.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/parse1.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1381,8 +1381,7 @@
// that occur during parsing of this BC. If there is no log
// output until the next context string, this context string
// will be silently ignored.
- log->context()->reset();
- log->context()->print_cr("<bc code='%d' bci='%d'/>", (int)bc(), bci());
+ log->set_context("bc code='%d' bci='%d'", (int)bc(), bci());
}
if (block()->has_trap_at(bci())) {
@@ -1411,7 +1410,8 @@
NOT_PRODUCT( parse_histogram()->record_change(); );
- if (log != NULL) log->context()->reset(); // done w/ this one
+ if (log != NULL)
+ log->clear_context(); // skip marker if nothing was printed
// Fall into next bytecode. Each bytecode normally has 1 sequential
// successor which is typically made ready by visiting this bytecode.
--- a/hotspot/src/share/vm/opto/parse2.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/parse2.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1239,7 +1239,7 @@
static Node* extract_obj_from_klass_load(PhaseGVN* gvn, Node* n) {
Node* ldk;
- if (n->is_DecodeN()) {
+ if (n->is_DecodeNKlass()) {
if (n->in(1)->Opcode() != Op_LoadNKlass) {
return NULL;
} else {
--- a/hotspot/src/share/vm/opto/parse3.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/parse3.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/opto/parseHelper.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/parseHelper.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -200,7 +200,7 @@
// Come here for polymorphic array klasses
// Extract the array element class
- int element_klass_offset = in_bytes(objArrayKlass::element_klass_offset());
+ int element_klass_offset = in_bytes(ObjArrayKlass::element_klass_offset());
Node *p2 = basic_plus_adr(array_klass, array_klass, element_klass_offset);
Node *a_e_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p2, tak) );
--- a/hotspot/src/share/vm/opto/phaseX.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/phaseX.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/phaseX.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/phaseX.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -497,8 +497,8 @@
#ifndef PRODUCT
protected:
// Sub-quadratic implementation of VerifyIterativeGVN.
- unsigned long _verify_counter;
- unsigned long _verify_full_passes;
+ julong _verify_counter;
+ julong _verify_full_passes;
enum { _verify_window_size = 30 };
Node* _verify_window[_verify_window_size];
void verify_step(Node* n);
--- a/hotspot/src/share/vm/opto/runtime.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/runtime.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -286,13 +286,13 @@
if (Klass::cast(array_type)->oop_is_typeArray()) {
// The oopFactory likes to work with the element type.
// (We could bypass the oopFactory, since it doesn't add much value.)
- BasicType elem_type = typeArrayKlass::cast(array_type)->element_type();
+ BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
result = oopFactory::new_typeArray(elem_type, len, THREAD);
} else {
// Although the oopFactory likes to work with the elem_type,
// the compiler prefers the array_type, since it must already have
// that latter value in hand for the fast path.
- Klass* elem_type = objArrayKlass::cast(array_type)->element_klass();
+ Klass* elem_type = ObjArrayKlass::cast(array_type)->element_klass();
result = oopFactory::new_objArray(elem_type, len, THREAD);
}
@@ -323,7 +323,7 @@
assert(Klass::cast(array_type)->oop_is_typeArray(), "should be called only for type array");
// The oopFactory likes to work with the element type.
- BasicType elem_type = typeArrayKlass::cast(array_type)->element_type();
+ BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
result = oopFactory::new_typeArray_nozero(elem_type, len, THREAD);
// Pass oops back through thread local storage. Our apparent type to Java
@@ -344,7 +344,7 @@
is_deoptimized_caller_frame(thread)) {
// Zero array here if the caller is deoptimized.
int size = ((typeArrayOop)result)->object_size();
- BasicType elem_type = typeArrayKlass::cast(array_type)->element_type();
+ BasicType elem_type = TypeArrayKlass::cast(array_type)->element_type();
const size_t hs = arrayOopDesc::header_size(elem_type);
// Align to next 8 bytes to avoid trashing arrays's length.
const size_t aligned_hs = align_object_offset(hs);
@@ -370,7 +370,7 @@
jint dims[2];
dims[0] = len1;
dims[1] = len2;
- oop obj = arrayKlass::cast(elem_type)->multi_allocate(2, dims, THREAD);
+ oop obj = ArrayKlass::cast(elem_type)->multi_allocate(2, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
@@ -386,7 +386,7 @@
dims[0] = len1;
dims[1] = len2;
dims[2] = len3;
- oop obj = arrayKlass::cast(elem_type)->multi_allocate(3, dims, THREAD);
+ oop obj = ArrayKlass::cast(elem_type)->multi_allocate(3, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
@@ -403,7 +403,7 @@
dims[1] = len2;
dims[2] = len3;
dims[3] = len4;
- oop obj = arrayKlass::cast(elem_type)->multi_allocate(4, dims, THREAD);
+ oop obj = ArrayKlass::cast(elem_type)->multi_allocate(4, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
@@ -421,7 +421,7 @@
dims[2] = len3;
dims[3] = len4;
dims[4] = len5;
- oop obj = arrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
+ oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
@@ -438,7 +438,7 @@
jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
Copy::conjoint_jints_atomic(j_dims, c_dims, len);
- oop obj = arrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
+ oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
thread->set_vm_result(obj);
JRT_END
--- a/hotspot/src/share/vm/opto/split_if.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/split_if.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
--- a/hotspot/src/share/vm/opto/subnode.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/subnode.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -789,7 +789,7 @@
// Now check for LoadKlass on left.
Node* ldk1 = in(1);
- if (ldk1->is_DecodeN()) {
+ if (ldk1->is_DecodeNKlass()) {
ldk1 = ldk1->in(1);
if (ldk1->Opcode() != Op_LoadNKlass )
return NULL;
@@ -814,7 +814,7 @@
// Check for a LoadKlass from primary supertype array.
// Any nested loadklass from loadklass+con must be from the p.s. array.
- if (ldk2->is_DecodeN()) {
+ if (ldk2->is_DecodeNKlass()) {
// Keep ldk2 as DecodeN since it could be used in CmpP below.
if (ldk2->in(1)->Opcode() != Op_LoadNKlass )
return NULL;
--- a/hotspot/src/share/vm/opto/subnode.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/subnode.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/opto/superword.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/superword.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -179,7 +179,6 @@
for (int i = 0; i < _block.length(); i++) {
Node* n = _block.at(i);
if (n->is_Mem() && !n->is_LoadStore() && in_bb(n) &&
- n->Opcode() != Op_LoadUI2L &&
is_java_primitive(n->as_Mem()->memory_type())) {
int align = memory_alignment(n->as_Mem(), 0);
if (align != bottom_align) {
--- a/hotspot/src/share/vm/opto/type.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/type.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -57,6 +57,7 @@
{ Bad, T_LONG, "long:", false, Op_RegL, relocInfo::none }, // Long
{ Half, T_VOID, "half", false, 0, relocInfo::none }, // Half
{ Bad, T_NARROWOOP, "narrowoop:", false, Op_RegN, relocInfo::none }, // NarrowOop
+ { Bad, T_NARROWKLASS,"narrowklass:", false, Op_RegN, relocInfo::none }, // NarrowKlass
{ Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple
{ Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array
@@ -332,6 +333,8 @@
TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR );
TypeNarrowOop::BOTTOM = TypeNarrowOop::make( TypeInstPtr::BOTTOM );
+ TypeNarrowKlass::NULL_PTR = TypeNarrowKlass::make( TypePtr::NULL_PTR );
+
mreg2type[Op_Node] = Type::BOTTOM;
mreg2type[Op_Set ] = 0;
mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM;
@@ -395,34 +398,36 @@
longpair[1] = TypeLong::LONG;
TypeTuple::LONG_PAIR = TypeTuple::make(2, longpair);
- _const_basic_type[T_NARROWOOP] = TypeNarrowOop::BOTTOM;
- _const_basic_type[T_BOOLEAN] = TypeInt::BOOL;
- _const_basic_type[T_CHAR] = TypeInt::CHAR;
- _const_basic_type[T_BYTE] = TypeInt::BYTE;
- _const_basic_type[T_SHORT] = TypeInt::SHORT;
- _const_basic_type[T_INT] = TypeInt::INT;
- _const_basic_type[T_LONG] = TypeLong::LONG;
- _const_basic_type[T_FLOAT] = Type::FLOAT;
- _const_basic_type[T_DOUBLE] = Type::DOUBLE;
- _const_basic_type[T_OBJECT] = TypeInstPtr::BOTTOM;
- _const_basic_type[T_ARRAY] = TypeInstPtr::BOTTOM; // there is no separate bottom for arrays
- _const_basic_type[T_VOID] = TypePtr::NULL_PTR; // reflection represents void this way
- _const_basic_type[T_ADDRESS] = TypeRawPtr::BOTTOM; // both interpreter return addresses & random raw ptrs
- _const_basic_type[T_CONFLICT]= Type::BOTTOM; // why not?
-
- _zero_type[T_NARROWOOP] = TypeNarrowOop::NULL_PTR;
- _zero_type[T_BOOLEAN] = TypeInt::ZERO; // false == 0
- _zero_type[T_CHAR] = TypeInt::ZERO; // '\0' == 0
- _zero_type[T_BYTE] = TypeInt::ZERO; // 0x00 == 0
- _zero_type[T_SHORT] = TypeInt::ZERO; // 0x0000 == 0
- _zero_type[T_INT] = TypeInt::ZERO;
- _zero_type[T_LONG] = TypeLong::ZERO;
- _zero_type[T_FLOAT] = TypeF::ZERO;
- _zero_type[T_DOUBLE] = TypeD::ZERO;
- _zero_type[T_OBJECT] = TypePtr::NULL_PTR;
- _zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop
- _zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null
- _zero_type[T_VOID] = Type::TOP; // the only void value is no value at all
+ _const_basic_type[T_NARROWOOP] = TypeNarrowOop::BOTTOM;
+ _const_basic_type[T_NARROWKLASS] = Type::BOTTOM;
+ _const_basic_type[T_BOOLEAN] = TypeInt::BOOL;
+ _const_basic_type[T_CHAR] = TypeInt::CHAR;
+ _const_basic_type[T_BYTE] = TypeInt::BYTE;
+ _const_basic_type[T_SHORT] = TypeInt::SHORT;
+ _const_basic_type[T_INT] = TypeInt::INT;
+ _const_basic_type[T_LONG] = TypeLong::LONG;
+ _const_basic_type[T_FLOAT] = Type::FLOAT;
+ _const_basic_type[T_DOUBLE] = Type::DOUBLE;
+ _const_basic_type[T_OBJECT] = TypeInstPtr::BOTTOM;
+ _const_basic_type[T_ARRAY] = TypeInstPtr::BOTTOM; // there is no separate bottom for arrays
+ _const_basic_type[T_VOID] = TypePtr::NULL_PTR; // reflection represents void this way
+ _const_basic_type[T_ADDRESS] = TypeRawPtr::BOTTOM; // both interpreter return addresses & random raw ptrs
+ _const_basic_type[T_CONFLICT] = Type::BOTTOM; // why not?
+
+ _zero_type[T_NARROWOOP] = TypeNarrowOop::NULL_PTR;
+ _zero_type[T_NARROWKLASS] = TypeNarrowKlass::NULL_PTR;
+ _zero_type[T_BOOLEAN] = TypeInt::ZERO; // false == 0
+ _zero_type[T_CHAR] = TypeInt::ZERO; // '\0' == 0
+ _zero_type[T_BYTE] = TypeInt::ZERO; // 0x00 == 0
+ _zero_type[T_SHORT] = TypeInt::ZERO; // 0x0000 == 0
+ _zero_type[T_INT] = TypeInt::ZERO;
+ _zero_type[T_LONG] = TypeLong::ZERO;
+ _zero_type[T_FLOAT] = TypeF::ZERO;
+ _zero_type[T_DOUBLE] = TypeD::ZERO;
+ _zero_type[T_OBJECT] = TypePtr::NULL_PTR;
+ _zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop
+ _zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null
+ _zero_type[T_VOID] = Type::TOP; // the only void value is no value at all
// get_zero_type() should not happen for T_CONFLICT
_zero_type[T_CONFLICT]= NULL;
@@ -563,9 +568,14 @@
const Type* result = make_ptr()->meet(t->make_ptr());
return result->make_narrowoop();
}
+ if (isa_narrowklass() && t->isa_narrowklass()) {
+ const Type* result = make_ptr()->meet(t->make_ptr());
+ return result->make_narrowklass();
+ }
const Type *mt = xmeet(t);
if (isa_narrowoop() || t->isa_narrowoop()) return mt;
+ if (isa_narrowklass() || t->isa_narrowklass()) return mt;
#ifdef ASSERT
assert( mt == t->xmeet(this), "meet not commutative" );
const Type* dual_join = mt->_dual;
@@ -635,6 +645,9 @@
case NarrowOop:
return t->xmeet(this);
+ case NarrowKlass:
+ return t->xmeet(this);
+
case Bad: // Type check
default: // Bogus type not in lattice
typerr(t);
@@ -693,6 +706,7 @@
Bad, // Long - handled in v-call
Half, // Half
Bad, // NarrowOop - handled in v-call
+ Bad, // NarrowKlass - handled in v-call
Bad, // Tuple - handled in v-call
Bad, // Array - handled in v-call
@@ -756,6 +770,8 @@
dump2(d,1, st);
if (is_ptr_to_narrowoop()) {
st->print(" [narrow]");
+ } else if (is_ptr_to_narrowklass()) {
+ st->print(" [narrowklass]");
}
}
#endif
@@ -838,6 +854,7 @@
case MetadataPtr:
case KlassPtr:
case NarrowOop:
+ case NarrowKlass:
case Int:
case Long:
case DoubleTop:
@@ -955,6 +972,7 @@
case MetadataPtr:
case KlassPtr:
case NarrowOop:
+ case NarrowKlass:
case Int:
case Long:
case FloatTop:
@@ -1109,6 +1127,7 @@
case MetadataPtr:
case KlassPtr:
case NarrowOop:
+ case NarrowKlass:
case Long:
case FloatTop:
case FloatCon:
@@ -1366,6 +1385,7 @@
case MetadataPtr:
case KlassPtr:
case NarrowOop:
+ case NarrowKlass:
case Int:
case FloatTop:
case FloatCon:
@@ -2096,6 +2116,7 @@
case DoubleCon:
case DoubleBot:
case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
@@ -2350,17 +2371,18 @@
_const_oop(o), _klass(k),
_klass_is_exact(xk),
_is_ptr_to_narrowoop(false),
+ _is_ptr_to_narrowklass(false),
_instance_id(instance_id) {
#ifdef _LP64
- if (UseCompressedOops && _offset != 0) {
+ if (_offset != 0) {
if (_offset == oopDesc::klass_offset_in_bytes()) {
- _is_ptr_to_narrowoop = UseCompressedKlassPointers;
+ _is_ptr_to_narrowklass = UseCompressedKlassPointers;
} else if (klass() == NULL) {
// Array with unknown body type
assert(this->isa_aryptr(), "only arrays without klass");
- _is_ptr_to_narrowoop = true;
+ _is_ptr_to_narrowoop = UseCompressedOops;
} else if (this->isa_aryptr()) {
- _is_ptr_to_narrowoop = (klass()->is_obj_array_klass() &&
+ _is_ptr_to_narrowoop = (UseCompressedOops && klass()->is_obj_array_klass() &&
_offset != arrayOopDesc::length_offset_in_bytes());
} else if (klass()->is_instance_klass()) {
ciInstanceKlass* ik = klass()->as_instance_klass();
@@ -2369,7 +2391,7 @@
// Perm objects don't use compressed references
} else if (_offset == OffsetBot || _offset == OffsetTop) {
// unsafe access
- _is_ptr_to_narrowoop = true;
+ _is_ptr_to_narrowoop = UseCompressedOops;
} else { // exclude unsafe ops
assert(this->isa_instptr(), "must be an instance ptr.");
@@ -2387,22 +2409,22 @@
ciField* field = k->get_field_by_offset(_offset, true);
assert(field != NULL, "missing field");
BasicType basic_elem_type = field->layout_type();
- _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT ||
- basic_elem_type == T_ARRAY);
+ _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
+ basic_elem_type == T_ARRAY);
} else {
// Instance fields which contains a compressed oop references.
field = ik->get_field_by_offset(_offset, false);
if (field != NULL) {
BasicType basic_elem_type = field->layout_type();
- _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT ||
- basic_elem_type == T_ARRAY);
+ _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
+ basic_elem_type == T_ARRAY);
} else if (klass()->equals(ciEnv::current()->Object_klass())) {
// Compile::find_alias_type() cast exactness on all types to verify
// that it does not affect alias type.
- _is_ptr_to_narrowoop = true;
+ _is_ptr_to_narrowoop = UseCompressedOops;
} else {
// Type for the copy start in LibraryCallKit::inline_native_clone().
- _is_ptr_to_narrowoop = true;
+ _is_ptr_to_narrowoop = UseCompressedOops;
}
}
}
@@ -2475,6 +2497,7 @@
case DoubleCon:
case DoubleBot:
case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
@@ -2925,6 +2948,7 @@
case DoubleCon:
case DoubleBot:
case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
@@ -3353,6 +3377,7 @@
case T_NARROWOOP:
etype = T_OBJECT;
break;
+ case T_NARROWKLASS:
case T_CONFLICT:
case T_ILLEGAL:
case T_VOID:
@@ -3425,6 +3450,7 @@
case DoubleCon:
case DoubleBot:
case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
@@ -3671,23 +3697,27 @@
//=============================================================================
-const TypeNarrowOop *TypeNarrowOop::BOTTOM;
-const TypeNarrowOop *TypeNarrowOop::NULL_PTR;
-
-
-const TypeNarrowOop* TypeNarrowOop::make(const TypePtr* type) {
- return (const TypeNarrowOop*)(new TypeNarrowOop(type))->hashcons();
-}
//------------------------------hash-------------------------------------------
// Type-specific hashing function.
-int TypeNarrowOop::hash(void) const {
+int TypeNarrowPtr::hash(void) const {
return _ptrtype->hash() + 7;
}
-
-bool TypeNarrowOop::eq( const Type *t ) const {
- const TypeNarrowOop* tc = t->isa_narrowoop();
+bool TypeNarrowPtr::singleton(void) const { // TRUE if type is a singleton
+ return _ptrtype->singleton();
+}
+
+bool TypeNarrowPtr::empty(void) const {
+ return _ptrtype->empty();
+}
+
+intptr_t TypeNarrowPtr::get_con() const {
+ return _ptrtype->get_con();
+}
+
+bool TypeNarrowPtr::eq( const Type *t ) const {
+ const TypeNarrowPtr* tc = isa_same_narrowptr(t);
if (tc != NULL) {
if (_ptrtype->base() != tc->_ptrtype->base()) {
return false;
@@ -3697,22 +3727,46 @@
return false;
}
-bool TypeNarrowOop::singleton(void) const { // TRUE if type is a singleton
- return _ptrtype->singleton();
-}
-
-bool TypeNarrowOop::empty(void) const {
- return _ptrtype->empty();
+const Type *TypeNarrowPtr::xdual() const { // Compute dual right now.
+ const TypePtr* odual = _ptrtype->dual()->is_ptr();
+ return make_same_narrowptr(odual);
+}
+
+
+const Type *TypeNarrowPtr::filter( const Type *kills ) const {
+ if (isa_same_narrowptr(kills)) {
+ const Type* ft =_ptrtype->filter(is_same_narrowptr(kills)->_ptrtype);
+ if (ft->empty())
+ return Type::TOP; // Canonical empty value
+ if (ft->isa_ptr()) {
+ return make_hash_same_narrowptr(ft->isa_ptr());
+ }
+ return ft;
+ } else if (kills->isa_ptr()) {
+ const Type* ft = _ptrtype->join(kills);
+ if (ft->empty())
+ return Type::TOP; // Canonical empty value
+ return ft;
+ } else {
+ return Type::TOP;
+ }
}
//------------------------------xmeet------------------------------------------
// Compute the MEET of two types. It returns a new Type object.
-const Type *TypeNarrowOop::xmeet( const Type *t ) const {
+const Type *TypeNarrowPtr::xmeet( const Type *t ) const {
// Perform a fast test for common case; meeting the same types together.
if( this == t ) return this; // Meeting same type-rep?
-
- // Current "this->_base" is OopPtr
+ if (t->base() == base()) {
+ const Type* result = _ptrtype->xmeet(t->make_ptr());
+ if (result->isa_ptr()) {
+ return make_hash_same_narrowptr(result->is_ptr());
+ }
+ return result;
+ }
+
+ // Current "this->_base" is NarrowKlass or NarrowOop
switch (t->base()) { // switch on original type
case Int: // Mixing ints & oops happens when javac
@@ -3730,20 +3784,14 @@
case AryPtr:
case MetadataPtr:
case KlassPtr:
+ case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
return this;
- case NarrowOop: {
- const Type* result = _ptrtype->xmeet(t->make_ptr());
- if (result->isa_ptr()) {
- return TypeNarrowOop::make(result->is_ptr());
- }
- return result;
- }
-
default: // All else is a mistake
typerr(t);
@@ -3752,42 +3800,40 @@
return this;
}
-const Type *TypeNarrowOop::xdual() const { // Compute dual right now.
- const TypePtr* odual = _ptrtype->dual()->is_ptr();
- return new TypeNarrowOop(odual);
-}
-
-const Type *TypeNarrowOop::filter( const Type *kills ) const {
- if (kills->isa_narrowoop()) {
- const Type* ft =_ptrtype->filter(kills->is_narrowoop()->_ptrtype);
- if (ft->empty())
- return Type::TOP; // Canonical empty value
- if (ft->isa_ptr()) {
- return make(ft->isa_ptr());
- }
- return ft;
- } else if (kills->isa_ptr()) {
- const Type* ft = _ptrtype->join(kills);
- if (ft->empty())
- return Type::TOP; // Canonical empty value
- return ft;
- } else {
- return Type::TOP;
- }
-}
-
-
-intptr_t TypeNarrowOop::get_con() const {
- return _ptrtype->get_con();
-}
+#ifndef PRODUCT
+void TypeNarrowPtr::dump2( Dict & d, uint depth, outputStream *st ) const {
+ _ptrtype->dump2(d, depth, st);
+}
+#endif
+
+const TypeNarrowOop *TypeNarrowOop::BOTTOM;
+const TypeNarrowOop *TypeNarrowOop::NULL_PTR;
+
+
+const TypeNarrowOop* TypeNarrowOop::make(const TypePtr* type) {
+ return (const TypeNarrowOop*)(new TypeNarrowOop(type))->hashcons();
+}
+
#ifndef PRODUCT
void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const {
st->print("narrowoop: ");
- _ptrtype->dump2(d, depth, st);
+ TypeNarrowPtr::dump2(d, depth, st);
}
#endif
+const TypeNarrowKlass *TypeNarrowKlass::NULL_PTR;
+
+const TypeNarrowKlass* TypeNarrowKlass::make(const TypePtr* type) {
+ return (const TypeNarrowKlass*)(new TypeNarrowKlass(type))->hashcons();
+}
+
+#ifndef PRODUCT
+void TypeNarrowKlass::dump2( Dict & d, uint depth, outputStream *st ) const {
+ st->print("narrowklass: ");
+ TypeNarrowPtr::dump2(d, depth, st);
+}
+#endif
//------------------------------eq---------------------------------------------
@@ -3878,6 +3924,7 @@
case DoubleCon:
case DoubleBot:
case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
@@ -4169,6 +4216,7 @@
case DoubleCon:
case DoubleBot:
case NarrowOop:
+ case NarrowKlass:
case Bottom: // Ye Olde Default
return Type::BOTTOM;
case Top:
--- a/hotspot/src/share/vm/opto/type.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/type.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -48,7 +48,9 @@
class TypeF;
class TypeInt;
class TypeLong;
-class TypeNarrowOop;
+class TypeNarrowPtr;
+class TypeNarrowOop;
+class TypeNarrowKlass;
class TypeAry;
class TypeTuple;
class TypeVect;
@@ -81,6 +83,7 @@
Long, // Long integer range (lo-hi)
Half, // Placeholder half of doubleword
NarrowOop, // Compressed oop pointer
+ NarrowKlass, // Compressed klass pointer
Tuple, // Method signature or object layout
Array, // Array types
@@ -229,6 +232,7 @@
// Returns true if this pointer points at memory which contains a
// compressed oop references.
bool is_ptr_to_narrowoop() const;
+ bool is_ptr_to_narrowklass() const;
// Convenience access
float getf() const;
@@ -252,6 +256,8 @@
const TypeRawPtr *is_rawptr() const; // Asserts is rawptr
const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer
const TypeNarrowOop *isa_narrowoop() const; // Returns NULL if not oop ptr type
+ const TypeNarrowKlass *is_narrowklass() const; // compressed klass pointer
+ const TypeNarrowKlass *isa_narrowklass() const;// Returns NULL if not oop ptr type
const TypeOopPtr *isa_oopptr() const; // Returns NULL if not oop ptr type
const TypeOopPtr *is_oopptr() const; // Java-style GC'd pointer
const TypeInstPtr *isa_instptr() const; // Returns NULL if not InstPtr
@@ -278,6 +284,10 @@
// of this pointer type.
const TypeNarrowOop* make_narrowoop() const;
+ // Returns this compressed klass pointer or the equivalent
+ // compressed version of this pointer type.
+ const TypeNarrowKlass* make_narrowklass() const;
+
// Special test for register pressure heuristic
bool is_floatingpoint() const; // True if Float or Double base type
@@ -670,7 +680,7 @@
// Otherwise the _base will indicate which subset of pointers is affected,
// and the class will be inherited from.
class TypePtr : public Type {
- friend class TypeNarrowOop;
+ friend class TypeNarrowPtr;
public:
enum PTR { TopPTR, AnyNull, Constant, Null, NotNull, BotPTR, lastPTR };
protected:
@@ -781,6 +791,7 @@
// Does the type exclude subclasses of the klass? (Inexact == polymorphic.)
bool _klass_is_exact;
bool _is_ptr_to_narrowoop;
+ bool _is_ptr_to_narrowklass;
// If not InstanceTop or InstanceBot, indicates that this is
// a particular instance of this type which is distinct.
@@ -825,6 +836,7 @@
// Returns true if this pointer points at memory which contains a
// compressed oop references.
bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; }
+ bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; }
bool is_known_instance() const { return _instance_id > 0; }
int instance_id() const { return _instance_id; }
@@ -1122,22 +1134,21 @@
#endif
};
-//------------------------------TypeNarrowOop----------------------------------
-// A compressed reference to some kind of Oop. This type wraps around
-// a preexisting TypeOopPtr and forwards most of it's operations to
-// the underlying type. It's only real purpose is to track the
-// oopness of the compressed oop value when we expose the conversion
-// between the normal and the compressed form.
-class TypeNarrowOop : public Type {
+class TypeNarrowPtr : public Type {
protected:
const TypePtr* _ptrtype; // Could be TypePtr::NULL_PTR
- TypeNarrowOop( const TypePtr* ptrtype): Type(NarrowOop),
- _ptrtype(ptrtype) {
+ TypeNarrowPtr(TYPES t, const TypePtr* ptrtype): _ptrtype(ptrtype),
+ Type(t) {
assert(ptrtype->offset() == 0 ||
ptrtype->offset() == OffsetBot ||
ptrtype->offset() == OffsetTop, "no real offsets");
}
+
+ virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const = 0;
+ virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const = 0;
+ virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const = 0;
+ virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const = 0;
public:
virtual bool eq( const Type *t ) const;
virtual int hash() const; // Type specific hashing
@@ -1153,19 +1164,89 @@
virtual bool empty(void) const; // TRUE if type is vacuous
+ // returns the equivalent ptr type for this compressed pointer
+ const TypePtr *get_ptrtype() const {
+ return _ptrtype;
+ }
+
+#ifndef PRODUCT
+ virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
+#endif
+};
+
+//------------------------------TypeNarrowOop----------------------------------
+// A compressed reference to some kind of Oop. This type wraps around
+// a preexisting TypeOopPtr and forwards most of it's operations to
+// the underlying type. It's only real purpose is to track the
+// oopness of the compressed oop value when we expose the conversion
+// between the normal and the compressed form.
+class TypeNarrowOop : public TypeNarrowPtr {
+protected:
+ TypeNarrowOop( const TypePtr* ptrtype): TypeNarrowPtr(NarrowOop, ptrtype) {
+ }
+
+ virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const {
+ return t->isa_narrowoop();
+ }
+
+ virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const {
+ return t->is_narrowoop();
+ }
+
+ virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const {
+ return new TypeNarrowOop(t);
+ }
+
+ virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
+ return (const TypeNarrowPtr*)((new TypeNarrowOop(t))->hashcons());
+ }
+
+public:
+
static const TypeNarrowOop *make( const TypePtr* type);
static const TypeNarrowOop* make_from_constant(ciObject* con, bool require_constant = false) {
return make(TypeOopPtr::make_from_constant(con, require_constant));
}
- // returns the equivalent ptr type for this compressed pointer
- const TypePtr *get_ptrtype() const {
- return _ptrtype;
+ static const TypeNarrowOop *BOTTOM;
+ static const TypeNarrowOop *NULL_PTR;
+
+#ifndef PRODUCT
+ virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
+#endif
+};
+
+//------------------------------TypeNarrowKlass----------------------------------
+// A compressed reference to klass pointer. This type wraps around a
+// preexisting TypeKlassPtr and forwards most of it's operations to
+// the underlying type.
+class TypeNarrowKlass : public TypeNarrowPtr {
+protected:
+ TypeNarrowKlass( const TypePtr* ptrtype): TypeNarrowPtr(NarrowKlass, ptrtype) {
}
- static const TypeNarrowOop *BOTTOM;
- static const TypeNarrowOop *NULL_PTR;
+ virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const {
+ return t->isa_narrowklass();
+ }
+
+ virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const {
+ return t->is_narrowklass();
+ }
+
+ virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const {
+ return new TypeNarrowKlass(t);
+ }
+
+ virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
+ return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons());
+ }
+
+public:
+ static const TypeNarrowKlass *make( const TypePtr* type);
+
+ // static const TypeNarrowKlass *BOTTOM;
+ static const TypeNarrowKlass *NULL_PTR;
#ifndef PRODUCT
virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
@@ -1221,6 +1302,14 @@
#endif
}
+inline bool Type::is_ptr_to_narrowklass() const {
+#ifdef _LP64
+ return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowklass_nv());
+#else
+ return false;
+#endif
+}
+
inline float Type::getf() const {
assert( _base == FloatCon, "Not a FloatCon" );
return ((TypeF*)this)->_f;
@@ -1346,6 +1435,15 @@
return (_base == NarrowOop) ? (TypeNarrowOop*)this : NULL;
}
+inline const TypeNarrowKlass *Type::is_narrowklass() const {
+ assert(_base == NarrowKlass, "Not a narrow oop" ) ;
+ return (TypeNarrowKlass*)this;
+}
+
+inline const TypeNarrowKlass *Type::isa_narrowklass() const {
+ return (_base == NarrowKlass) ? (TypeNarrowKlass*)this : NULL;
+}
+
inline const TypeMetadataPtr *Type::is_metadataptr() const {
// MetadataPtr is the first and CPCachePtr the last
assert(_base == MetadataPtr, "Not a metadata pointer" ) ;
@@ -1367,7 +1465,8 @@
inline const TypePtr* Type::make_ptr() const {
return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() :
- (isa_ptr() ? is_ptr() : NULL);
+ ((_base == NarrowKlass) ? is_narrowklass()->get_ptrtype() :
+ (isa_ptr() ? is_ptr() : NULL));
}
inline const TypeOopPtr* Type::make_oopptr() const {
@@ -1379,6 +1478,11 @@
(isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL);
}
+inline const TypeNarrowKlass* Type::make_narrowklass() const {
+ return (_base == NarrowKlass) ? is_narrowklass() :
+ (isa_ptr() ? TypeNarrowKlass::make(is_ptr()) : NULL);
+}
+
inline bool Type::is_floatingpoint() const {
if( (_base == FloatCon) || (_base == FloatBot) ||
(_base == DoubleCon) || (_base == DoubleBot) )
--- a/hotspot/src/share/vm/prims/forte.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/forte.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2012, 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
@@ -30,7 +30,7 @@
class Forte : AllStatic {
public:
static void register_stub(const char* name, address start, address end)
- KERNEL_RETURN;
+ NOT_JVMTI_RETURN;
// register internal VM stub
};
--- a/hotspot/src/share/vm/prims/jni.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jni.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -2820,10 +2821,9 @@
JNI_QUICK_ENTRY(void, jni_Set##Result##Field(JNIEnv *env, jobject obj, jfieldID fieldID, Argument value)) \
JNIWrapper("Set" XSTR(Result) "Field"); \
\
- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, Set##Result##Field__entry, \
- ( JNIEnv*, jobject, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
- HS_DTRACE_PROBE_N(hotspot_jni, Set##Result##Field__entry, \
- ( env, obj, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
+ FP_SELECT_##Result( \
+ DTRACE_PROBE4(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID, value), \
+ DTRACE_PROBE3(hotspot_jni, Set##Result##Field__entry, env, obj, fieldID)); \
\
oop o = JNIHandles::resolve_non_null(obj); \
Klass* k = o->klass(); \
@@ -3003,9 +3003,9 @@
HOTSPOT_JNI_GETSTATICOBJECTFIELD_ENTRY(
env, clazz, (uintptr_t) fieldID);
#endif /* USDT2 */
-#ifndef JNICHECK_KERNEL
+#if INCLUDE_JNI_CHECK
DEBUG_ONLY(Klass* param_k = jniCheck::validate_class(thread, clazz);)
-#endif // JNICHECK_KERNEL
+#endif // INCLUDE_JNI_CHECK
JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID);
assert(id->is_static_field_id(), "invalid static field id");
// Keep JVMTI addition small and only check enabled flag here.
@@ -3130,10 +3130,9 @@
\
JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \
JNIWrapper("SetStatic" XSTR(Result) "Field"); \
- HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\
- ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
- HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \
- ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
+ FP_SELECT_##Result( \
+ DTRACE_PROBE4(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID, value), \
+ DTRACE_PROBE3(hotspot_jni, SetStatic##Result##Field__entry, env, clazz, fieldID)); \
\
JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \
assert(id->is_static_field_id(), "invalid static field id"); \
@@ -3442,8 +3441,8 @@
KlassHandle ek(THREAD, java_lang_Class::as_Klass(JNIHandles::resolve_non_null(elementClass)));
Klass* ako = Klass::cast(ek())->array_klass(CHECK_NULL);
KlassHandle ak = KlassHandle(THREAD, ako);
- objArrayKlass::cast(ak())->initialize(CHECK_NULL);
- objArrayOop result = objArrayKlass::cast(ak())->allocate(length, CHECK_NULL);
+ ObjArrayKlass::cast(ak())->initialize(CHECK_NULL);
+ objArrayOop result = ObjArrayKlass::cast(ak())->allocate(length, CHECK_NULL);
oop initial_value = JNIHandles::resolve(initialElement);
if (initial_value != NULL) { // array already initialized with NULL
for (int index = 0; index < length; index++) {
@@ -3502,7 +3501,7 @@
objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array));
oop v = JNIHandles::resolve(value);
if (a->is_within_bounds(index)) {
- if (v == NULL || v->is_a(objArrayKlass::cast(a->klass())->element_klass())) {
+ if (v == NULL || v->is_a(ObjArrayKlass::cast(a->klass())->element_klass())) {
a->obj_at_put(index, v);
} else {
THROW(vmSymbols::java_lang_ArrayStoreException());
@@ -3787,7 +3786,7 @@
THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); \
} else { \
if (len > 0) { \
- int sc = typeArrayKlass::cast(src->klass())->log2_element_size(); \
+ int sc = TypeArrayKlass::cast(src->klass())->log2_element_size(); \
memcpy((u_char*) buf, \
(u_char*) src->Tag##_at_addr(start), \
len << sc); \
@@ -3822,7 +3821,7 @@
THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); \
} else { \
if (len > 0) { \
- int sc = typeArrayKlass::cast(src->klass())->log2_element_size(); \
+ int sc = TypeArrayKlass::cast(src->klass())->log2_element_size(); \
memcpy((u_char*) buf, \
(u_char*) src->Tag##_at_addr(start), \
len << sc); \
@@ -3871,7 +3870,7 @@
THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); \
} else { \
if (len > 0) { \
- int sc = typeArrayKlass::cast(dst->klass())->log2_element_size(); \
+ int sc = TypeArrayKlass::cast(dst->klass())->log2_element_size(); \
memcpy((u_char*) dst->Tag##_at_addr(start), \
(u_char*) buf, \
len << sc); \
@@ -3906,7 +3905,7 @@
THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); \
} else { \
if (len > 0) { \
- int sc = typeArrayKlass::cast(dst->klass())->log2_element_size(); \
+ int sc = TypeArrayKlass::cast(dst->klass())->log2_element_size(); \
memcpy((u_char*) dst->Tag##_at_addr(start), \
(u_char*) buf, \
len << sc); \
@@ -3951,6 +3950,7 @@
// SetNativeMethodPrefix(es) functions in the JVM TI Spec for details.
static Method* find_prefixed_native(KlassHandle k,
Symbol* name, Symbol* signature, TRAPS) {
+#if INCLUDE_JVMTI
ResourceMark rm(THREAD);
Method* method;
int name_len = name->utf8_length();
@@ -3982,6 +3982,7 @@
name_len = trial_len;
name_str = trial_name_str;
}
+#endif // INCLUDE_JVMTI
return NULL; // not found
}
@@ -4251,7 +4252,7 @@
if (a->is_objArray()) {
type = T_OBJECT;
} else {
- type = typeArrayKlass::cast(a->klass())->element_type();
+ type = TypeArrayKlass::cast(a->klass())->element_type();
}
void* ret = arrayOop(a)->base(type);
#ifndef USDT2
@@ -4975,11 +4976,9 @@
// Returns the function structure
struct JNINativeInterface_* jni_functions() {
-#ifndef JNICHECK_KERNEL
+#if INCLUDE_JNI_CHECK
if (CheckJNICalls) return jni_functions_check();
-#else // JNICHECK_KERNEL
- if (CheckJNICalls) warning("-Xcheck:jni is not supported in kernel vm.");
-#endif // JNICHECK_KERNEL
+#endif // INCLUDE_JNI_CHECK
return &jni_NativeInterface;
}
--- a/hotspot/src/share/vm/prims/jniCheck.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jniCheck.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -290,7 +290,7 @@
if (elementType != -1) {
if (aOop->is_typeArray()) {
- BasicType array_type = typeArrayKlass::cast(aOop->klass())->element_type();
+ BasicType array_type = TypeArrayKlass::cast(aOop->klass())->element_type();
if (array_type != elementType)
ReportJNIFatalError(thr, fatal_element_type_mismatch);
} else if (aOop->is_objArray()) {
--- a/hotspot/src/share/vm/prims/jniExport.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jniExport.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/prims/jvm.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvm.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1048,7 +1048,7 @@
if (signers == NULL) return NULL;
// copy of the signers array
- Klass* element = objArrayKlass::cast(signers->klass())->element_klass();
+ Klass* element = ObjArrayKlass::cast(signers->klass())->element_klass();
objArrayOop signers_copy = oopFactory::new_objArray(element, signers->length(), CHECK_NULL);
for (int index = 0; index < signers->length(); index++) {
signers_copy->obj_at_put(index, signers->obj_at(index));
@@ -3302,10 +3302,10 @@
if (k->oop_is_typeArray()) {
// typeArray
- result = typeArrayKlass::cast(k)->allocate(length, CHECK_NULL);
+ result = TypeArrayKlass::cast(k)->allocate(length, CHECK_NULL);
} else if (k->oop_is_objArray()) {
// objArray
- objArrayKlass* oak = objArrayKlass::cast(k);
+ ObjArrayKlass* oak = ObjArrayKlass::cast(k);
oak->initialize(CHECK_NULL); // make sure class is initialized (matches Classic VM behavior)
result = oak->allocate(length, CHECK_NULL);
} else {
@@ -4193,7 +4193,7 @@
}
// check if threads is not an array of objects of Thread class
- Klass* k = objArrayKlass::cast(ah->klass())->element_klass();
+ Klass* k = ObjArrayKlass::cast(ah->klass())->element_klass();
if (k != SystemDictionary::Thread_klass()) {
THROW_(vmSymbols::java_lang_IllegalArgumentException(), 0);
}
--- a/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl Wed Jul 05 18:25:45 2017 +0200
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
- Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2010, 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,6 +37,8 @@
<xsl:call-template name="sourceHeader"/>
<xsl:text>
# include "precompiled.hpp"
+# include "utilities/macros.hpp"
+#if INCLUDE_JVMTI
# include "prims/jvmtiEnter.hpp"
# include "prims/jvmtiRawMonitor.hpp"
# include "prims/jvmtiUtil.hpp"
@@ -247,6 +249,7 @@
<xsl:text>
};
+#endif // INCLUDE_JVMTI
</xsl:text>
</xsl:template>
@@ -469,7 +472,7 @@
</xsl:text>
<xsl:if test="not(contains(@jkernel,'yes'))">
- <xsl:text>
#ifdef JVMTI_KERNEL 
</xsl:text>
+ <xsl:text>
#if !INCLUDE_JVMTI 
</xsl:text>
<xsl:text> return JVMTI_ERROR_NOT_AVAILABLE; 
</xsl:text>
<xsl:text>#else 
</xsl:text>
</xsl:if>
@@ -596,7 +599,7 @@
</xsl:text>
<xsl:if test="not(contains(@jkernel,'yes'))">
- <xsl:text>#endif // JVMTI_KERNEL
</xsl:text>
+ <xsl:text>#endif // INCLUDE_JVMTI
</xsl:text>
</xsl:if>
<xsl:text>}
</xsl:text>
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -56,7 +56,9 @@
private:
+#if INCLUDE_JVMTI
static JvmtiEnvBase* _head_environment; // head of environment list
+#endif // INCLUDE_JVMTI
static bool _globally_initialized;
static jvmtiPhase _phase;
@@ -129,7 +131,10 @@
friend class JvmtiEnvIterator;
JvmtiEnv* next_environment() { return (JvmtiEnv*)_next; }
void set_next_environment(JvmtiEnvBase* env) { _next = env; }
- static JvmtiEnv* head_environment() { return (JvmtiEnv*)_head_environment; }
+ static JvmtiEnv* head_environment() {
+ JVMTI_ONLY(return (JvmtiEnv*)_head_environment);
+ NOT_JVMTI(return NULL);
+ }
public:
--- a/hotspot/src/share/vm/prims/jvmtiExport.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -46,21 +46,18 @@
class JvmtiThreadState;
class AttachOperation;
-#ifndef JVMTI_KERNEL
-#define JVMTI_SUPPORT_FLAG(key) \
- private: \
- static bool _##key; \
- public: \
- inline static void set_##key(bool on) { _##key = (on != 0); } \
- inline static bool key() { return _##key; }
-#else // JVMTI_KERNEL
#define JVMTI_SUPPORT_FLAG(key) \
private: \
- const static bool _##key = false; \
+ static bool _##key; \
public: \
- inline static void set_##key(bool on) { report_unsupported(on); } \
- inline static bool key() { return _##key; }
-#endif // JVMTI_KERNEL
+ inline static void set_##key(bool on) { \
+ JVMTI_ONLY(_##key = (on != 0)); \
+ NOT_JVMTI(report_unsupported(on)); \
+ } \
+ inline static bool key() { \
+ JVMTI_ONLY(return _##key); \
+ NOT_JVMTI(return false); \
+ }
// This class contains the JVMTI interface for the rest of hotspot.
@@ -68,6 +65,8 @@
class JvmtiExport : public AllStatic {
friend class VMStructs;
private:
+
+#if INCLUDE_JVMTI
static int _field_access_count;
static int _field_modification_count;
@@ -75,6 +74,7 @@
static bool _can_hotswap_or_post_breakpoint;
static bool _can_modify_any_class;
static bool _can_walk_any_space;
+#endif // INCLUDE_JVMTI
JVMTI_SUPPORT_FLAG(can_get_source_debug_extension)
JVMTI_SUPPORT_FLAG(can_maintain_original_method_order)
@@ -125,10 +125,18 @@
// these should only be called by the friend class
friend class JvmtiManageCapabilities;
- inline static void set_can_modify_any_class(bool on) { _can_modify_any_class = (on != 0); }
- inline static void set_can_access_local_variables(bool on) { _can_access_local_variables = (on != 0); }
- inline static void set_can_hotswap_or_post_breakpoint(bool on) { _can_hotswap_or_post_breakpoint = (on != 0); }
- inline static void set_can_walk_any_space(bool on) { _can_walk_any_space = (on != 0); }
+ inline static void set_can_modify_any_class(bool on) {
+ JVMTI_ONLY(_can_modify_any_class = (on != 0);)
+ }
+ inline static void set_can_access_local_variables(bool on) {
+ JVMTI_ONLY(_can_access_local_variables = (on != 0);)
+ }
+ inline static void set_can_hotswap_or_post_breakpoint(bool on) {
+ JVMTI_ONLY(_can_hotswap_or_post_breakpoint = (on != 0);)
+ }
+ inline static void set_can_walk_any_space(bool on) {
+ JVMTI_ONLY(_can_walk_any_space = (on != 0);)
+ }
enum {
JVMTI_VERSION_MASK = 0x70000000,
@@ -144,7 +152,7 @@
// posts a DynamicCodeGenerated event (internal/private implementation).
// The public post_dynamic_code_generated* functions make use of the
// internal implementation. Also called from JvmtiDeferredEvent::post()
- static void post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) KERNEL_RETURN;
+ static void post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) NOT_JVMTI_RETURN;
private:
@@ -154,9 +162,9 @@
static void post_compiled_method_load(JvmtiEnv* env, const jmethodID method, const jint length,
const void *code_begin, const jint map_length,
- const jvmtiAddrLocationMap* map) KERNEL_RETURN;
+ const jvmtiAddrLocationMap* map) NOT_JVMTI_RETURN;
static void post_dynamic_code_generated(JvmtiEnv* env, const char *name, const void *code_begin,
- const void *code_end) KERNEL_RETURN;
+ const void *code_end) NOT_JVMTI_RETURN;
// The RedefineClasses() API breaks some invariants in the "regular"
// system. For example, there are sanity checks when GC'ing nmethods
@@ -178,9 +186,8 @@
static bool _has_redefined_a_class;
friend class VM_RedefineClasses;
inline static void set_has_redefined_a_class() {
- _has_redefined_a_class = true;
+ JVMTI_ONLY(_has_redefined_a_class = true;)
}
-
// Flag to indicate if the compiler has recorded all dependencies. When the
// can_redefine_classes capability is enabled in the OnLoad phase then the compiler
// records all dependencies from startup. However if the capability is first
@@ -191,7 +198,8 @@
public:
inline static bool has_redefined_a_class() {
- return _has_redefined_a_class;
+ JVMTI_ONLY(return _has_redefined_a_class);
+ NOT_JVMTI(return false);
}
inline static bool all_dependencies_are_recorded() {
@@ -204,120 +212,141 @@
// let JVMTI know that the JVM_OnLoad code is running
- static void enter_onload_phase();
+ static void enter_onload_phase() NOT_JVMTI_RETURN;
// let JVMTI know that the VM isn't up yet (and JVM_OnLoad code isn't running)
- static void enter_primordial_phase();
+ static void enter_primordial_phase() NOT_JVMTI_RETURN;
// let JVMTI know that the VM isn't up yet but JNI is live
- static void enter_start_phase();
+ static void enter_start_phase() NOT_JVMTI_RETURN;
// let JVMTI know that the VM is fully up and running now
- static void enter_live_phase();
+ static void enter_live_phase() NOT_JVMTI_RETURN;
// ------ can_* conditions (below) are set at OnLoad and never changed ------------
- inline static bool can_modify_any_class() { return _can_modify_any_class; }
- inline static bool can_access_local_variables() { return _can_access_local_variables; }
- inline static bool can_hotswap_or_post_breakpoint() { return _can_hotswap_or_post_breakpoint; }
- inline static bool can_walk_any_space() { return _can_walk_any_space; }
+ inline static bool can_modify_any_class() {
+ JVMTI_ONLY(return _can_modify_any_class);
+ NOT_JVMTI(return false);
+ }
+ inline static bool can_access_local_variables() {
+ JVMTI_ONLY(return _can_access_local_variables);
+ NOT_JVMTI(return false);
+ }
+ inline static bool can_hotswap_or_post_breakpoint() {
+ JVMTI_ONLY(return _can_hotswap_or_post_breakpoint);
+ NOT_JVMTI(return false);
+ }
+ inline static bool can_walk_any_space() {
+ JVMTI_ONLY(return _can_walk_any_space);
+ NOT_JVMTI(return false);
+ }
// field access management
- static address get_field_access_count_addr();
+ static address get_field_access_count_addr() NOT_JVMTI_RETURN_(0);
// field modification management
- static address get_field_modification_count_addr();
+ static address get_field_modification_count_addr() NOT_JVMTI_RETURN_(0);
// -----------------
- static bool is_jvmti_version(jint version) { return (version & JVMTI_VERSION_MASK) == JVMTI_VERSION_VALUE; }
- static bool is_jvmdi_version(jint version) { return (version & JVMTI_VERSION_MASK) == JVMDI_VERSION_VALUE; }
- static jint get_jvmti_interface(JavaVM *jvm, void **penv, jint version);
+ static bool is_jvmti_version(jint version) {
+ JVMTI_ONLY(return (version & JVMTI_VERSION_MASK) == JVMTI_VERSION_VALUE);
+ NOT_JVMTI(return false);
+ }
+ static bool is_jvmdi_version(jint version) {
+ JVMTI_ONLY(return (version & JVMTI_VERSION_MASK) == JVMDI_VERSION_VALUE);
+ NOT_JVMTI(return false);
+ }
+ static jint get_jvmti_interface(JavaVM *jvm, void **penv, jint version) NOT_JVMTI_RETURN_(0);
static void decode_version_values(jint version, int * major, int * minor,
- int * micro);
+ int * micro) NOT_JVMTI_RETURN;
// single stepping management methods
- static void at_single_stepping_point(JavaThread *thread, Method* method, address location) KERNEL_RETURN;
- static void expose_single_stepping(JavaThread *thread) KERNEL_RETURN;
- static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(false);
+ static void at_single_stepping_point(JavaThread *thread, Method* method, address location) NOT_JVMTI_RETURN;
+ static void expose_single_stepping(JavaThread *thread) NOT_JVMTI_RETURN;
+ static bool hide_single_stepping(JavaThread *thread) NOT_JVMTI_RETURN_(false);
// Methods that notify the debugger that something interesting has happened in the VM.
- static void post_vm_start ();
- static void post_vm_initialized ();
- static void post_vm_death ();
+ static void post_vm_start () NOT_JVMTI_RETURN;
+ static void post_vm_initialized () NOT_JVMTI_RETURN;
+ static void post_vm_death () NOT_JVMTI_RETURN;
- static void post_single_step (JavaThread *thread, Method* method, address location) KERNEL_RETURN;
- static void post_raw_breakpoint (JavaThread *thread, Method* method, address location) KERNEL_RETURN;
+ static void post_single_step (JavaThread *thread, Method* method, address location) NOT_JVMTI_RETURN;
+ static void post_raw_breakpoint (JavaThread *thread, Method* method, address location) NOT_JVMTI_RETURN;
- static void post_exception_throw (JavaThread *thread, Method* method, address location, oop exception) KERNEL_RETURN;
- static void notice_unwind_due_to_exception (JavaThread *thread, Method* method, address location, oop exception, bool in_handler_frame) KERNEL_RETURN;
+ static void post_exception_throw (JavaThread *thread, Method* method, address location, oop exception) NOT_JVMTI_RETURN;
+ static void notice_unwind_due_to_exception (JavaThread *thread, Method* method, address location, oop exception, bool in_handler_frame) NOT_JVMTI_RETURN;
static oop jni_GetField_probe (JavaThread *thread, jobject jobj,
oop obj, Klass* klass, jfieldID fieldID, bool is_static)
- KERNEL_RETURN_(NULL);
+ NOT_JVMTI_RETURN_(NULL);
static oop jni_GetField_probe_nh (JavaThread *thread, jobject jobj,
oop obj, Klass* klass, jfieldID fieldID, bool is_static)
- KERNEL_RETURN_(NULL);
+ NOT_JVMTI_RETURN_(NULL);
static void post_field_access_by_jni (JavaThread *thread, oop obj,
- Klass* klass, jfieldID fieldID, bool is_static) KERNEL_RETURN;
+ Klass* klass, jfieldID fieldID, bool is_static) NOT_JVMTI_RETURN;
static void post_field_access (JavaThread *thread, Method* method,
- address location, KlassHandle field_klass, Handle object, jfieldID field) KERNEL_RETURN;
+ address location, KlassHandle field_klass, Handle object, jfieldID field) NOT_JVMTI_RETURN;
static oop jni_SetField_probe (JavaThread *thread, jobject jobj,
oop obj, Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
- jvalue *value) KERNEL_RETURN_(NULL);
+ jvalue *value) NOT_JVMTI_RETURN_(NULL);
static oop jni_SetField_probe_nh (JavaThread *thread, jobject jobj,
oop obj, Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
- jvalue *value) KERNEL_RETURN_(NULL);
+ jvalue *value) NOT_JVMTI_RETURN_(NULL);
static void post_field_modification_by_jni(JavaThread *thread, oop obj,
Klass* klass, jfieldID fieldID, bool is_static, char sig_type,
jvalue *value);
static void post_raw_field_modification(JavaThread *thread, Method* method,
address location, KlassHandle field_klass, Handle object, jfieldID field,
- char sig_type, jvalue *value) KERNEL_RETURN;
+ char sig_type, jvalue *value) NOT_JVMTI_RETURN;
- static void post_method_entry (JavaThread *thread, Method* method, frame current_frame) KERNEL_RETURN;
- static void post_method_exit (JavaThread *thread, Method* method, frame current_frame) KERNEL_RETURN;
+ static void post_method_entry (JavaThread *thread, Method* method, frame current_frame) NOT_JVMTI_RETURN;
+ static void post_method_exit (JavaThread *thread, Method* method, frame current_frame) NOT_JVMTI_RETURN;
- static void post_class_load (JavaThread *thread, Klass* klass) KERNEL_RETURN;
- static void post_class_unload (Klass* klass) KERNEL_RETURN;
- static void post_class_prepare (JavaThread *thread, Klass* klass) KERNEL_RETURN;
+ static void post_class_load (JavaThread *thread, Klass* klass) NOT_JVMTI_RETURN;
+ static void post_class_unload (Klass* klass) NOT_JVMTI_RETURN;
+ static void post_class_prepare (JavaThread *thread, Klass* klass) NOT_JVMTI_RETURN;
- static void post_thread_start (JavaThread *thread) KERNEL_RETURN;
- static void post_thread_end (JavaThread *thread) KERNEL_RETURN;
+ static void post_thread_start (JavaThread *thread) NOT_JVMTI_RETURN;
+ static void post_thread_end (JavaThread *thread) NOT_JVMTI_RETURN;
// Support for java.lang.instrument agent loading.
static bool _should_post_class_file_load_hook;
inline static void set_should_post_class_file_load_hook(bool on) { _should_post_class_file_load_hook = on; }
- inline static bool should_post_class_file_load_hook() { return _should_post_class_file_load_hook; }
+ inline static bool should_post_class_file_load_hook() {
+ JVMTI_ONLY(return _should_post_class_file_load_hook);
+ NOT_JVMTI(return false;)
+ }
static void post_class_file_load_hook(Symbol* h_name, Handle class_loader,
Handle h_protection_domain,
unsigned char **data_ptr, unsigned char **end_ptr,
unsigned char **cached_data_ptr,
- jint *cached_length_ptr);
- static void post_native_method_bind(Method* method, address* function_ptr) KERNEL_RETURN;
- static void post_compiled_method_load(nmethod *nm) KERNEL_RETURN;
- static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) KERNEL_RETURN;
+ jint *cached_length_ptr) NOT_JVMTI_RETURN;
+ static void post_native_method_bind(Method* method, address* function_ptr) NOT_JVMTI_RETURN;
+ static void post_compiled_method_load(nmethod *nm) NOT_JVMTI_RETURN;
+ static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) NOT_JVMTI_RETURN;
// used to post a CompiledMethodUnload event
- static void post_compiled_method_unload(jmethodID mid, const void *code_begin) KERNEL_RETURN;
+ static void post_compiled_method_unload(jmethodID mid, const void *code_begin) NOT_JVMTI_RETURN;
// similiar to post_dynamic_code_generated except that it can be used to
// post a DynamicCodeGenerated event while holding locks in the VM. Any event
// posted using this function is recorded by the enclosing event collector
// -- JvmtiDynamicCodeEventCollector.
- static void post_dynamic_code_generated_while_holding_locks(const char* name, address code_begin, address code_end) KERNEL_RETURN;
+ static void post_dynamic_code_generated_while_holding_locks(const char* name, address code_begin, address code_end) NOT_JVMTI_RETURN;
- static void post_garbage_collection_finish() KERNEL_RETURN;
- static void post_garbage_collection_start() KERNEL_RETURN;
- static void post_data_dump() KERNEL_RETURN;
- static void post_monitor_contended_enter(JavaThread *thread, ObjectMonitor *obj_mntr) KERNEL_RETURN;
- static void post_monitor_contended_entered(JavaThread *thread, ObjectMonitor *obj_mntr) KERNEL_RETURN;
- static void post_monitor_wait(JavaThread *thread, oop obj, jlong timeout) KERNEL_RETURN;
- static void post_monitor_waited(JavaThread *thread, ObjectMonitor *obj_mntr, jboolean timed_out) KERNEL_RETURN;
- static void post_object_free(JvmtiEnv* env, jlong tag) KERNEL_RETURN;
- static void post_resource_exhausted(jint resource_exhausted_flags, const char* detail) KERNEL_RETURN;
- static void record_vm_internal_object_allocation(oop object) KERNEL_RETURN;
+ static void post_garbage_collection_finish() NOT_JVMTI_RETURN;
+ static void post_garbage_collection_start() NOT_JVMTI_RETURN;
+ static void post_data_dump() NOT_JVMTI_RETURN;
+ static void post_monitor_contended_enter(JavaThread *thread, ObjectMonitor *obj_mntr) NOT_JVMTI_RETURN;
+ static void post_monitor_contended_entered(JavaThread *thread, ObjectMonitor *obj_mntr) NOT_JVMTI_RETURN;
+ static void post_monitor_wait(JavaThread *thread, oop obj, jlong timeout) NOT_JVMTI_RETURN;
+ static void post_monitor_waited(JavaThread *thread, ObjectMonitor *obj_mntr, jboolean timed_out) NOT_JVMTI_RETURN;
+ static void post_object_free(JvmtiEnv* env, jlong tag) NOT_JVMTI_RETURN;
+ static void post_resource_exhausted(jint resource_exhausted_flags, const char* detail) NOT_JVMTI_RETURN;
+ static void record_vm_internal_object_allocation(oop object) NOT_JVMTI_RETURN;
// Post objects collected by vm_object_alloc_event_collector.
- static void post_vm_object_alloc(JavaThread *thread, oop object) KERNEL_RETURN;
+ static void post_vm_object_alloc(JavaThread *thread, oop object) NOT_JVMTI_RETURN;
// Collects vm internal objects for later event posting.
inline static void vm_object_alloc_event_collector(oop object) {
if (should_post_vm_object_alloc()) {
@@ -331,21 +360,19 @@
}
}
- static void cleanup_thread (JavaThread* thread) KERNEL_RETURN;
-
- static void oops_do(OopClosure* f) KERNEL_RETURN;
- static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) KERNEL_RETURN;
- static void gc_epilogue() KERNEL_RETURN;
+ static void cleanup_thread (JavaThread* thread) NOT_JVMTI_RETURN;
- static void transition_pending_onload_raw_monitors() KERNEL_RETURN;
+ static void oops_do(OopClosure* f) NOT_JVMTI_RETURN;
+ static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) NOT_JVMTI_RETURN;
+ static void gc_epilogue() NOT_JVMTI_RETURN;
-#ifndef SERVICES_KERNEL
+ static void transition_pending_onload_raw_monitors() NOT_JVMTI_RETURN;
+
// attach support
- static jint load_agent_library(AttachOperation* op, outputStream* out);
-#endif // SERVICES_KERNEL
+ static jint load_agent_library(AttachOperation* op, outputStream* out) NOT_JVMTI_RETURN_(JNI_ERR);
// SetNativeMethodPrefix support
- static char** get_all_native_method_prefixes(int* count_ptr);
+ static char** get_all_native_method_prefixes(int* count_ptr) NOT_JVMTI_RETURN_(NULL);
};
// Support class used by JvmtiDynamicCodeEventCollector and others. It
@@ -408,8 +435,8 @@
void register_stub(const char* name, address start, address end);
public:
- JvmtiDynamicCodeEventCollector() KERNEL_RETURN;
- ~JvmtiDynamicCodeEventCollector() KERNEL_RETURN;
+ JvmtiDynamicCodeEventCollector() NOT_JVMTI_RETURN;
+ ~JvmtiDynamicCodeEventCollector() NOT_JVMTI_RETURN;
bool is_dynamic_code_event() { return true; }
};
@@ -441,8 +468,8 @@
static void oops_do_for_all_threads(OopClosure* f);
public:
- JvmtiVMObjectAllocEventCollector() KERNEL_RETURN;
- ~JvmtiVMObjectAllocEventCollector() KERNEL_RETURN;
+ JvmtiVMObjectAllocEventCollector() NOT_JVMTI_RETURN;
+ ~JvmtiVMObjectAllocEventCollector() NOT_JVMTI_RETURN;
bool is_vm_object_alloc_event() { return true; }
bool is_enabled() { return _enable; }
@@ -472,16 +499,16 @@
bool was_enabled() { return _collector != NULL; }
public:
- NoJvmtiVMObjectAllocMark() KERNEL_RETURN;
- ~NoJvmtiVMObjectAllocMark() KERNEL_RETURN;
+ NoJvmtiVMObjectAllocMark() NOT_JVMTI_RETURN;
+ ~NoJvmtiVMObjectAllocMark() NOT_JVMTI_RETURN;
};
// Base class for reporting GC events to JVMTI.
class JvmtiGCMarker : public StackObj {
public:
- JvmtiGCMarker() KERNEL_RETURN;
- ~JvmtiGCMarker() KERNEL_RETURN;
+ JvmtiGCMarker() NOT_JVMTI_RETURN;
+ ~JvmtiGCMarker() NOT_JVMTI_RETURN;
};
// JvmtiHideSingleStepping is a helper class for hiding
--- a/hotspot/src/share/vm/prims/jvmtiExtensions.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiExtensions.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -481,15 +481,15 @@
// Factory methods
static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm)
- KERNEL_RETURN_(JvmtiDeferredEvent());
+ NOT_JVMTI_RETURN_(JvmtiDeferredEvent());
static JvmtiDeferredEvent compiled_method_unload_event(nmethod* nm,
- jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent());
+ jmethodID id, const void* code) NOT_JVMTI_RETURN_(JvmtiDeferredEvent());
static JvmtiDeferredEvent dynamic_code_generated_event(
const char* name, const void* begin, const void* end)
- KERNEL_RETURN_(JvmtiDeferredEvent());
+ NOT_JVMTI_RETURN_(JvmtiDeferredEvent());
// Actually posts the event.
- void post() KERNEL_RETURN;
+ void post() NOT_JVMTI_RETURN;
};
/**
@@ -520,13 +520,13 @@
static volatile QueueNode* _pending_list; // Uses CAS for read/update
// Transfers events from the _pending_list to the _queue.
- static void process_pending_events() KERNEL_RETURN;
+ static void process_pending_events() NOT_JVMTI_RETURN;
public:
// Must be holding Service_lock when calling these
- static bool has_events() KERNEL_RETURN_(false);
- static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN;
- static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent());
+ static bool has_events() NOT_JVMTI_RETURN_(false);
+ static void enqueue(const JvmtiDeferredEvent& event) NOT_JVMTI_RETURN;
+ static JvmtiDeferredEvent dequeue() NOT_JVMTI_RETURN_(JvmtiDeferredEvent());
// Used to enqueue events without using a lock, for times (such as during
// safepoint) when we can't or don't want to lock the Service_lock.
@@ -534,7 +534,7 @@
// Events will be held off to the side until there's a call to
// dequeue(), enqueue(), or process_pending_events() (all of which require
// the holding of the Service_lock), and will be enqueued at that time.
- static void add_pending_event(const JvmtiDeferredEvent&) KERNEL_RETURN;
+ static void add_pending_event(const JvmtiDeferredEvent&) NOT_JVMTI_RETURN;
};
// Utility macro that checks for NULL pointers:
--- a/hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiRawMonitor.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -2606,7 +2606,7 @@
void VM_RedefineClasses::adjust_array_vtable(Klass* k_oop) {
- arrayKlass* ak = arrayKlass::cast(k_oop);
+ ArrayKlass* ak = ArrayKlass::cast(k_oop);
bool trace_name_printed = false;
ak->vtable()->adjust_method_entries(_matching_old_methods,
_matching_new_methods,
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -495,9 +495,9 @@
class MetadataOnStackMark : public StackObj {
NOT_PRODUCT(static bool _is_active;)
public:
- MetadataOnStackMark();
- ~MetadataOnStackMark();
- static void record(Metadata* m);
+ MetadataOnStackMark() NOT_JVMTI_RETURN;
+ ~MetadataOnStackMark() NOT_JVMTI_RETURN;
+ static void record(Metadata* m) NOT_JVMTI_RETURN;
};
#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSES_HPP
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1075,7 +1075,7 @@
// get base address of first element
typeArrayOop array = typeArrayOop(obj);
- BasicType type = typeArrayKlass::cast(array->klass())->element_type();
+ BasicType type = TypeArrayKlass::cast(array->klass())->element_type();
void* elements = array->base(type);
// jvmtiPrimitiveType is defined so this mapping is always correct
@@ -2750,7 +2750,7 @@
objArrayOop array = objArrayOop(o);
// array reference to its class
- oop mirror = objArrayKlass::cast(array->klass())->java_mirror();
+ oop mirror = ObjArrayKlass::cast(array->klass())->java_mirror();
if (!CallbackInvoker::report_class_reference(o, mirror)) {
return false;
}
@@ -2862,9 +2862,8 @@
oop entry;
if (tag.is_string()) {
entry = pool->resolved_string_at(i);
- // If the entry is non-null it it resolved.
+ // If the entry is non-null it is resolved.
if (entry == NULL) continue;
- assert(java_lang_String::is_instance(entry), "must be string");
} else {
entry = Klass::cast(pool->resolved_klass_at(i))->java_mirror();
}
--- a/hotspot/src/share/vm/prims/jvmtiTagMap.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiTagMap.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -125,7 +125,7 @@
jlong** tag_result_ptr);
static void weak_oops_do(
- BoolObjectClosure* is_alive, OopClosure* f) KERNEL_RETURN;
+ BoolObjectClosure* is_alive, OopClosure* f) NOT_JVMTI_RETURN;
};
#endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP
--- a/hotspot/src/share/vm/prims/jvmtiThreadState.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiThreadState.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -391,7 +391,7 @@
static ByteSize earlyret_oop_offset() { return byte_offset_of(JvmtiThreadState, _earlyret_oop); }
static ByteSize earlyret_value_offset() { return byte_offset_of(JvmtiThreadState, _earlyret_value); }
- void oops_do(OopClosure* f); // GC support
+ void oops_do(OopClosure* f) NOT_JVMTI_RETURN; // GC support
public:
void set_should_post_on_exceptions(bool val) { _thread->set_should_post_on_exceptions_flag(val ? JNI_TRUE : JNI_FALSE); }
--- a/hotspot/src/share/vm/prims/jvmtiUtil.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiUtil.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/prims/methodHandles.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -563,15 +563,6 @@
return Klass::cast(SystemDictionary::Class_klass())->java_mirror();
} else if (s == vmSymbols::string_signature()) {
return Klass::cast(SystemDictionary::String_klass())->java_mirror();
- } else {
- int len = s->utf8_length();
- if (s->byte_at(0) == 'L' && s->byte_at(len-1) == ';') {
- TempNewSymbol cname = SymbolTable::probe((const char*)&s->bytes()[1], len-2);
- if (cname == NULL) return NULL;
- Klass* wkk = SystemDictionary::find_well_known_klass(cname);
- if (wkk == NULL) return NULL;
- return Klass::cast(wkk)->java_mirror();
- }
}
}
return NULL;
--- a/hotspot/src/share/vm/prims/methodHandles.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/methodHandles.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -196,7 +196,27 @@
# include "methodHandles_ppc.hpp"
#endif
-
+ // Tracing
+ static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
+ static void trace_method_handle_interpreter_entry(MacroAssembler* _masm, vmIntrinsics::ID iid) {
+ if (TraceMethodHandles) {
+ const char* name = vmIntrinsics::name_at(iid);
+ if (*name == '_') name += 1;
+ const size_t len = strlen(name) + 50;
+ char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
+ const char* suffix = "";
+ if (is_signature_polymorphic(iid)) {
+ if (is_signature_polymorphic_static(iid))
+ suffix = "/static";
+ else
+ suffix = "/private";
+ }
+ jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
+ trace_method_handle(_masm, qname);
+ // Note: Don't free the allocated char array because it's used
+ // during runtime.
+ }
+ }
};
--- a/hotspot/src/share/vm/prims/nativeLookup.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/nativeLookup.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -328,6 +328,7 @@
// native implementation again.
// See SetNativeMethodPrefix in the JVM TI Spec for more details.
address NativeLookup::lookup_entry_prefixed(methodHandle method, bool& in_base_library, TRAPS) {
+#if INCLUDE_JVMTI
ResourceMark rm(THREAD);
int prefix_count;
@@ -358,6 +359,7 @@
}
}
}
+#endif // INCLUDE_JVMTI
return NULL;
}
--- a/hotspot/src/share/vm/prims/unsafe.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/prims/unsafe.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -802,7 +802,7 @@
base = arrayOopDesc::base_offset_in_bytes(T_OBJECT);
scale = heapOopSize;
} else if (k->oop_is_typeArray()) {
- typeArrayKlass* tak = typeArrayKlass::cast(k);
+ TypeArrayKlass* tak = TypeArrayKlass::cast(k);
base = tak->array_header_in_bytes();
assert(base == arrayOopDesc::base_offset_in_bytes(tak->element_type()), "array_header_size semantics ok");
scale = (1 << tak->log2_element_size());
--- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -156,7 +156,7 @@
// Called with the queue locked and with at least one element
CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) {
CompileTask *max_task = NULL;
- Method* max_method;
+ Method* max_method = NULL;
jlong t = os::javaTimeMillis();
// Iterate through the queue and find a method with a maximum rate.
for (CompileTask* task = compile_queue->first(); task != NULL;) {
--- a/hotspot/src/share/vm/runtime/arguments.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1066,7 +1066,7 @@
}
}
-#ifndef KERNEL
+#if INCLUDE_ALTERNATE_GCS
static void disable_adaptive_size_policy(const char* collector_name) {
if (UseAdaptiveSizePolicy) {
if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
@@ -1141,7 +1141,7 @@
FLAG_SET_ERGO(bool, UseParNewGC, true);
}
- // Turn off AdaptiveSizePolicy for CMS until it is complete.
+ // Turn off AdaptiveSizePolicy by default for cms until it is complete.
disable_adaptive_size_policy("UseConcMarkSweepGC");
// In either case, adjust ParallelGCThreads and/or UseParNewGC
@@ -1283,7 +1283,7 @@
tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
}
}
-#endif // KERNEL
+#endif // INCLUDE_ALTERNATE_GCS
void set_object_alignment() {
// Object alignment.
@@ -1300,10 +1300,10 @@
// Oop encoding heap max
OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
-#ifndef KERNEL
+#if INCLUDE_ALTERNATE_GCS
// Set CMS global values
CompactibleFreeListSpace::set_cms_values();
-#endif // KERNEL
+#endif // INCLUDE_ALTERNATE_GCS
}
bool verify_object_alignment() {
@@ -1423,10 +1423,9 @@
FLAG_SET_DEFAULT(UseCompressedKlassPointers, false);
} else {
// Turn on UseCompressedKlassPointers too
- // The compiler is broken for this so turn it on when the compiler is fixed.
- // if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
- // FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
- // }
+ if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) {
+ FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true);
+ }
// Set the ClassMetaspaceSize to something that will not need to be
// expanded, since it cannot be expanded.
if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) {
@@ -1991,9 +1990,15 @@
}
#endif // SPARC
- if (PrintNMTStatistics && MemTracker::tracking_level() == MemTracker::NMT_off) {
- warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
- PrintNMTStatistics = false;
+ if (PrintNMTStatistics) {
+#if INCLUDE_NMT
+ if (MemTracker::tracking_level() == MemTracker::NMT_off) {
+#endif // INCLUDE_NMT
+ warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled");
+ PrintNMTStatistics = false;
+#if INCLUDE_NMT
+ }
+#endif
}
return status;
@@ -2220,12 +2225,12 @@
size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied.
options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2);
}
-#ifdef JVMTI_KERNEL
+#if !INCLUDE_JVMTI
if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
- warning("profiling and debugging agents are not supported with Kernel VM");
+ warning("profiling and debugging agents are not supported in this VM");
} else
-#endif // JVMTI_KERNEL
- add_init_library(name, options);
+#endif // !INCLUDE_JVMTI
+ add_init_library(name, options);
}
// -agentlib and -agentpath
} else if (match_option(option, "-agentlib:", &tail) ||
@@ -2240,20 +2245,24 @@
if(pos != NULL) {
options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1);
}
-#ifdef JVMTI_KERNEL
+#if !INCLUDE_JVMTI
if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
- warning("profiling and debugging agents are not supported with Kernel VM");
+ warning("profiling and debugging agents are not supported in this VM");
} else
-#endif // JVMTI_KERNEL
+#endif // !INCLUDE_JVMTI
add_init_agent(name, options, is_absolute_path);
}
// -javaagent
} else if (match_option(option, "-javaagent:", &tail)) {
+#if !INCLUDE_JVMTI
+ warning("Instrumentation agents are not supported in this VM");
+#else
if(tail != NULL) {
char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail);
add_init_agent("instrument", options, false);
}
+#endif // !INCLUDE_JVMTI
// -Xnoclassgc
} else if (match_option(option, "-Xnoclassgc", &tail)) {
FLAG_SET_CMDLINE(bool, ClassUnloading, false);
@@ -2385,12 +2394,12 @@
// EVM option, ignore silently for compatibility
// -Xprof
} else if (match_option(option, "-Xprof", &tail)) {
-#ifndef FPROF_KERNEL
+#if INCLUDE_FPROF
_has_profile = true;
-#else // FPROF_KERNEL
+#else // INCLUDE_FPROF
// do we have to exit?
- warning("Kernel VM does not support flat profiling.");
-#endif // FPROF_KERNEL
+ warning("Flat profiling is not supported in this VM.");
+#endif // INCLUDE_FPROF
// -Xaprof
} else if (match_option(option, "-Xaprof", &tail)) {
_has_alloc_profile = true;
@@ -2438,6 +2447,9 @@
#if defined(KERNEL)
vm_exit_during_initialization(
"Dumping a shared archive is not supported on the Kernel JVM.", NULL);
+#elif !INCLUDE_CDS
+ vm_exit_during_initialization(
+ "Dumping a shared archive is not supported in this VM.", NULL);
#else
FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
set_mode_flags(_int); // Prevent compilation, which creates objects
@@ -2490,7 +2502,11 @@
// JNI hooks
} else if (match_option(option, "-Xcheck", &tail)) {
if (!strcmp(tail, ":jni")) {
+#if !INCLUDE_JNI_CHECK
+ warning("JNI CHECKING is not supported in this VM");
+#else
CheckJNICalls = true;
+#endif // INCLUDE_JNI_CHECK
} else if (is_bad_option(option, args->ignoreUnrecognized,
"check")) {
return JNI_EINVAL;
@@ -3045,7 +3061,11 @@
vm_exit(0);
}
if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
+#if INCLUDE_NMT
MemTracker::init_tracking_options(tail);
+#else
+ warning("Native Memory Tracking is not supported in this VM");
+#endif
}
@@ -3108,6 +3128,21 @@
UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
#endif
+#if !INCLUDE_ALTERNATE_GCS
+ if (UseParallelGC) {
+ warning("Parallel GC is not supported in this VM. Using Serial GC.");
+ }
+ if (UseParallelOldGC) {
+ warning("Parallel Old GC is not supported in this VM. Using Serial GC.");
+ }
+ if (UseConcMarkSweepGC) {
+ warning("Concurrent Mark Sweep GC is not supported in this VM. Using Serial GC.");
+ }
+ if (UseParNewGC) {
+ warning("Par New GC is not supported in this VM. Using Serial GC.");
+ }
+#endif // INCLUDE_ALTERNATE_GCS
+
#ifndef PRODUCT
if (TraceBytecodesAt != 0) {
TraceBytecodes = true;
@@ -3156,9 +3191,9 @@
#ifdef SERIALGC
force_serial_gc();
#endif // SERIALGC
-#ifdef KERNEL
+#if !INCLUDE_CDS
no_shared_spaces();
-#endif // KERNEL
+#endif // INCLUDE_CDS
// Set flags based on ergonomics.
set_ergonomics_flags();
@@ -3180,9 +3215,10 @@
}
}
-#ifndef KERNEL
// Set heap size based on available physical memory
set_heap_size();
+
+#if INCLUDE_ALTERNATE_GCS
// Set per-collector flags
if (UseParallelGC || UseParallelOldGC) {
set_parallel_gc_flags();
@@ -3193,7 +3229,7 @@
} else if (UseG1GC) {
set_g1_gc_flags();
}
-#endif // KERNEL
+#endif // INCLUDE_ALTERNATE_GCS
#ifdef SERIALGC
assert(verify_serial_gc_flags(), "SerialGC unset");
--- a/hotspot/src/share/vm/runtime/arguments.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -233,6 +233,7 @@
return_value = Handle(thread, result);
assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
if (TraceDeoptimization) {
+ ttyLocker ttyl;
tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, result, thread);
}
}
@@ -493,6 +494,7 @@
if (array->frames() > 1) {
if (VerifyStack && TraceDeoptimization) {
+ ttyLocker ttyl;
tty->print_cr("Deoptimizing method containing inlining");
}
}
@@ -573,6 +575,7 @@
#ifndef PRODUCT
if (TraceDeoptimization) {
+ ttyLocker ttyl;
tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d", thread, array, exec_mode);
}
#endif
@@ -755,12 +758,12 @@
InstanceKlass* ik = InstanceKlass::cast(k());
obj = ik->allocate_instance(CHECK_(false));
} else if (k->oop_is_typeArray()) {
- typeArrayKlass* ak = typeArrayKlass::cast(k());
+ TypeArrayKlass* ak = TypeArrayKlass::cast(k());
assert(sv->field_size() % type2size[ak->element_type()] == 0, "non-integral array length");
int len = sv->field_size() / type2size[ak->element_type()];
obj = ak->allocate(len, CHECK_(false));
} else if (k->oop_is_objArray()) {
- objArrayKlass* ak = objArrayKlass::cast(k());
+ ObjArrayKlass* ak = ObjArrayKlass::cast(k());
obj = ak->allocate(sv->field_size(), CHECK_(false));
}
@@ -923,7 +926,7 @@
FieldReassigner reassign(fr, reg_map, sv, obj());
ik->do_nonstatic_fields(&reassign);
} else if (k->oop_is_typeArray()) {
- typeArrayKlass* ak = typeArrayKlass::cast(k());
+ TypeArrayKlass* ak = TypeArrayKlass::cast(k());
reassign_type_array_elements(fr, reg_map, sv, (typeArrayOop) obj(), ak->element_type());
} else if (k->oop_is_objArray()) {
reassign_object_array_elements(fr, reg_map, sv, (objArrayOop) obj());
@@ -1322,9 +1325,9 @@
if (TraceDeoptimization) { // make noise on the tty
tty->print("Uncommon trap occurred in");
nm->method()->print_short_name(tty);
- tty->print(" (@" INTPTR_FORMAT ") thread=%d reason=%s action=%s unloaded_class_index=%d",
+ tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d",
fr.pc(),
- (int) os::current_thread_id(),
+ os::current_thread_id(),
trap_reason_name(reason),
trap_action_name(action),
unloaded_class_index);
--- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/fprofiler.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/fprofiler.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -65,15 +65,15 @@
// For now, the only thread-specific region is the class loader.
enum Region { noRegion, classLoaderRegion, extraRegion, maxRegion };
- ThreadProfilerMark(Region) KERNEL_RETURN;
- ~ThreadProfilerMark() KERNEL_RETURN;
+ ThreadProfilerMark(Region) NOT_FPROF_RETURN;
+ ~ThreadProfilerMark() NOT_FPROF_RETURN;
private:
ThreadProfiler* _pp;
Region _r;
};
-#ifndef FPROF_KERNEL
+#if INCLUDE_FPROF
class IntervalData VALUE_OBJ_CLASS_SPEC {
// Just to keep these things all together
@@ -119,29 +119,29 @@
static void print_header(outputStream* st);
void print_data(outputStream* st);
};
-#endif // FPROF_KERNEL
+#endif // INCLUDE_FPROF
class ThreadProfiler: public CHeapObj<mtInternal> {
public:
- ThreadProfiler() KERNEL_RETURN;
- ~ThreadProfiler() KERNEL_RETURN;
+ ThreadProfiler() NOT_FPROF_RETURN;
+ ~ThreadProfiler() NOT_FPROF_RETURN;
// Resets the profiler
- void reset() KERNEL_RETURN;
+ void reset() NOT_FPROF_RETURN;
// Activates the profiler for a certain thread
- void engage() KERNEL_RETURN;
+ void engage() NOT_FPROF_RETURN;
// Deactivates the profiler
- void disengage() KERNEL_RETURN;
+ void disengage() NOT_FPROF_RETURN;
// Prints the collected profiling information
- void print(const char* thread_name) KERNEL_RETURN;
+ void print(const char* thread_name) NOT_FPROF_RETURN;
// Garbage Collection Support
- void oops_do(OopClosure* f) KERNEL_RETURN;
+ void oops_do(OopClosure* f) NOT_FPROF_RETURN;
-#ifndef FPROF_KERNEL
+#if INCLUDE_FPROF
private:
// for recording ticks.
friend class ProfilerNode;
@@ -225,39 +225,39 @@
IntervalData* interval_data_ref() {
return &_interval_data;
}
-#endif // FPROF_KERNEL
+#endif // INCLUDE_FPROF
};
class FlatProfiler: AllStatic {
public:
- static void reset() KERNEL_RETURN ;
- static void engage(JavaThread* mainThread, bool fullProfile) KERNEL_RETURN ;
- static void disengage() KERNEL_RETURN ;
- static void print(int unused) KERNEL_RETURN ;
- static bool is_active() KERNEL_RETURN_(false) ;
+ static void reset() NOT_FPROF_RETURN ;
+ static void engage(JavaThread* mainThread, bool fullProfile) NOT_FPROF_RETURN ;
+ static void disengage() NOT_FPROF_RETURN ;
+ static void print(int unused) NOT_FPROF_RETURN ;
+ static bool is_active() NOT_FPROF_RETURN_(false) ;
// This is NULL if each thread has its own thread profiler,
// else this is the single thread profiler used by all threads.
// In particular it makes a difference during garbage collection,
// where you only want to traverse each thread profiler once.
- static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(NULL);
+ static ThreadProfiler* get_thread_profiler() NOT_FPROF_RETURN_(NULL);
// Garbage Collection Support
- static void oops_do(OopClosure* f) KERNEL_RETURN ;
+ static void oops_do(OopClosure* f) NOT_FPROF_RETURN ;
// Support for disassembler to inspect the PCRecorder
// Returns the start address for a given pc
// NULL is returned if the PCRecorder is inactive
- static address bucket_start_for(address pc) KERNEL_RETURN_(NULL);
+ static address bucket_start_for(address pc) NOT_FPROF_RETURN_(NULL);
enum { MillisecsPerTick = 10 }; // ms per profiling ticks
// Returns the number of ticks recorded for the bucket
// pc belongs to.
- static int bucket_count_for(address pc) KERNEL_RETURN_(0);
+ static int bucket_count_for(address pc) NOT_FPROF_RETURN_(0);
-#ifndef FPROF_KERNEL
+#if INCLUDE_FPROF
private:
static bool full_profile() {
@@ -324,7 +324,7 @@
static void interval_reset(); // reset interval data.
enum {interval_print_size = 10};
static IntervalData* interval_data;
-#endif // FPROF_KERNEL
+#endif // INCLUDE_FPROF
};
#endif // SHARE_VM_RUNTIME_FPROFILER_HPP
--- a/hotspot/src/share/vm/runtime/globals.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1000,9 +1000,6 @@
product(bool, ClassUnloading, true, \
"Do unloading of classes") \
\
- diagnostic(bool, LinkWellKnownClasses, false, \
- "Resolve a well known class as soon as its name is seen") \
- \
develop(bool, DisableStartThread, false, \
"Disable starting of additional Java threads " \
"(for debugging only)") \
@@ -1066,9 +1063,6 @@
\
product(bool, MonitorInUseLists, false, "Track Monitors for Deflation") \
\
- product(intx, Atomics, 0, \
- "(Unsafe,Unstable) Diagnostic - Controls emission of atomics") \
- \
product(intx, SyncFlags, 0, "(Unsafe,Unstable) Experimental Sync flags" ) \
\
product(intx, SyncVerbose, 0, "(Unstable)" ) \
@@ -2332,7 +2326,7 @@
develop(bool, CITimeEach, false, \
"display timing information after each successful compilation") \
\
- develop(bool, CICountOSR, true, \
+ develop(bool, CICountOSR, false, \
"use a separate counter when assigning ids to osr compilations") \
\
develop(bool, CICompileNatives, true, \
--- a/hotspot/src/share/vm/runtime/globals_extension.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/globals_extension.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -94,9 +94,9 @@
typedef enum {
RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER, RUNTIME_LP64_PRODUCT_FLAG_MEMBER)
RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER)
-#ifndef KERNEL
+#if INCLUDE_ALTERNATE_GCS
G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER)
-#endif
+#endif // INCLUDE_ALTERNATE_GCS
#ifdef COMPILER1
C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, C1_PD_DEVELOP_FLAG_MEMBER, C1_PRODUCT_FLAG_MEMBER, C1_PD_PRODUCT_FLAG_MEMBER, C1_NOTPRODUCT_FLAG_MEMBER)
#endif
@@ -187,7 +187,7 @@
RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE,
RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE,
RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE)
-#ifndef KERNEL
+#if INCLUDE_ALTERNATE_GCS
G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE,
RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE,
@@ -197,7 +197,7 @@
RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE,
RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE,
RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE)
-#endif // KERNEL
+#endif // INCLUDE_ALTERNATE_GCS
#ifdef COMPILER1
C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE,
C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
--- a/hotspot/src/share/vm/runtime/init.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/init.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -114,9 +114,9 @@
universe2_init(); // dependent on codeCache_init and stubRoutines_init1
referenceProcessor_init();
jni_handles_init();
-#ifndef VM_STRUCTS_KERNEL
+#if INCLUDE_VM_STRUCTS
vmStructs_init();
-#endif // VM_STRUCTS_KERNEL
+#endif // INCLUDE_VM_STRUCTS
vtableStubs_init();
InlineCacheBuffer_init();
--- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/java.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/java.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/monitorChunk.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/monitorChunk.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/monitorChunk.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/monitorChunk.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/mutex.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/mutex.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/runtime/park.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/park.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/perfData.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/perfData.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -588,6 +588,10 @@
PerfData* PerfDataList::find_by_name(const char* name) {
+ // if add_item hasn't been called the list won't be initialized
+ if (this == NULL)
+ return NULL;
+
int i = _set->find((void*)name, PerfDataList::by_name);
if (i >= 0 && i <= _set->length())
--- a/hotspot/src/share/vm/runtime/perfMemory.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/perfMemory.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/runtime/reflection.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/reflection.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -212,7 +212,7 @@
return T_OBJECT;
} else {
assert(a->is_typeArray(), "just checking");
- BasicType type = typeArrayKlass::cast(a->klass())->element_type();
+ BasicType type = TypeArrayKlass::cast(a->klass())->element_type();
switch (type) {
case T_BOOLEAN:
value->z = typeArrayOop(a)->bool_at(index);
@@ -254,7 +254,7 @@
if (value_type == T_OBJECT) {
oop obj = (oop) value->l;
if (obj != NULL) {
- Klass* element_klass = objArrayKlass::cast(a->klass())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(a->klass())->element_klass();
if (!obj->is_a(element_klass)) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "array element type mismatch");
}
@@ -263,7 +263,7 @@
}
} else {
assert(a->is_typeArray(), "just checking");
- BasicType array_type = typeArrayKlass::cast(a->klass())->element_type();
+ BasicType array_type = TypeArrayKlass::cast(a->klass())->element_type();
if (array_type != value_type) {
// The widen operation can potentially throw an exception, but cannot block,
// so typeArrayOop a is safe if the call succeeds.
@@ -313,7 +313,7 @@
oop Reflection:: basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS) {
- BasicType type = typeArrayKlass::cast(basic_type_arrayklass)->element_type();
+ BasicType type = TypeArrayKlass::cast(basic_type_arrayklass)->element_type();
return Universe::java_mirror(type);
}
@@ -327,10 +327,10 @@
}
if (java_lang_Class::is_primitive(element_mirror)) {
Klass* tak = basic_type_mirror_to_arrayklass(element_mirror, CHECK_NULL);
- return typeArrayKlass::cast(tak)->allocate(length, THREAD);
+ return TypeArrayKlass::cast(tak)->allocate(length, THREAD);
} else {
Klass* k = java_lang_Class::as_Klass(element_mirror);
- if (Klass::cast(k)->oop_is_array() && arrayKlass::cast(k)->dimension() >= MAX_DIM) {
+ if (Klass::cast(k)->oop_is_array() && ArrayKlass::cast(k)->dimension() >= MAX_DIM) {
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
}
return oopFactory::new_objArray(k, length, THREAD);
@@ -340,7 +340,7 @@
arrayOop Reflection::reflect_new_multi_array(oop element_mirror, typeArrayOop dim_array, TRAPS) {
assert(dim_array->is_typeArray(), "just checking");
- assert(typeArrayKlass::cast(dim_array->klass())->element_type() == T_INT, "just checking");
+ assert(TypeArrayKlass::cast(dim_array->klass())->element_type() == T_INT, "just checking");
if (element_mirror == NULL) {
THROW_0(vmSymbols::java_lang_NullPointerException());
@@ -367,7 +367,7 @@
} else {
klass = java_lang_Class::as_Klass(element_mirror);
if (Klass::cast(klass)->oop_is_array()) {
- int k_dim = arrayKlass::cast(klass)->dimension();
+ int k_dim = ArrayKlass::cast(klass)->dimension();
if (k_dim + len > MAX_DIM) {
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
}
@@ -375,7 +375,7 @@
}
}
klass = Klass::cast(klass)->array_klass(dim, CHECK_NULL);
- oop obj = arrayKlass::cast(klass)->multi_allocate(len, dimensions, THREAD);
+ oop obj = ArrayKlass::cast(klass)->multi_allocate(len, dimensions, THREAD);
assert(obj->is_array(), "just checking");
return arrayOop(obj);
}
@@ -391,17 +391,17 @@
return NULL;
}
- oop result = arrayKlass::cast(klass)->component_mirror();
+ oop result = ArrayKlass::cast(klass)->component_mirror();
#ifdef ASSERT
oop result2 = NULL;
- if (arrayKlass::cast(klass)->dimension() == 1) {
+ if (ArrayKlass::cast(klass)->dimension() == 1) {
if (Klass::cast(klass)->oop_is_typeArray()) {
result2 = basic_type_arrayklass_to_mirror(klass, CHECK_NULL);
} else {
- result2 = Klass::cast(objArrayKlass::cast(klass)->element_klass())->java_mirror();
+ result2 = Klass::cast(ObjArrayKlass::cast(klass)->element_klass())->java_mirror();
}
} else {
- Klass* lower_dim = arrayKlass::cast(klass)->lower_dimension();
+ Klass* lower_dim = ArrayKlass::cast(klass)->lower_dimension();
assert(Klass::cast(lower_dim)->oop_is_array(), "just checking");
result2 = Klass::cast(lower_dim)->java_mirror();
}
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -2705,7 +2705,7 @@
int jlsLen = java_lang_String::length(src);
jchar* jlsPos = (jlsLen == 0) ? NULL :
jlsValue->char_at_addr(jlsOffset);
- assert(typeArrayKlass::cast(jlsValue->klass())->element_type() == T_CHAR, "compressed string");
+ assert(TypeArrayKlass::cast(jlsValue->klass())->element_type() == T_CHAR, "compressed string");
(void) UNICODE::as_utf8(jlsPos, jlsLen, (char *)dst, max_dtrace_string_size);
}
#endif // ndef HAVE_DTRACE_H
--- a/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/stubRoutines.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -421,6 +421,7 @@
case T_ARRAY:
case T_OBJECT:
case T_NARROWOOP:
+ case T_NARROWKLASS:
case T_ADDRESS:
// Currently unsupported
return NULL;
--- a/hotspot/src/share/vm/runtime/task.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/task.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/thread.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -321,12 +321,14 @@
// set up any platform-specific state.
os::initialize_thread(this);
+#if INCLUDE_NMT
// record thread's native stack, stack grows downward
if (MemTracker::is_on()) {
address stack_low_addr = stack_base() - stack_size();
MemTracker::record_thread_stack(stack_low_addr, stack_size(), this,
CURRENT_PC);
}
+#endif // INCLUDE_NMT
}
@@ -338,10 +340,12 @@
// record_stack_base_and_size called. Although, we would like to ensure
// that all started threads do call record_stack_base_and_size(), there is
// not proper way to enforce that.
+#if INCLUDE_NMT
if (_stack_base != NULL) {
address low_stack_addr = stack_base() - stack_size();
MemTracker::release_thread_stack(low_stack_addr, stack_size(), this);
}
+#endif // INCLUDE_NMT
// deallocate data structures
delete resource_area();
@@ -1357,7 +1361,9 @@
set_monitor_chunks(NULL);
set_next(NULL);
set_thread_state(_thread_new);
+#if INCLUDE_NMT
set_recorder(NULL);
+#endif
_terminated = _not_terminated;
_privileged_stack_top = NULL;
_array_for_gc = NULL;
@@ -2583,6 +2589,12 @@
StackFrameStream fst(this, UseBiasedLocking);
for(; !fst.is_done(); fst.next()) {
if (fst.current()->should_be_deoptimized()) {
+ if (LogCompilation && xtty != NULL) {
+ nmethod* nm = fst.current()->cb()->as_nmethod_or_null();
+ xtty->elem("deoptimized thread='" UINTX_FORMAT "' compile_id='%d'",
+ this->name(), nm != NULL ? nm->compile_id() : -1);
+ }
+
Deoptimization::deoptimize(this, *fst.current(), fst.register_map());
}
}
@@ -3523,7 +3535,9 @@
#endif /* USDT2 */
// record VM initialization completion time
+#if INCLUDE_MANAGEMENT
Management::record_vm_init_completed();
+#endif // INCLUDE_MANAGEMENT
// Compute system loader. Note that this has to occur after set_init_completed, since
// valid exceptions may be thrown in the process.
@@ -3584,9 +3598,14 @@
}
// initialize compiler(s)
+#if defined(COMPILER1) || defined(COMPILER2)
CompileBroker::compilation_init();
-
+#endif
+
+#if INCLUDE_MANAGEMENT
Management::initialize(THREAD);
+#endif // INCLUDE_MANAGEMENT
+
if (HAS_PENDING_EXCEPTION) {
// management agent fails to start possibly due to
// configuration problem and is responsible for printing
@@ -3756,6 +3775,7 @@
AgentLibrary* agent;
JvmtiExport::enter_onload_phase();
+
for (agent = Arguments::agents(); agent != NULL; agent = agent->next()) {
OnLoadEntry_t on_load_entry = lookup_agent_on_load(agent);
--- a/hotspot/src/share/vm/runtime/thread.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/thread.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -41,7 +41,11 @@
#include "runtime/stubRoutines.hpp"
#include "runtime/threadLocalStorage.hpp"
#include "runtime/unhandledOops.hpp"
+
+#if INCLUDE_NMT
#include "services/memRecorder.hpp"
+#endif // INCLUDE_NMT
+
#include "trace/tracing.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/top.hpp"
@@ -1038,6 +1042,7 @@
bool do_not_unlock_if_synchronized() { return _do_not_unlock_if_synchronized; }
void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; }
+#if INCLUDE_NMT
// native memory tracking
inline MemRecorder* get_recorder() const { return (MemRecorder*)_recorder; }
inline void set_recorder(MemRecorder* rc) { _recorder = (volatile MemRecorder*)rc; }
@@ -1045,6 +1050,7 @@
private:
// per-thread memory recorder
volatile MemRecorder* _recorder;
+#endif // INCLUDE_NMT
// Suspend/resume support for JavaThread
private:
--- a/hotspot/src/share/vm/runtime/timer.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/timer.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -230,6 +230,15 @@
return x;
}
+#if INCLUDE_JVMTI
+ #define JVMTI_STRUCTS(static_field) \
+ static_field(JvmtiExport, _can_access_local_variables, bool) \
+ static_field(JvmtiExport, _can_hotswap_or_post_breakpoint, bool) \
+ static_field(JvmtiExport, _can_post_on_exceptions, bool) \
+ static_field(JvmtiExport, _can_walk_any_space, bool)
+#else
+ #define JVMTI_STRUCTS(static_field)
+#endif // INCLUDE_JVMTI
typedef HashtableEntry<intptr_t, mtInternal> IntptrHashtableEntry;
typedef Hashtable<intptr_t, mtInternal> IntptrHashtable;
@@ -268,12 +277,12 @@
volatile_nonstatic_field(oopDesc, _metadata._klass, Klass*) \
volatile_nonstatic_field(oopDesc, _metadata._compressed_klass, narrowOop) \
static_field(oopDesc, _bs, BarrierSet*) \
- nonstatic_field(arrayKlass, _dimension, int) \
- volatile_nonstatic_field(arrayKlass, _higher_dimension, Klass*) \
- volatile_nonstatic_field(arrayKlass, _lower_dimension, Klass*) \
- nonstatic_field(arrayKlass, _vtable_len, int) \
- nonstatic_field(arrayKlass, _alloc_size, juint) \
- nonstatic_field(arrayKlass, _component_mirror, oop) \
+ nonstatic_field(ArrayKlass, _dimension, int) \
+ volatile_nonstatic_field(ArrayKlass, _higher_dimension, Klass*) \
+ volatile_nonstatic_field(ArrayKlass, _lower_dimension, Klass*) \
+ nonstatic_field(ArrayKlass, _vtable_len, int) \
+ nonstatic_field(ArrayKlass, _alloc_size, juint) \
+ nonstatic_field(ArrayKlass, _component_mirror, oop) \
nonstatic_field(CompiledICHolder, _holder_method, Method*) \
nonstatic_field(CompiledICHolder, _holder_klass, Klass*) \
nonstatic_field(ConstantPool, _tags, Array<u1>*) \
@@ -379,13 +388,13 @@
nonstatic_field(ConstMethod, _signature_index, u2) \
nonstatic_field(ConstMethod, _method_idnum, u2) \
nonstatic_field(ConstMethod, _generic_signature_index, u2) \
- nonstatic_field(objArrayKlass, _element_klass, Klass*) \
- nonstatic_field(objArrayKlass, _bottom_klass, Klass*) \
+ nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
+ nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \
volatile_nonstatic_field(Symbol, _refcount, int) \
nonstatic_field(Symbol, _identity_hash, int) \
nonstatic_field(Symbol, _length, unsigned short) \
unchecked_nonstatic_field(Symbol, _body, sizeof(jbyte)) /* NOTE: no type */ \
- nonstatic_field(typeArrayKlass, _max_length, int) \
+ nonstatic_field(TypeArrayKlass, _max_length, int) \
\
/***********************/ \
/* Constant Pool Cache */ \
@@ -454,6 +463,8 @@
static_field(Universe, _narrow_oop._base, address) \
static_field(Universe, _narrow_oop._shift, int) \
static_field(Universe, _narrow_oop._use_implicit_null_checks, bool) \
+ static_field(Universe, _narrow_klass._base, address) \
+ static_field(Universe, _narrow_klass._shift, int) \
\
/**********************************************************************************/ \
/* Generation and Space hierarchies */ \
@@ -1170,10 +1181,7 @@
/* JVMTI */ \
/*************************/ \
\
- static_field(JvmtiExport, _can_access_local_variables, bool) \
- static_field(JvmtiExport, _can_hotswap_or_post_breakpoint, bool) \
- static_field(JvmtiExport, _can_post_on_exceptions, bool) \
- static_field(JvmtiExport, _can_walk_any_space, bool) \
+ JVMTI_STRUCTS(static_field) \
\
/*************/ \
/* Arguments */ \
@@ -1370,9 +1378,9 @@
declare_toplevel_type(MetaspaceObj) \
declare_type(Metadata, MetaspaceObj) \
declare_type(Klass, Metadata) \
- declare_type(arrayKlass, Klass) \
- declare_type(objArrayKlass, arrayKlass) \
- declare_type(typeArrayKlass, arrayKlass) \
+ declare_type(ArrayKlass, Klass) \
+ declare_type(ObjArrayKlass, ArrayKlass) \
+ declare_type(TypeArrayKlass, ArrayKlass) \
declare_type(InstanceKlass, Klass) \
declare_type(InstanceClassLoaderKlass, InstanceKlass) \
declare_type(InstanceMirrorKlass, InstanceKlass) \
@@ -1727,6 +1735,8 @@
declare_c2_type(CMoveNNode, CMoveNode) \
declare_c2_type(EncodePNode, TypeNode) \
declare_c2_type(DecodeNNode, TypeNode) \
+ declare_c2_type(EncodePKlassNode, TypeNode) \
+ declare_c2_type(DecodeNKlassNode, TypeNode) \
declare_c2_type(ConstraintCastNode, TypeNode) \
declare_c2_type(CastIINode, ConstraintCastNode) \
declare_c2_type(CastPPNode, ConstraintCastNode) \
@@ -1823,6 +1833,7 @@
declare_c2_type(StoreDNode, StoreNode) \
declare_c2_type(StorePNode, StoreNode) \
declare_c2_type(StoreNNode, StoreNode) \
+ declare_c2_type(StoreNKlassNode, StoreNode) \
declare_c2_type(StoreCMNode, StoreNode) \
declare_c2_type(LoadPLockedNode, LoadPNode) \
declare_c2_type(SCMemProjNode, ProjNode) \
--- a/hotspot/src/share/vm/runtime/vmThread.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/vmThread.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/runtime/vm_version.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -110,24 +110,26 @@
#define VMLP ""
#endif
-#ifdef KERNEL
- #define VMTYPE "Kernel"
-#else // KERNEL
-#ifdef TIERED
- #define VMTYPE "Server"
-#else // TIERED
-#ifdef ZERO
-#ifdef SHARK
- #define VMTYPE "Shark"
-#else // SHARK
- #define VMTYPE "Zero"
-#endif // SHARK
-#else // ZERO
- #define VMTYPE COMPILER1_PRESENT("Client") \
- COMPILER2_PRESENT("Server")
-#endif // ZERO
-#endif // TIERED
-#endif // KERNEL
+#ifndef VMTYPE
+ #ifdef KERNEL
+ #define VMTYPE "Kernel"
+ #else // KERNEL
+ #ifdef TIERED
+ #define VMTYPE "Server"
+ #else // TIERED
+ #ifdef ZERO
+ #ifdef SHARK
+ #define VMTYPE "Shark"
+ #else // SHARK
+ #define VMTYPE "Zero"
+ #endif // SHARK
+ #else // ZERO
+ #define VMTYPE COMPILER1_PRESENT("Client") \
+ COMPILER2_PRESENT("Server")
+ #endif // ZERO
+ #endif // TIERED
+ #endif // KERNEL
+#endif
#ifndef HOTSPOT_VM_DISTRO
#error HOTSPOT_VM_DISTRO must be defined
--- a/hotspot/src/share/vm/runtime/vm_version.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/runtime/vm_version.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/services/attachListener.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/attachListener.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -88,7 +88,7 @@
// The result should be a [B
oop res = (oop)result.get_jobject();
assert(res->is_typeArray(), "just checking");
- assert(typeArrayKlass::cast(res->klass())->element_type() == T_BYTE, "just checking");
+ assert(TypeArrayKlass::cast(res->klass())->element_type() == T_BYTE, "just checking");
// copy the bytes to the output stream
typeArrayOop ba = typeArrayOop(res);
--- a/hotspot/src/share/vm/services/attachListener.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/attachListener.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -52,21 +52,21 @@
class AttachListener: AllStatic {
public:
- static void init() KERNEL_RETURN;
- static void abort() KERNEL_RETURN;
+ static void init() NOT_SERVICES_RETURN;
+ static void abort() NOT_SERVICES_RETURN;
// invoke to perform clean-up tasks when all clients detach
- static void detachall() KERNEL_RETURN;
+ static void detachall() NOT_SERVICES_RETURN;
// indicates if the Attach Listener needs to be created at startup
- static bool init_at_startup() KERNEL_RETURN_(false);
+ static bool init_at_startup() NOT_SERVICES_RETURN_(false);
// indicates if we have a trigger to start the Attach Listener
- static bool is_init_trigger() KERNEL_RETURN_(false);
+ static bool is_init_trigger() NOT_SERVICES_RETURN_(false);
-#ifdef SERVICES_KERNEL
+#if !INCLUDE_SERVICES
static bool is_attach_supported() { return false; }
-#else // SERVICES_KERNEL
+#else
private:
static volatile bool _initialized;
@@ -94,10 +94,10 @@
// dequeue the next operation
static AttachOperation* dequeue();
-#endif // SERVICES_KERNEL
+#endif // !INCLUDE_SERVICES
};
-#ifndef SERVICES_KERNEL
+#if INCLUDE_SERVICES
class AttachOperation: public CHeapObj<mtInternal> {
public:
enum {
@@ -151,6 +151,6 @@
// complete operation by sending result code and any result data to the client
virtual void complete(jint result, bufferedStream* result_stream) = 0;
};
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
#endif // SHARE_VM_SERVICES_ATTACHLISTENER_HPP
--- a/hotspot/src/share/vm/services/classLoadingService.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/classLoadingService.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -78,6 +78,7 @@
#endif
+#if INCLUDE_MANAGEMENT
// counters for classes loaded from class files
PerfCounter* ClassLoadingService::_classes_loaded_count = NULL;
PerfCounter* ClassLoadingService::_classes_unloaded_count = NULL;
@@ -239,3 +240,5 @@
// FIXME: Exclude array klasses for now
// Universe::basic_type_classes_do(&add_loaded_class);
}
+
+#endif // INCLUDE_MANAGEMENT
--- a/hotspot/src/share/vm/services/classLoadingService.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/classLoadingService.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, 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
@@ -55,7 +55,7 @@
static bool get_verbose() { return TraceClassLoading; }
static bool set_verbose(bool verbose);
- static void reset_trace_class_unloading();
+ static void reset_trace_class_unloading() NOT_MANAGEMENT_RETURN;
static jlong loaded_class_count() {
return _classes_loaded_count->get_value() + _shared_classes_loaded_count->get_value();
@@ -102,13 +102,16 @@
return (UsePerfData ? _class_methods_size->get_value() : -1);
}
- static void notify_class_loaded(InstanceKlass* k, bool shared_class);
+ static void notify_class_loaded(InstanceKlass* k, bool shared_class)
+ NOT_MANAGEMENT_RETURN;
// All unloaded classes are non-shared
- static void notify_class_unloaded(InstanceKlass* k);
+ static void notify_class_unloaded(InstanceKlass* k) NOT_MANAGEMENT_RETURN;
static void add_class_method_size(int size) {
+#if INCLUDE_MANAGEMENT
if (UsePerfData) {
_class_methods_size->inc(size);
}
+#endif // INCLUDE_MANAGEMENT
}
};
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -43,9 +43,9 @@
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(true, false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(true, false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(true, false));
-#ifndef SERVICES_KERNEL // Heap dumping not supported
+#if INCLUDE_SERVICES // Heap dumping supported
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(true, false));
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(true, false));
DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(true, false));
@@ -204,7 +204,7 @@
// The result should be a [B
oop res = (oop)result.get_jobject();
assert(res->is_typeArray(), "just checking");
- assert(typeArrayKlass::cast(res->klass())->element_type() == T_BYTE, "just checking");
+ assert(TypeArrayKlass::cast(res->klass())->element_type() == T_BYTE, "just checking");
// copy the bytes to the output stream
typeArrayOop ba = typeArrayOop(res);
@@ -252,7 +252,7 @@
vmSymbols::void_method_signature(), CHECK);
}
-#ifndef SERVICES_KERNEL // Heap dumping not supported
+#if INCLUDE_SERVICES // Heap dumping supported
HeapDumpDCmd::HeapDumpDCmd(outputStream* output, bool heap) :
DCmdWithParser(output, heap),
_filename("filename","Name of the dump file", "STRING",true),
@@ -292,7 +292,7 @@
return 0;
}
}
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
ClassHistogramDCmd::ClassHistogramDCmd(outputStream* output, bool heap) :
DCmdWithParser(output, heap),
--- a/hotspot/src/share/vm/services/diagnosticCommand.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -155,7 +155,7 @@
virtual void execute(TRAPS);
};
-#ifndef SERVICES_KERNEL // Heap dumping not supported
+#if INCLUDE_SERVICES // Heap dumping supported
// See also: dump_heap in attachListener.cpp
class HeapDumpDCmd : public DCmdWithParser {
protected:
@@ -176,7 +176,7 @@
static int num_arguments();
virtual void execute(TRAPS);
};
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
// See also: inspeactheap in attachListener.cpp
class ClassHistogramDCmd : public DCmdWithParser {
--- a/hotspot/src/share/vm/services/g1MemoryPool.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/g1MemoryPool.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, 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
--- a/hotspot/src/share/vm/services/g1MemoryPool.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/g1MemoryPool.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, 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
--- a/hotspot/src/share/vm/services/heapDumper.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/heapDumper.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -933,7 +933,7 @@
k = klass->array_klass_or_null();
while (k != NULL) {
Klass* klass = Klass::cast(k);
- assert(klass->oop_is_objArray(), "not an objArrayKlass");
+ assert(klass->oop_is_objArray(), "not an ObjArrayKlass");
writer->write_u1(HPROF_GC_CLASS_DUMP);
writer->write_classID(klass);
@@ -1016,7 +1016,7 @@
// creates HPROF_GC_PRIM_ARRAY_DUMP record for the given type array
void DumperSupport::dump_prim_array(DumpWriter* writer, typeArrayOop array) {
- BasicType type = typeArrayKlass::cast(array->klass())->element_type();
+ BasicType type = TypeArrayKlass::cast(array->klass())->element_type();
writer->write_u1(HPROF_GC_PRIM_ARRAY_DUMP);
writer->write_objectID(array);
--- a/hotspot/src/share/vm/services/heapDumper.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/heapDumper.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -76,9 +76,9 @@
// returns error message (resource allocated), or NULL if no error
char* error_as_C_string() const;
- static void dump_heap() KERNEL_RETURN;
+ static void dump_heap() NOT_SERVICES_RETURN;
- static void dump_heap_from_oome() KERNEL_RETURN;
+ static void dump_heap_from_oome() NOT_SERVICES_RETURN;
};
#endif // SHARE_VM_SERVICES_HEAPDUMPER_HPP
--- a/hotspot/src/share/vm/services/lowMemoryDetector.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/lowMemoryDetector.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/services/management.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/management.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -72,12 +72,22 @@
TimeStamp Management::_stamp;
void management_init() {
+#if INCLUDE_MANAGEMENT
Management::init();
ThreadService::init();
RuntimeService::init();
ClassLoadingService::init();
+#else
+ ThreadService::init();
+ // Make sure the VM version is initialized
+ // This is normally called by RuntimeService::init().
+ // Since that is conditionalized out, we need to call it here.
+ Abstract_VM_Version::initialize();
+#endif // INCLUDE_MANAGEMENT
}
+#if INCLUDE_MANAGEMENT
+
void Management::init() {
EXCEPTION_MARK;
@@ -112,10 +122,10 @@
_optional_support.isBootClassPathSupported = 1;
_optional_support.isObjectMonitorUsageSupported = 1;
-#ifndef SERVICES_KERNEL
+#if INCLUDE_SERVICES
// This depends on the heap inspector
_optional_support.isSynchronizerUsageSupported = 1;
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
_optional_support.isThreadAllocatedMemorySupported = 1;
// Registration of the diagnostic commands
@@ -426,7 +436,7 @@
static void validate_thread_info_array(objArrayHandle infoArray_h, TRAPS) {
// check if the element of infoArray is of type ThreadInfo class
Klass* threadinfo_klass = Management::java_lang_management_ThreadInfo_klass(CHECK);
- Klass* element_klass = objArrayKlass::cast(infoArray_h->klass())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(infoArray_h->klass())->element_klass();
if (element_klass != threadinfo_klass) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"infoArray element type is not ThreadInfo class");
@@ -1715,7 +1725,7 @@
objArrayOop ta = objArrayOop(JNIHandles::resolve_non_null(names));
objArrayHandle names_ah(THREAD, ta);
// Make sure we have a String array
- Klass* element_klass = objArrayKlass::cast(names_ah->klass())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(names_ah->klass())->element_klass();
if (element_klass != SystemDictionary::String_klass()) {
THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
"Array element type is not String class", 0);
@@ -1891,7 +1901,7 @@
objArrayHandle names_ah(THREAD, na);
// Make sure we have a String array
- Klass* element_klass = objArrayKlass::cast(names_ah->klass())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(names_ah->klass())->element_klass();
if (element_klass != SystemDictionary::String_klass()) {
THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
"Array element type is not String class", 0);
@@ -2008,7 +2018,7 @@
// check if the element of array is of type MemoryUsage class
Klass* usage_klass = Management::java_lang_management_MemoryUsage_klass(CHECK_0);
- Klass* element_klass = objArrayKlass::cast(array_h->klass())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(array_h->klass())->element_klass();
if (element_klass != usage_klass) {
THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
"The element type is not MemoryUsage class", 0);
@@ -2108,7 +2118,7 @@
// Dump heap - Returns 0 if succeeds.
JVM_ENTRY(jint, jmm_DumpHeap0(JNIEnv *env, jstring outputfile, jboolean live))
-#ifndef SERVICES_KERNEL
+#if INCLUDE_SERVICES
ResourceMark rm(THREAD);
oop on = JNIHandles::resolve_external_guard(outputfile);
if (on == NULL) {
@@ -2126,9 +2136,9 @@
THROW_MSG_(vmSymbols::java_io_IOException(), errmsg, -1);
}
return 0;
-#else // SERVICES_KERNEL
+#else // INCLUDE_SERVICES
return -1;
-#endif // SERVICES_KERNEL
+#endif // INCLUDE_SERVICES
JVM_END
JVM_ENTRY(jobjectArray, jmm_GetDiagnosticCommands(JNIEnv *env))
@@ -2156,7 +2166,7 @@
objArrayHandle cmds_ah(THREAD, ca);
// Make sure we have a String array
- Klass* element_klass = objArrayKlass::cast(cmds_ah->klass())->element_klass();
+ Klass* element_klass = ObjArrayKlass::cast(cmds_ah->klass())->element_klass();
if (element_klass != SystemDictionary::String_klass()) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"Array element type is not String class");
@@ -2295,10 +2305,13 @@
jmm_GetDiagnosticCommandArgumentsInfo,
jmm_ExecuteDiagnosticCommand
};
+#endif // INCLUDE_MANAGEMENT
void* Management::get_jmm_interface(int version) {
+#if INCLUDE_MANAGEMENT
if (version == JMM_VERSION_1_0) {
return (void*) &jmm_interface;
}
+#endif // INCLUDE_MANAGEMENT
return NULL;
}
--- a/hotspot/src/share/vm/services/management.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/management.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -58,16 +58,17 @@
static void init();
static void initialize(TRAPS);
- static jlong ticks_to_ms(jlong ticks);
- static jlong timestamp();
+ static jlong ticks_to_ms(jlong ticks) NOT_MANAGEMENT_RETURN_(0L);
+ static jlong timestamp() NOT_MANAGEMENT_RETURN_(0L);
- static void oops_do(OopClosure* f);
+ static void oops_do(OopClosure* f) NOT_MANAGEMENT_RETURN;
static void* get_jmm_interface(int version);
static void get_optional_support(jmmOptionalSupport* support);
static void get_loaded_classes(JavaThread* cur_thread, GrowableArray<KlassHandle>* klass_handle_array);
- static void record_vm_startup_time(jlong begin, jlong duration);
+ static void record_vm_startup_time(jlong begin, jlong duration)
+ NOT_MANAGEMENT_RETURN;
static void record_vm_init_completed() {
// Initialize the timestamp to get the current time
_vm_init_done_time->set_value(os::javaTimeMillis());
@@ -85,14 +86,19 @@
// methods to return a Klass*.
static Klass* java_lang_management_ThreadInfo_klass(TRAPS);
- static Klass* java_lang_management_MemoryUsage_klass(TRAPS);
+ static Klass* java_lang_management_MemoryUsage_klass(TRAPS)
+ NOT_MANAGEMENT_RETURN_(NULL);
static Klass* java_lang_management_MemoryPoolMXBean_klass(TRAPS);
static Klass* java_lang_management_MemoryManagerMXBean_klass(TRAPS);
static Klass* java_lang_management_GarbageCollectorMXBean_klass(TRAPS);
- static Klass* sun_management_Sensor_klass(TRAPS);
- static Klass* sun_management_ManagementFactory_klass(TRAPS);
- static Klass* sun_management_GarbageCollectorImpl_klass(TRAPS);
- static Klass* com_sun_management_GcInfo_klass(TRAPS);
+ static Klass* sun_management_Sensor_klass(TRAPS)
+ NOT_MANAGEMENT_RETURN_(NULL);
+ static Klass* sun_management_ManagementFactory_klass(TRAPS)
+ NOT_MANAGEMENT_RETURN_(NULL);
+ static Klass* sun_management_GarbageCollectorImpl_klass(TRAPS)
+ NOT_MANAGEMENT_RETURN_(NULL);
+ static Klass* com_sun_management_GcInfo_klass(TRAPS)
+ NOT_MANAGEMENT_RETURN_(NULL);
static instanceOop create_thread_info_instance(ThreadSnapshot* snapshot, TRAPS);
static instanceOop create_thread_info_instance(ThreadSnapshot* snapshot, objArrayHandle monitors_array, typeArrayHandle depths_array, objArrayHandle synchronizers_array, TRAPS);
--- a/hotspot/src/share/vm/services/memReporter.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/memReporter.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -30,6 +30,8 @@
#include "services/memTracker.hpp"
#include "utilities/ostream.hpp"
+#if INCLUDE_NMT
+
/*
* MemBaselineReporter reports data to this outputer class,
* ReportOutputer is responsible for format, store and redirect
@@ -265,4 +267,6 @@
};
+#endif // INCLUDE_NMT
+
#endif // SHARE_VM_SERVICES_MEM_REPORTER_HPP
--- a/hotspot/src/share/vm/services/memTracker.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/memTracker.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -25,6 +25,80 @@
#ifndef SHARE_VM_SERVICES_MEM_TRACKER_HPP
#define SHARE_VM_SERVICES_MEM_TRACKER_HPP
+#include "utilities/macros.hpp"
+
+#if !INCLUDE_NMT
+
+#include "utilities/ostream.hpp"
+
+class BaselineOutputer : public StackObj {
+
+};
+
+class BaselineTTYOutputer : public BaselineOutputer {
+ public:
+ BaselineTTYOutputer(outputStream* st) { }
+};
+
+class MemTracker : AllStatic {
+ public:
+ enum ShutdownReason {
+ NMT_shutdown_none, // no shutdown requested
+ NMT_shutdown_user, // user requested shutdown
+ NMT_normal, // normal shutdown, process exit
+ NMT_out_of_memory, // shutdown due to out of memory
+ NMT_initialization, // shutdown due to initialization failure
+ NMT_use_malloc_only, // can not combine NMT with UseMallocOnly flag
+ NMT_error_reporting, // shutdown by vmError::report_and_die()
+ NMT_out_of_generation, // running out of generation queue
+ NMT_sequence_overflow // overflow the sequence number
+ };
+
+
+ public:
+ static inline void init_tracking_options(const char* option_line) { }
+ static inline bool is_on() { return false; }
+ static const char* reason() { return "Native memory tracking is not implemented"; }
+ static inline bool can_walk_stack() { return false; }
+
+ static inline void bootstrap_single_thread() { }
+ static inline void bootstrap_multi_thread() { }
+ static inline void start() { }
+
+ static inline void record_malloc(address addr, size_t size, MEMFLAGS flags,
+ address pc = 0, Thread* thread = NULL) { }
+ static inline void record_free(address addr, MEMFLAGS flags, Thread* thread = NULL) { }
+ static inline void record_realloc(address old_addr, address new_addr, size_t size,
+ MEMFLAGS flags, address pc = 0, Thread* thread = NULL) { }
+ static inline void record_arena_size(address addr, size_t size) { }
+ static inline void record_virtual_memory_reserve(address addr, size_t size,
+ address pc = 0, Thread* thread = NULL) { }
+ static inline void record_virtual_memory_commit(address addr, size_t size,
+ address pc = 0, Thread* thread = NULL) { }
+ static inline void record_virtual_memory_uncommit(address addr, size_t size,
+ Thread* thread = NULL) { }
+ static inline void record_virtual_memory_release(address addr, size_t size,
+ Thread* thread = NULL) { }
+ static inline void record_virtual_memory_type(address base, MEMFLAGS flags,
+ Thread* thread = NULL) { }
+ static inline bool baseline() { return false; }
+ static inline bool has_baseline() { return false; }
+
+ static void shutdown(ShutdownReason reason) { }
+ static inline bool shutdown_in_progress() { }
+ static bool print_memory_usage(BaselineOutputer& out, size_t unit,
+ bool summary_only = true) { }
+ static bool compare_memory_usage(BaselineOutputer& out, size_t unit,
+ bool summary_only = true) { }
+
+ static inline void sync() { }
+ static inline void thread_exiting(JavaThread* thread) { }
+
+};
+
+
+#else // !INCLUDE_NMT
+
#include "memory/allocation.hpp"
#include "runtime/globals.hpp"
#include "runtime/mutex.hpp"
@@ -411,4 +485,6 @@
static enum ShutdownReason _reason;
};
+#endif // !INCLUDE_NMT
+
#endif // SHARE_VM_SERVICES_MEM_TRACKER_HPP
--- a/hotspot/src/share/vm/services/memoryManager.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/memoryManager.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/services/runtimeService.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/runtimeService.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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,6 +35,7 @@
HS_DTRACE_PROBE_DECL(hs_private, safepoint__end);
#endif /* !USDT2 */
+#if INCLUDE_MANAGEMENT
TimeStamp RuntimeService::_app_timer;
TimeStamp RuntimeService::_safepoint_timer;
PerfCounter* RuntimeService::_sync_time_ticks = NULL;
@@ -101,9 +102,9 @@
memset((void*) capabilities, '0', len);
capabilities[len-1] = '\0';
capabilities[0] = AttachListener::is_attach_supported() ? '1' : '0';
-#ifdef KERNEL
+#if INCLUDE_SERVICES
capabilities[1] = '1';
-#endif // KERNEL
+#endif // INCLUDE_SERVICES
PerfDataManager::create_string_constant(SUN_RT, "jvmCapabilities",
capabilities, CHECK);
}
@@ -205,3 +206,5 @@
_thread_interrupt_signaled_count->inc();
}
}
+
+#endif // INCLUDE_MANAGEMENT
--- a/hotspot/src/share/vm/services/runtimeService.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/runtimeService.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -53,15 +53,15 @@
static double last_application_time_sec() { return _app_timer.seconds(); }
// callbacks
- static void record_safepoint_begin();
- static void record_safepoint_synchronized();
- static void record_safepoint_end();
- static void record_application_start();
+ static void record_safepoint_begin() NOT_MANAGEMENT_RETURN;
+ static void record_safepoint_synchronized() NOT_MANAGEMENT_RETURN;
+ static void record_safepoint_end() NOT_MANAGEMENT_RETURN;
+ static void record_application_start() NOT_MANAGEMENT_RETURN;
// interruption events
- static void record_interrupted_before_count();
- static void record_interrupted_during_count();
- static void record_thread_interrupt_signaled_count();
+ static void record_interrupted_before_count() NOT_MANAGEMENT_RETURN;
+ static void record_interrupted_during_count() NOT_MANAGEMENT_RETURN;
+ static void record_thread_interrupt_signaled_count() NOT_MANAGEMENT_RETURN;
};
#endif // SHARE_VM_SERVICES_RUNTIMESERVICE_HPP
--- a/hotspot/src/share/vm/services/threadService.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/services/threadService.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -250,7 +250,7 @@
ResourceMark rm(THREAD);
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_StackTraceElement_array(), true, CHECK_NH);
- objArrayKlass* ik = objArrayKlass::cast(k);
+ ObjArrayKlass* ik = ObjArrayKlass::cast(k);
objArrayOop r = oopFactory::new_objArray(ik, num_threads, CHECK_NH);
objArrayHandle result_obj(THREAD, r);
--- a/hotspot/src/share/vm/shark/sharkRuntime.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/shark/sharkRuntime.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -129,7 +129,7 @@
int ndims,
int* dims))
Klass* klass = method(thread)->constants()->klass_at(index, CHECK);
- oop obj = arrayKlass::cast(klass)->multi_allocate(ndims, dims, CHECK);
+ oop obj = ArrayKlass::cast(klass)->multi_allocate(ndims, dims, CHECK);
thread->set_vm_result(obj);
JRT_END
--- a/hotspot/src/share/vm/trace/tracing.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/trace/tracing.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/array.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/array.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
--- a/hotspot/src/share/vm/utilities/decoder.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/decoder.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/decoder_elf.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/decoder_elf.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/src/share/vm/utilities/dtrace.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/dtrace.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,6 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,13 +33,17 @@
#define DTRACE_ONLY(x) x
#define NOT_DTRACE(x)
+#if defined(SOLARIS)
// Work around dtrace tail call bug 6672627 until it is fixed in solaris 10.
#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
-#if defined(SOLARIS)
+#define USDT1 1
+#elif defined(LINUX)
+#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
#define USDT1 1
#elif defined(__APPLE__)
+#define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
#define USDT2 1
#include <sys/types.h>
#include "dtracefiles/hotspot.h"
@@ -63,6 +68,11 @@
#define DTRACE_PROBE3(a,b,c,d,e) {;}
#define DTRACE_PROBE4(a,b,c,d,e,f) {;}
#define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
+#define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;}
+#define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;}
+#define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;}
+#define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;}
+#define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;}
#else /* USDT2 */
@@ -76,10 +86,18 @@
#define HS_DTRACE_PROBE_FN(provider,name)\
__dtrace_##provider##___##name
+#ifdef SOLARIS
+// Solaris dtrace needs actual extern function decls.
#define HS_DTRACE_PROBE_DECL_N(provider,name,args) \
DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args)
#define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \
DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args)
+#else
+// Systemtap dtrace compatible probes on GNU/Linux don't.
+// If dtrace is disabled this macro becomes NULL
+#define HS_DTRACE_PROBE_DECL_N(provider,name,args)
+#define HS_DTRACE_PROBE_CDECL_N(provider,name,args)
+#endif
/* Dtrace probe declarations */
#define HS_DTRACE_PROBE_DECL(provider,name) \
@@ -118,6 +136,8 @@
uintptr_t,uintptr_t,uintptr_t))
/* Dtrace probe definitions */
+#if defined(SOLARIS)
+// Solaris dtrace uses actual function calls.
#define HS_DTRACE_PROBE_N(provider,name, args) \
DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args)
@@ -153,6 +173,33 @@
HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
(uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
(uintptr_t)a8,(uintptr_t)a9))
+#else
+// Systemtap dtrace compatible probes on GNU/Linux use direct macros.
+// If dtrace is disabled this macro becomes NULL
+#define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name)
+#define HS_DTRACE_PROBE0(provider,name)\
+ DTRACE_PROBE(provider,name)
+#define HS_DTRACE_PROBE1(provider,name,a0)\
+ DTRACE_PROBE1(provider,name,a0)
+#define HS_DTRACE_PROBE2(provider,name,a0,a1)\
+ DTRACE_PROBE2(provider,name,a0,a1)
+#define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\
+ DTRACE_PROBE3(provider,name,a0,a1,a2)
+#define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\
+ DTRACE_PROBE4(provider,name,a0,a1,a2,a3)
+#define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\
+ DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)
+#define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\
+ DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)
+#define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\
+ DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)
+#define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\
+ DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)
+#define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
+ DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
+#define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)\
+ DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)
+#endif
#endif /* !USDT2 */
--- a/hotspot/src/share/vm/utilities/elfFile.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/elfFile.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/elfFile.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/elfFile.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/elfStringTable.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/elfStringTable.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/elfStringTable.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/elfStringTable.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/elfSymbolTable.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/elfSymbolTable.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/elfSymbolTable.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/elfSymbolTable.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/globalDefinitions.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -111,11 +111,12 @@
case T_DOUBLE:
case T_LONG:
case T_OBJECT:
- case T_ADDRESS: // random raw pointer
- case T_METADATA: // metadata pointer
- case T_NARROWOOP: // compressed pointer
- case T_CONFLICT: // might as well support a bottom type
- case T_VOID: // padding or other unaddressed word
+ case T_ADDRESS: // random raw pointer
+ case T_METADATA: // metadata pointer
+ case T_NARROWOOP: // compressed pointer
+ case T_NARROWKLASS: // compressed klass pointer
+ case T_CONFLICT: // might as well support a bottom type
+ case T_VOID: // padding or other unaddressed word
// layout type must map to itself
assert(vt == ft, "");
break;
@@ -179,7 +180,7 @@
// Map BasicType to signature character
-char type2char_tab[T_CONFLICT+1]={ 0, 0, 0, 0, 'Z', 'C', 'F', 'D', 'B', 'S', 'I', 'J', 'L', '[', 'V', 0, 0, 0, 0};
+char type2char_tab[T_CONFLICT+1]={ 0, 0, 0, 0, 'Z', 'C', 'F', 'D', 'B', 'S', 'I', 'J', 'L', '[', 'V', 0, 0, 0, 0, 0};
// Map BasicType to Java type name
const char* type2name_tab[T_CONFLICT+1] = {
@@ -198,6 +199,7 @@
"*address*",
"*narrowoop*",
"*metadata*",
+ "*narrowklass*",
"*conflict*"
};
@@ -213,7 +215,7 @@
// Map BasicType to size in words
-int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, -1};
+int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, -1};
BasicType type2field[T_CONFLICT+1] = {
(BasicType)0, // 0,
@@ -234,7 +236,8 @@
T_ADDRESS, // T_ADDRESS = 15,
T_NARROWOOP, // T_NARROWOOP= 16,
T_METADATA, // T_METADATA = 17,
- T_CONFLICT // T_CONFLICT = 18,
+ T_NARROWKLASS, // T_NARROWKLASS = 18,
+ T_CONFLICT // T_CONFLICT = 19,
};
@@ -257,30 +260,32 @@
T_ADDRESS, // T_ADDRESS = 15,
T_NARROWOOP, // T_NARROWOOP = 16,
T_METADATA, // T_METADATA = 17,
- T_CONFLICT // T_CONFLICT = 18,
+ T_NARROWKLASS, // T_NARROWKLASS = 18,
+ T_CONFLICT // T_CONFLICT = 19,
};
int _type2aelembytes[T_CONFLICT+1] = {
- 0, // 0
- 0, // 1
- 0, // 2
- 0, // 3
- T_BOOLEAN_aelem_bytes, // T_BOOLEAN = 4,
- T_CHAR_aelem_bytes, // T_CHAR = 5,
- T_FLOAT_aelem_bytes, // T_FLOAT = 6,
- T_DOUBLE_aelem_bytes, // T_DOUBLE = 7,
- T_BYTE_aelem_bytes, // T_BYTE = 8,
- T_SHORT_aelem_bytes, // T_SHORT = 9,
- T_INT_aelem_bytes, // T_INT = 10,
- T_LONG_aelem_bytes, // T_LONG = 11,
- T_OBJECT_aelem_bytes, // T_OBJECT = 12,
- T_ARRAY_aelem_bytes, // T_ARRAY = 13,
- 0, // T_VOID = 14,
- T_OBJECT_aelem_bytes, // T_ADDRESS = 15,
- T_NARROWOOP_aelem_bytes,// T_NARROWOOP= 16,
- T_OBJECT_aelem_bytes, // T_METADATA = 17,
- 0 // T_CONFLICT = 18,
+ 0, // 0
+ 0, // 1
+ 0, // 2
+ 0, // 3
+ T_BOOLEAN_aelem_bytes, // T_BOOLEAN = 4,
+ T_CHAR_aelem_bytes, // T_CHAR = 5,
+ T_FLOAT_aelem_bytes, // T_FLOAT = 6,
+ T_DOUBLE_aelem_bytes, // T_DOUBLE = 7,
+ T_BYTE_aelem_bytes, // T_BYTE = 8,
+ T_SHORT_aelem_bytes, // T_SHORT = 9,
+ T_INT_aelem_bytes, // T_INT = 10,
+ T_LONG_aelem_bytes, // T_LONG = 11,
+ T_OBJECT_aelem_bytes, // T_OBJECT = 12,
+ T_ARRAY_aelem_bytes, // T_ARRAY = 13,
+ 0, // T_VOID = 14,
+ T_OBJECT_aelem_bytes, // T_ADDRESS = 15,
+ T_NARROWOOP_aelem_bytes, // T_NARROWOOP= 16,
+ T_OBJECT_aelem_bytes, // T_METADATA = 17,
+ T_NARROWKLASS_aelem_bytes, // T_NARROWKLASS= 18,
+ 0 // T_CONFLICT = 19,
};
#ifdef ASSERT
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -347,6 +347,14 @@
extern int LogMinObjAlignment;
extern int LogMinObjAlignmentInBytes;
+const int LogKlassAlignmentInBytes = 3;
+const int LogKlassAlignment = LogKlassAlignmentInBytes - LogHeapWordSize;
+const int KlassAlignmentInBytes = 1 << LogKlassAlignmentInBytes;
+const int KlassAlignment = KlassAlignmentInBytes / HeapWordSize;
+
+// Klass encoding metaspace max size
+const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes;
+
// Machine dependent stuff
#ifdef TARGET_ARCH_x86
@@ -481,22 +489,23 @@
// NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
enum BasicType {
- T_BOOLEAN = 4,
- T_CHAR = 5,
- T_FLOAT = 6,
- T_DOUBLE = 7,
- T_BYTE = 8,
- T_SHORT = 9,
- T_INT = 10,
- T_LONG = 11,
- T_OBJECT = 12,
- T_ARRAY = 13,
- T_VOID = 14,
- T_ADDRESS = 15,
- T_NARROWOOP= 16,
- T_METADATA = 17,
- T_CONFLICT = 18, // for stack value type with conflicting contents
- T_ILLEGAL = 99
+ T_BOOLEAN = 4,
+ T_CHAR = 5,
+ T_FLOAT = 6,
+ T_DOUBLE = 7,
+ T_BYTE = 8,
+ T_SHORT = 9,
+ T_INT = 10,
+ T_LONG = 11,
+ T_OBJECT = 12,
+ T_ARRAY = 13,
+ T_VOID = 14,
+ T_ADDRESS = 15,
+ T_NARROWOOP = 16,
+ T_METADATA = 17,
+ T_NARROWKLASS = 18,
+ T_CONFLICT = 19, // for stack value type with conflicting contents
+ T_ILLEGAL = 99
};
inline bool is_java_primitive(BasicType t) {
@@ -544,18 +553,19 @@
// NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
enum BasicTypeSize {
- T_BOOLEAN_size = 1,
- T_CHAR_size = 1,
- T_FLOAT_size = 1,
- T_DOUBLE_size = 2,
- T_BYTE_size = 1,
- T_SHORT_size = 1,
- T_INT_size = 1,
- T_LONG_size = 2,
- T_OBJECT_size = 1,
- T_ARRAY_size = 1,
- T_NARROWOOP_size = 1,
- T_VOID_size = 0
+ T_BOOLEAN_size = 1,
+ T_CHAR_size = 1,
+ T_FLOAT_size = 1,
+ T_DOUBLE_size = 2,
+ T_BYTE_size = 1,
+ T_SHORT_size = 1,
+ T_INT_size = 1,
+ T_LONG_size = 2,
+ T_OBJECT_size = 1,
+ T_ARRAY_size = 1,
+ T_NARROWOOP_size = 1,
+ T_NARROWKLASS_size = 1,
+ T_VOID_size = 0
};
@@ -567,23 +577,24 @@
// size in bytes
enum ArrayElementSize {
- T_BOOLEAN_aelem_bytes = 1,
- T_CHAR_aelem_bytes = 2,
- T_FLOAT_aelem_bytes = 4,
- T_DOUBLE_aelem_bytes = 8,
- T_BYTE_aelem_bytes = 1,
- T_SHORT_aelem_bytes = 2,
- T_INT_aelem_bytes = 4,
- T_LONG_aelem_bytes = 8,
+ T_BOOLEAN_aelem_bytes = 1,
+ T_CHAR_aelem_bytes = 2,
+ T_FLOAT_aelem_bytes = 4,
+ T_DOUBLE_aelem_bytes = 8,
+ T_BYTE_aelem_bytes = 1,
+ T_SHORT_aelem_bytes = 2,
+ T_INT_aelem_bytes = 4,
+ T_LONG_aelem_bytes = 8,
#ifdef _LP64
- T_OBJECT_aelem_bytes = 8,
- T_ARRAY_aelem_bytes = 8,
+ T_OBJECT_aelem_bytes = 8,
+ T_ARRAY_aelem_bytes = 8,
#else
- T_OBJECT_aelem_bytes = 4,
- T_ARRAY_aelem_bytes = 4,
+ T_OBJECT_aelem_bytes = 4,
+ T_ARRAY_aelem_bytes = 4,
#endif
- T_NARROWOOP_aelem_bytes = 4,
- T_VOID_aelem_bytes = 0
+ T_NARROWOOP_aelem_bytes = 4,
+ T_NARROWKLASS_aelem_bytes = 4,
+ T_VOID_aelem_bytes = 0
};
extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
--- a/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/growableArray.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/growableArray.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
--- a/hotspot/src/share/vm/utilities/histogram.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/histogram.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/utilities/histogram.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/histogram.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/utilities/intHisto.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/intHisto.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/utilities/intHisto.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/intHisto.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/utilities/macros.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/macros.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -34,26 +34,131 @@
// Makes a string of the macro expansion of a
#define XSTR(a) STR(a)
-// KERNEL variant
-#ifdef KERNEL
-#define COMPILER1
-#define SERIALGC
+// -DINCLUDE_<something>=0 | 1 can be specified on the command line to include
+// or exclude functionality.
+
+#ifndef INCLUDE_JVMTI
+#define INCLUDE_JVMTI 1
+#endif // INCLUDE_JVMTI
+
+#if INCLUDE_JVMTI
+#define JVMTI_ONLY(x) x
+#define NOT_JVMTI(x)
+#define NOT_JVMTI_RETURN
+#define NOT_JVMTI_RETURN_(code) /* next token must be ; */
+#else
+#define JVMTI_ONLY(x)
+#define NOT_JVMTI(x) x
+#define NOT_JVMTI_RETURN { return; }
+#define NOT_JVMTI_RETURN_(code) { return code; }
+#endif // INCLUDE_JVMTI
+
+#ifndef INCLUDE_FPROF
+#define INCLUDE_FPROF 1
+#endif
+
+#if INCLUDE_FPROF
+#define NOT_FPROF_RETURN /* next token must be ; */
+#define NOT_FPROF_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_FPROF_RETURN {}
+#define NOT_FPROF_RETURN_(code) { return code; }
+#endif // INCLUDE_FPROF
+
+#ifndef INCLUDE_VM_STRUCTS
+#define INCLUDE_VM_STRUCTS 1
+#endif
+
+#if INCLUDE_VM_STRUCTS
+#define NOT_VM_STRUCTS_RETURN /* next token must be ; */
+#define NOT_VM_STRUCTS_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_VM_STRUCTS_RETURN {}
+#define NOT_VM_STRUCTS_RETURN_(code) { return code; }
+#endif // INCLUDE_VM_STRUCTS
+
+#ifndef INCLUDE_JNI_CHECK
+#define INCLUDE_JNI_CHECK 1
+#endif
+
+#if INCLUDE_JNI_CHECK
+#define NOT_JNI_CHECK_RETURN /* next token must be ; */
+#define NOT_JNI_CHECK_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_JNI_CHECK_RETURN {}
+#define NOT_JNI_CHECK_RETURN_(code) { return code; }
+#endif // INCLUDE_JNI_CHECK
+
+#ifndef INCLUDE_SERVICES
+#define INCLUDE_SERVICES 1
+#endif
-#define JVMTI_KERNEL
-#define FPROF_KERNEL
-#define VM_STRUCTS_KERNEL
-#define JNICHECK_KERNEL
-#define SERVICES_KERNEL
+#if INCLUDE_SERVICES
+#define NOT_SERVICES_RETURN /* next token must be ; */
+#define NOT_SERVICES_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_SERVICES_RETURN {}
+#define NOT_SERVICES_RETURN_(code) { return code; }
+#endif // INCLUDE_SERVICES
+
+#ifndef INCLUDE_CDS
+#define INCLUDE_CDS 1
+#endif
+
+#if INCLUDE_CDS
+#define CDS_ONLY(x) x
+#define NOT_CDS(x)
+#define NOT_CDS_RETURN /* next token must be ; */
+#define NOT_CDS_RETURN_(code) /* next token must be ; */
+#else
+#define CDS_ONLY(x)
+#define NOT_CDS(x) x
+#define NOT_CDS_RETURN {}
+#define NOT_CDS_RETURN_(code) { return code; }
+#endif // INCLUDE_CDS
+
+#ifndef INCLUDE_MANAGEMENT
+#define INCLUDE_MANAGEMENT 1
+#endif // INCLUDE_MANAGEMENT
-#define KERNEL_RETURN {}
-#define KERNEL_RETURN_(code) { return code; }
+#if INCLUDE_MANAGEMENT
+#define NOT_MANAGEMENT_RETURN /* next token must be ; */
+#define NOT_MANAGEMENT_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_MANAGEMENT_RETURN {}
+#define NOT_MANAGEMENT_RETURN_(code) { return code; }
+#endif // INCLUDE_MANAGEMENT
-#else // KERNEL
+/*
+ * When INCLUDE_ALTERNATE_GCS is false the only garbage collectors
+ * included in the JVM are defaultNewGeneration and markCompact.
+ *
+ * When INCLUDE_ALTERNATE_GCS is true all garbage collectors are
+ * included in the JVM.
+ */
+#ifndef INCLUDE_ALTERNATE_GCS
+#define INCLUDE_ALTERNATE_GCS 1
+#endif // INCLUDE_ALTERNATE_GCS
-#define KERNEL_RETURN /* next token must be ; */
-#define KERNEL_RETURN_(code) /* next token must be ; */
+#if INCLUDE_ALTERNATE_GCS
+#define NOT_ALTERNATE_GCS_RETURN /* next token must be ; */
+#define NOT_ALTERNATE_GCS_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_ALTERNATE_GCS_RETURN {}
+#define NOT_ALTERNATE_GCS_RETURN_(code) { return code; }
+#endif // INCLUDE_ALTERNATE_GCS
-#endif // KERNEL
+#ifndef INCLUDE_NMT
+#define INCLUDE_NMT 1
+#endif // INCLUDE_NMT
+
+#if INCLUDE_NMT
+#define NOT_NMT_RETURN /* next token must be ; */
+#define NOT_NMT_RETURN_(code) /* next token must be ; */
+#else
+#define NOT_NMT_RETURN {}
+#define NOT_NMT_RETURN_(code) { return code; }
+#endif // INCLUDE_NMT
// COMPILER1 variant
#ifdef COMPILER1
--- a/hotspot/src/share/vm/utilities/ostream.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/ostream.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -759,7 +759,7 @@
if (has_log) {
_log_file->bol();
// output a hint where this output is coming from:
- _log_file->print_cr("<writer thread='"INTX_FORMAT"'/>", writer_id);
+ _log_file->print_cr("<writer thread='" UINTX_FORMAT "'/>", writer_id);
}
_last_writer = writer_id;
}
--- a/hotspot/src/share/vm/utilities/preserveException.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/preserveException.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
--- a/hotspot/src/share/vm/utilities/stack.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/stack.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
--- a/hotspot/src/share/vm/utilities/stack.inline.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/stack.inline.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/utilities/vmError.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/vmError.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
--- a/hotspot/src/share/vm/utilities/workgroup.cpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/workgroup.cpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, 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
--- a/hotspot/src/share/vm/utilities/workgroup.hpp Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/src/share/vm/utilities/workgroup.hpp Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
--- a/hotspot/test/compiler/6859338/Test6859338.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/test/compiler/6859338/Test6859338.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
--- a/hotspot/test/compiler/7116216/StackOverflow.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/test/compiler/7116216/StackOverflow.java Wed Jul 05 18:25:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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
--- a/hotspot/test/runtime/7194254/Test7194254.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/test/runtime/7194254/Test7194254.java Wed Jul 05 18:25:45 2017 +0200
@@ -27,7 +27,7 @@
* @summary Creates several threads with different java priorities and checks
* whether jstack reports correct priorities for them.
*
- * @run main T7194254
+ * @run main Test7194254
*/
import java.io.BufferedReader;
--- a/hotspot/test/runtime/7196045/Test7196045.java Thu Oct 11 16:59:50 2012 -0700
+++ b/hotspot/test/runtime/7196045/Test7196045.java Wed Jul 05 18:25:45 2017 +0200
@@ -26,7 +26,7 @@
* @test
* @bug 7196045
* @summary Possible JVM deadlock in ThreadTimesClosure when using HotspotInternal non-public API.
- * @run main/othervm
+ * @run main/othervm Test7196045
*/
import java.lang.management.ManagementFactory;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/serviceability/7170638/SDTProbesGNULinuxTest.sh Wed Jul 05 18:25:45 2017 +0200
@@ -0,0 +1,68 @@
+#
+# Copyright (c) 2012, Red Hat, Inc.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test SDTProbesGNULinuxTest.sh
+# @bug 7170638
+# @summary Test SDT probes available on GNU/Linux when DTRACE_ENABLED
+# @run shell SDTProbesGNULinuxTest.sh
+
+# This test only matters on GNU/Linux, others trivially PASS.
+OS=`uname -s`
+case "$OS" in
+ Linux )
+ ;;
+ *)
+ echo "Not testing on anything but GNU/Linux. PASSED"
+ exit 0;
+ ;;
+esac
+
+# Where is our java (parent) directory?
+if [ "${TESTJAVA}" = "" ]; then
+ PARENT=$(dirname $(readlink -f $(which java)))
+ TESTJAVA=`dirname ${PARENT}`
+ echo "TESTJAVA directory not set, using " ${TESTJAVA}
+fi
+
+# This test only matters when build with DTRACE_ENABLED.
+${TESTJAVA}/bin/java -XX:+ExtendedDTraceProbes -version
+if [ "$?" != "0" ]; then
+ echo "Not build using DTRACE_ENABLED. PASSED"
+ exit 0
+fi
+
+# Test all available libjvm.so variants
+for libjvm in $(find ${TESTJAVA} -name libjvm.so); do
+ echo "Testing ${libjvm}"
+ # Check whether the SDT probes are compiled in.
+ readelf -S ${libjvm} | grep '.note.stapsdt'
+ if [ "$?" != "0" ]; then
+ echo "Failed: ${libjvm} doesn't contain SDT probes."
+ exit 1
+ fi
+ # We could iterate over all SDT probes and test them individually
+ # with readelf -n, but older readelf versions don't understand them.
+done
+
+echo "Passed."
+exit 0