This commit is contained in:
Lana Steuck 2009-11-25 14:37:03 -08:00
commit 65690ed0dc
5557 changed files with 43126 additions and 1080082 deletions

View file

@ -48,3 +48,5 @@ bca2225b66d78c4bf4d9801f54cac7715a598650 jdk7-b68
c5d39b6be65cba0effb5f466ea48fe43764d0e0c jdk7-b71 c5d39b6be65cba0effb5f466ea48fe43764d0e0c jdk7-b71
df4bcd06e1d0ab306efa5a44f24a409dc0c0c742 jdk7-b72 df4bcd06e1d0ab306efa5a44f24a409dc0c0c742 jdk7-b72
ce74bd35ce948d629a356e168797f44b593b1578 jdk7-b73 ce74bd35ce948d629a356e168797f44b593b1578 jdk7-b73
4e7661eaa211e186674f6cbefec4aef1144ac2a0 jdk7-b74
946518568340c4e511549318f19f47f06b7f5f9b jdk7-b75

View file

@ -48,3 +48,5 @@ e1b972ff53cd58f825791f8ed9b2deffd16e768c jdk7-b68
4c36e9853dda27bdac5ef4839a610509fbe31d34 jdk7-b71 4c36e9853dda27bdac5ef4839a610509fbe31d34 jdk7-b71
0d7e03b426df27c21dcc44ffb9178eacd1b04f10 jdk7-b72 0d7e03b426df27c21dcc44ffb9178eacd1b04f10 jdk7-b72
3ac6dcf7823205546fbbc3d4ea59f37358d0b0d4 jdk7-b73 3ac6dcf7823205546fbbc3d4ea59f37358d0b0d4 jdk7-b73
2c88089b6e1c053597418099a14232182c387edc jdk7-b74
d1516b9f23954b29b8e76e6f4efc467c08c78133 jdk7-b75

View file

@ -545,7 +545,11 @@
</li> </li>
<li> <li>
<strong>Windows:</strong> <strong>Windows:</strong>
Make sure you start your build inside a bash/sh/ksh shell. Make sure you start your build inside a bash/sh/ksh shell
and are using a <tt>make.exe</tt> utility built for that
environment (a cygwin <tt>make.exe</tt> is not the same
as a <tt>make.exe</tt> built for something like
<a href="http://www.mkssoftware.com/">MKS</a>).
<br> <br>
<b>WARNING:</b> Watch out for make version 3.81, it may <b>WARNING:</b> Watch out for make version 3.81, it may
not work due to a lack of support for MS-DOS drive letter paths not work due to a lack of support for MS-DOS drive letter paths
@ -826,7 +830,8 @@
All OpenJDK builds require access to the previously released All OpenJDK builds require access to the previously released
JDK 6, this is often called a bootstrap JDK. JDK 6, this is often called a bootstrap JDK.
The JDK 6 binaries can be downloaded from Sun's The JDK 6 binaries can be downloaded from Sun's
<a href="http://java.sun.com/javase/1.6.0/download.html" target="_blank">JDK 6 download site</a>. <a href="http://java.sun.com/javase/downloads/index.jsp"
target="_blank">JDK 6 download site</a>.
For build performance reasons For build performance reasons
is very important that this bootstrap JDK be made available on the is very important that this bootstrap JDK be made available on the
local disk of the machine doing the build. local disk of the machine doing the build.

View file

@ -48,3 +48,5 @@ a12ea7c7b497b4ba7830550095ef633bd6f43971 jdk7-b67
3f1ef7f899ea2aec189c4fb67e5c8fa374437c50 jdk7-b71 3f1ef7f899ea2aec189c4fb67e5c8fa374437c50 jdk7-b71
c793a31209263fbb867c23c752599d85c21abb73 jdk7-b72 c793a31209263fbb867c23c752599d85c21abb73 jdk7-b72
b751c528c55560cf2adeaeef24b39ca1f4d1cbf7 jdk7-b73 b751c528c55560cf2adeaeef24b39ca1f4d1cbf7 jdk7-b73
5d0cf59a3203b9f57aceebc33ae656b884987955 jdk7-b74
0fb137085952c8e47878e240d1cb40f14de463c4 jdk7-b75

View file

@ -99,8 +99,16 @@ CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9 LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9 CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
LDFLAGS_COMMON_sparc += -m32 -mcpu=v9 LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) ifeq ($(ZERO_BUILD), true)
LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
ifeq ($(ZERO_ENDIANNESS), little)
CFLAGS_REQUIRED += -D_LITTLE_ENDIAN
endif
LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
else
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
endif
# Add in platform specific optimizations for all opt levels # Add in platform specific optimizations for all opt levels
CC_HIGHEST_OPT += $(_OPT_$(ARCH)) CC_HIGHEST_OPT += $(_OPT_$(ARCH))
@ -196,7 +204,7 @@ endif
EXTRA_LIBS += -lc EXTRA_LIBS += -lc
LDFLAGS_DEFS_OPTION = -z defs LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs
LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
# #

View file

@ -70,6 +70,11 @@ ifeq ($(PLATFORM), linux)
else else
CXX = $(COMPILER_PATH)g++ CXX = $(COMPILER_PATH)g++
endif endif
ifeq ($(ZERO_BUILD), true)
# zero
REQUIRED_CC_VER = 3.2
REQUIRED_GCC_VER = 3.2.*
else
ifneq ("$(findstring sparc,$(ARCH))", "") ifneq ("$(findstring sparc,$(ARCH))", "")
# sparc or sparcv9 # sparc or sparcv9
REQUIRED_CC_VER = 4.0 REQUIRED_CC_VER = 4.0
@ -88,6 +93,7 @@ ifeq ($(PLATFORM), linux)
endif endif
endif endif
endif endif
endif
# Option used to create a shared library # Option used to create a shared library
SHARED_LIBRARY_FLAG = -shared -mimpure-text SHARED_LIBRARY_FLAG = -shared -mimpure-text
SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 ) SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )

View file

@ -48,3 +48,5 @@ d07e68298d4e17ebf93d8299e43fcc3ded26472a jdk7-b68
50a95aa4a247f0cbbf66df285a8b1d78ffb153d9 jdk7-b71 50a95aa4a247f0cbbf66df285a8b1d78ffb153d9 jdk7-b71
a94714c550658fd6741793ef036cb9625dc2ab1a jdk7-b72 a94714c550658fd6741793ef036cb9625dc2ab1a jdk7-b72
faf94d94786b621f8e13cbcc941ca69c6d967c3f jdk7-b73 faf94d94786b621f8e13cbcc941ca69c6d967c3f jdk7-b73
f4b900403d6e4b0af51447bd13bbe23fe3a1dac7 jdk7-b74
d8dd291a362acb656026a9c0a9da48501505a1e7 jdk7-b75

View file

@ -48,8 +48,16 @@ if [ "$OS" = "Linux" ]; then
CPU=i386 CPU=i386
fi fi
else else
# configure audit helper library if SA_ALTROOT is set
if [ -n "$SA_ALTROOT" ]; then
LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so
export LD_AUDIT_32 export LD_AUDIT_32
if [ ! -f $LD_AUDIT_32 ]; then
echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
echo "Make sure to build it with 'make natives'."
exit 1
fi
fi
SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p` SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"
CPU=sparc CPU=sparc

View file

@ -43,8 +43,16 @@ else
fi fi
fi fi
LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so # configure audit helper library if SA_ALTROOT is set
export LD_AUDIT_64 if [ -n "$SA_ALTROOT" ]; then
LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so
export LD_AUDIT_64
if [ ! -f $LD_AUDIT_64 ]; then
echo "SA_ALTROOT is set and can't find libsaproc_audit.so."
echo "Make sure to build it with 'make natives'."
exit 1
fi
fi
SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU
OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger"

View file

@ -926,6 +926,28 @@ public class CommandProcessor {
} }
} }
}, },
new Command("dumpcodecache", "dumpcodecache", false) {
public void doit(Tokens t) {
if (t.countTokens() != 0) {
usage();
} else {
final PrintStream fout = out;
final HTMLGenerator gen = new HTMLGenerator(false);
CodeCacheVisitor v = new CodeCacheVisitor() {
public void prologue(Address start, Address end) {
}
public void visit(CodeBlob blob) {
fout.println(gen.genHTML(blob.instructionsBegin()));
}
public void epilogue() {
}
};
VM.getVM().getCodeCache().iterate(v);
}
}
},
new Command("where", "where { -a | id }", false) { new Command("where", "where { -a | id }", false) {
public void doit(Tokens t) { public void doit(Tokens t) {
if (t.countTokens() != 1) { if (t.countTokens() != 1) {

View file

@ -173,7 +173,8 @@ public class CodeCache {
CodeBlob lastBlob = null; CodeBlob lastBlob = null;
while (ptr != null && ptr.lessThan(end)) { while (ptr != null && ptr.lessThan(end)) {
try { try {
CodeBlob blob = findBlobUnsafe(ptr); // Use findStart to get a pointer inside blob other findBlob asserts
CodeBlob blob = findBlobUnsafe(heap.findStart(ptr));
if (blob != null) { if (blob != null) {
visitor.visit(blob); visitor.visit(blob);
if (blob == lastBlob) { if (blob == lastBlob) {

View file

@ -42,7 +42,7 @@ public class NMethod extends CodeBlob {
/** To support simple linked-list chaining of nmethods */ /** To support simple linked-list chaining of nmethods */
private static AddressField osrLinkField; private static AddressField osrLinkField;
private static AddressField scavengeRootLinkField; private static AddressField scavengeRootLinkField;
private static CIntegerField scavengeRootStateField; private static JByteField scavengeRootStateField;
/** Offsets for different nmethod parts */ /** Offsets for different nmethod parts */
private static CIntegerField exceptionOffsetField; private static CIntegerField exceptionOffsetField;
@ -92,7 +92,7 @@ public class NMethod extends CodeBlob {
entryBCIField = type.getCIntegerField("_entry_bci"); entryBCIField = type.getCIntegerField("_entry_bci");
osrLinkField = type.getAddressField("_osr_link"); osrLinkField = type.getAddressField("_osr_link");
scavengeRootLinkField = type.getAddressField("_scavenge_root_link"); scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
scavengeRootStateField = type.getCIntegerField("_scavenge_root_state"); scavengeRootStateField = type.getJByteField("_scavenge_root_state");
exceptionOffsetField = type.getCIntegerField("_exception_offset"); exceptionOffsetField = type.getCIntegerField("_exception_offset");
deoptOffsetField = type.getCIntegerField("_deoptimize_offset"); deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
@ -274,7 +274,7 @@ public class NMethod extends CodeBlob {
if (Assert.ASSERTS_ENABLED) { if (Assert.ASSERTS_ENABLED) {
Assert.that(pd != null, "scope must be present"); Assert.that(pd != null, "scope must be present");
} }
return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getReexecute()); return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute());
} }
/** This is only for use by the debugging system, and is only /** This is only for use by the debugging system, and is only
@ -306,11 +306,11 @@ public class NMethod extends CodeBlob {
public ScopeDesc getScopeDescNearDbg(Address pc) { public ScopeDesc getScopeDescNearDbg(Address pc) {
PCDesc pd = getPCDescNearDbg(pc); PCDesc pd = getPCDescNearDbg(pc);
if (pd == null) return null; if (pd == null) return null;
return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getReexecute()); return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute());
} }
public Map/*<Address, PcDesc>*/ getSafepoints() { public Map/*<Address, PCDesc>*/ getSafepoints() {
Map safepoints = new HashMap(); // Map<Address, PcDesc> Map safepoints = new HashMap(); // Map<Address, PCDesc>
sun.jvm.hotspot.debugger.Address p = null; sun.jvm.hotspot.debugger.Address p = null;
for (p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); for (p = scopesPCsBegin(); p.lessThan(scopesPCsEnd());
p = p.addOffsetTo(pcDescSize)) { p = p.addOffsetTo(pcDescSize)) {

View file

@ -36,6 +36,7 @@ import sun.jvm.hotspot.types.*;
public class PCDesc extends VMObject { public class PCDesc extends VMObject {
private static CIntegerField pcOffsetField; private static CIntegerField pcOffsetField;
private static CIntegerField scopeDecodeOffsetField; private static CIntegerField scopeDecodeOffsetField;
private static CIntegerField objDecodeOffsetField;
private static CIntegerField pcFlagsField; private static CIntegerField pcFlagsField;
static { static {
@ -51,6 +52,7 @@ public class PCDesc extends VMObject {
pcOffsetField = type.getCIntegerField("_pc_offset"); pcOffsetField = type.getCIntegerField("_pc_offset");
scopeDecodeOffsetField = type.getCIntegerField("_scope_decode_offset"); scopeDecodeOffsetField = type.getCIntegerField("_scope_decode_offset");
objDecodeOffsetField = type.getCIntegerField("_obj_decode_offset");
pcFlagsField = type.getCIntegerField("_flags"); pcFlagsField = type.getCIntegerField("_flags");
} }
@ -68,6 +70,10 @@ public class PCDesc extends VMObject {
return ((int) scopeDecodeOffsetField.getValue(addr)); return ((int) scopeDecodeOffsetField.getValue(addr));
} }
public int getObjDecodeOffset() {
return ((int) objDecodeOffsetField.getValue(addr));
}
public Address getRealPC(NMethod code) { public Address getRealPC(NMethod code) {
return code.instructionsBegin().addOffsetTo(getPCOffset()); return code.instructionsBegin().addOffsetTo(getPCOffset());
} }

View file

@ -51,11 +51,10 @@ public class ScopeDesc {
/** Scalar replaced bjects pool */ /** Scalar replaced bjects pool */
private List objects; // ArrayList<ScopeValue> private List objects; // ArrayList<ScopeValue>
private ScopeDesc(NMethod code, int decodeOffset, List objects, boolean reexecute) {
public ScopeDesc(NMethod code, int decodeOffset, boolean reexecute) {
this.code = code; this.code = code;
this.decodeOffset = decodeOffset; this.decodeOffset = decodeOffset;
this.objects = decodeObjectValues(DebugInformationRecorder.SERIALIZED_NULL); this.objects = objects;
this.reexecute = reexecute; this.reexecute = reexecute;
// Decode header // Decode header
@ -108,7 +107,7 @@ public class ScopeDesc {
return decodeMonitorValues(monitorsDecodeOffset); return decodeMonitorValues(monitorsDecodeOffset);
} }
/** Returns a List&lt;MonitorValue&gt; */ /** Returns a List&lt;ObjectValue&gt; */
public List getObjects() { public List getObjects() {
return objects; return objects;
} }
@ -119,7 +118,7 @@ public class ScopeDesc {
return null; return null;
} }
return new ScopeDesc(code, senderDecodeOffset, false); return new ScopeDesc(code, senderDecodeOffset, objects, false);
} }
/** Returns where the scope was decoded */ /** Returns where the scope was decoded */

View file

@ -807,6 +807,9 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
Interpreter interp = VM.getVM().getInterpreter(); Interpreter interp = VM.getVM().getInterpreter();
if (interp.contains(pc)) { if (interp.contains(pc)) {
InterpreterCodelet codelet = interp.getCodeletContaining(pc); InterpreterCodelet codelet = interp.getCodeletContaining(pc);
if (codelet == null) {
return "Unknown location in the Interpreter: " + pc;
}
return genHTML(codelet); return genHTML(codelet);
} }
return genHTML(blob); return genHTML(blob);
@ -972,10 +975,18 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
ScopeDesc sd = nm.getScopeDescAt(pcDesc.getRealPC(nm)); ScopeDesc sd = nm.getScopeDescAt(pcDesc.getRealPC(nm));
Formatter buf = new Formatter(genHTML); Formatter buf = new Formatter(genHTML);
Formatter tabs = new Formatter(genHTML); Formatter tabs = new Formatter(genHTML);
tabs.append(tab + tab + tab); // Initial indent for debug info
buf.beginTag("pre"); buf.beginTag("pre");
genScope(buf, tabs, sd); genScope(buf, tabs, sd);
// Reset indent for scalar replaced objects
tabs = new Formatter(genHTML);
tabs.append(tab + tab + tab); // Initial indent for debug info
genScObjInfo(buf, tabs, sd);
buf.endTag("pre"); buf.endTag("pre");
buf.append(genOopMapInfo(nm, pcDesc)); buf.append(genOopMapInfo(nm, pcDesc));
return buf.toString(); return buf.toString();
@ -1022,8 +1033,95 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append(genHTMLForMonitors(sd, monitors)); buf.append(genHTMLForMonitors(sd, monitors));
} }
tabs.append(tab);
buf.br(); buf.br();
tabs.append(tab);
}
protected void genScObjInfo(Formatter buf, Formatter tabs, ScopeDesc sd) {
if (sd == null) {
return;
}
List objects = sd.getObjects();
if (objects == null) {
return;
}
int length = objects.size();
for (int i = 0; i < length; i++) {
buf.append(tabs);
ObjectValue ov = (ObjectValue)objects.get(i);
buf.append("ScObj" + i);
ScopeValue sv = ov.getKlass();
if (Assert.ASSERTS_ENABLED) {
Assert.that(sv.isConstantOop(), "scalar replaced object klass must be constant oop");
}
ConstantOopReadValue klv = (ConstantOopReadValue)sv;
OopHandle klHandle = klv.getValue();
if (Assert.ASSERTS_ENABLED) {
Assert.that(klHandle != null, "scalar replaced object klass must be not NULL");
}
Oop obj = VM.getVM().getObjectHeap().newOop(klHandle);
if (obj instanceof InstanceKlass) {
InstanceKlass kls = (InstanceKlass) obj;
buf.append(" " + kls.getName().asString() + "={");
int flen = ov.fieldsSize();
TypeArray klfields = kls.getFields();
int klen = (int) klfields.getLength();
ConstantPool cp = kls.getConstants();
int findex = 0;
for (int index = 0; index < klen; index += kls.NEXT_OFFSET) {
int accsFlags = klfields.getShortAt(index + kls.ACCESS_FLAGS_OFFSET);
int nameIndex = klfields.getShortAt(index + kls.NAME_INDEX_OFFSET);
AccessFlags access = new AccessFlags(accsFlags);
if (!access.isStatic()) {
ScopeValue svf = ov.getFieldAt(findex++);
String fstr = scopeValueAsString(sd, svf);
Symbol f_name = cp.getSymbolAt(nameIndex);
buf.append(" [" + f_name.asString() + " :"+ index + "]=(#" + fstr + ")");
}
}
buf.append(" }");
} else {
buf.append(" ");
int flen = ov.fieldsSize();
if (obj instanceof TypeArrayKlass) {
TypeArrayKlass kls = (TypeArrayKlass) obj;
buf.append(kls.getElementTypeName() + "[" + flen + "]");
} else if (obj instanceof ObjArrayKlass) {
ObjArrayKlass kls = (ObjArrayKlass) obj;
Klass elobj = kls.getBottomKlass();
if (elobj instanceof InstanceKlass) {
buf.append(elobj.getName().asString());
} else if (elobj instanceof TypeArrayKlass) {
TypeArrayKlass elkls = (TypeArrayKlass) elobj;
buf.append(elkls.getElementTypeName());
} else {
if (Assert.ASSERTS_ENABLED) {
Assert.that(false, "unknown scalar replaced object klass!");
}
}
buf.append("[" + flen + "]");
int ndim = (int) kls.getDimension();
while (--ndim > 0) {
buf.append("[]");
}
} else {
if (Assert.ASSERTS_ENABLED) {
Assert.that(false, "unknown scalar replaced object klass!");
}
}
buf.append("={");
for (int findex = 0; findex < flen; findex++) {
ScopeValue svf = ov.getFieldAt(findex);
String fstr = scopeValueAsString(sd, svf);
buf.append(" [" + findex + "]=(#" + fstr + ")");
}
buf.append(" }");
}
buf.br();
}
} }
protected String genHTMLForOopMap(OopMap map) { protected String genHTMLForOopMap(OopMap map) {
@ -1037,8 +1135,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
tmpBuf.beginTag("tr"); tmpBuf.beginTag("tr");
tmpBuf.beginTag("td"); tmpBuf.beginTag("td");
tmpBuf.append(type); tmpBuf.append(type);
tmpBuf.endTag("td");
tmpBuf.endTag("tr");
for (; ! oms.isDone(); oms.next()) { for (; ! oms.isDone(); oms.next()) {
OopMapValue omv = oms.getCurrent(); OopMapValue omv = oms.getCurrent();
if (omv == null) { if (omv == null) {
@ -1048,7 +1144,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
VMReg vmReg = omv.getReg(); VMReg vmReg = omv.getReg();
int reg = vmReg.getValue(); int reg = vmReg.getValue();
if (reg < stack0) { if (reg < stack0) {
tmpBuf.append(VMRegImpl.getRegisterName(vmReg.getValue())); tmpBuf.append(VMRegImpl.getRegisterName(reg));
} else { } else {
tmpBuf.append('['); tmpBuf.append('[');
tmpBuf.append(Integer.toString((reg - stack0) * 4)); tmpBuf.append(Integer.toString((reg - stack0) * 4));
@ -1058,7 +1154,13 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
tmpBuf.append(" = "); tmpBuf.append(" = ");
VMReg vmContentReg = omv.getContentReg(); VMReg vmContentReg = omv.getContentReg();
int contentReg = vmContentReg.getValue(); int contentReg = vmContentReg.getValue();
tmpBuf.append(VMRegImpl.getRegisterName(vmContentReg.getValue())); if (contentReg < stack0) {
tmpBuf.append(VMRegImpl.getRegisterName(contentReg));
} else {
tmpBuf.append('[');
tmpBuf.append(Integer.toString((contentReg - stack0) * 4));
tmpBuf.append(']');
}
} }
tmpBuf.append(spaces); tmpBuf.append(spaces);
} }
@ -1072,19 +1174,19 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
OopMapValueIterator omvIterator = new OopMapValueIterator(); OopMapValueIterator omvIterator = new OopMapValueIterator();
OopMapStream oms = new OopMapStream(map, OopMapValue.OopTypes.OOP_VALUE); OopMapStream oms = new OopMapStream(map, OopMapValue.OopTypes.OOP_VALUE);
buf.append(omvIterator.iterate(oms, "Oop:", false)); buf.append(omvIterator.iterate(oms, "Oops:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.VALUE_VALUE);
buf.append(omvIterator.iterate(oms, "Value:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.NARROWOOP_VALUE); oms = new OopMapStream(map, OopMapValue.OopTypes.NARROWOOP_VALUE);
buf.append(omvIterator.iterate(oms, "Oop:", false)); buf.append(omvIterator.iterate(oms, "narrowOops:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.VALUE_VALUE);
buf.append(omvIterator.iterate(oms, "Values:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.CALLEE_SAVED_VALUE); oms = new OopMapStream(map, OopMapValue.OopTypes.CALLEE_SAVED_VALUE);
buf.append(omvIterator.iterate(oms, "Callee saved:", true)); buf.append(omvIterator.iterate(oms, "Callee saved:", true));
oms = new OopMapStream(map, OopMapValue.OopTypes.DERIVED_OOP_VALUE); oms = new OopMapStream(map, OopMapValue.OopTypes.DERIVED_OOP_VALUE);
buf.append(omvIterator.iterate(oms, "Derived oop:", true)); buf.append(omvIterator.iterate(oms, "Derived oops:", true));
buf.endTag("table"); buf.endTag("table");
return buf.toString(); return buf.toString();
@ -1093,6 +1195,8 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
protected String genOopMapInfo(NMethod nmethod, PCDesc pcDesc) { protected String genOopMapInfo(NMethod nmethod, PCDesc pcDesc) {
OopMapSet mapSet = nmethod.getOopMaps(); OopMapSet mapSet = nmethod.getOopMaps();
if (mapSet == null || (mapSet.getSize() <= 0))
return "";
int pcOffset = pcDesc.getPCOffset(); int pcOffset = pcDesc.getPCOffset();
OopMap map = mapSet.findMapAtOffset(pcOffset, VM.getVM().isDebugging()); OopMap map = mapSet.findMapAtOffset(pcOffset, VM.getVM().isDebugging());
if (map == null) { if (map == null) {
@ -1106,6 +1210,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
Formatter buf = new Formatter(genHTML); Formatter buf = new Formatter(genHTML);
buf.beginTag("pre"); buf.beginTag("pre");
buf.append("OopMap: "); buf.append("OopMap: ");
buf.br();
buf.append(genHTMLForOopMap(map)); buf.append(genHTMLForOopMap(map));
buf.endTag("pre"); buf.endTag("pre");
@ -1154,7 +1259,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
return buf.toString(); return buf.toString();
} }
private String scopeValueAsString(ScopeValue sv) { private String scopeValueAsString(ScopeDesc sd, ScopeValue sv) {
Formatter buf = new Formatter(genHTML); Formatter buf = new Formatter(genHTML);
if (sv.isConstantInt()) { if (sv.isConstantInt()) {
buf.append("int "); buf.append("int ");
@ -1187,6 +1292,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
} else { } else {
buf.append("null"); buf.append("null");
} }
} else if (sv.isObject()) {
ObjectValue ov = (ObjectValue)sv;
buf.append("#ScObj" + sd.getObjects().indexOf(ov));
} else {
buf.append("unknown scope value " + sv);
} }
return buf.toString(); return buf.toString();
} }
@ -1219,7 +1329,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
} }
buf.append(", "); buf.append(", ");
buf.append(scopeValueAsString(sv)); buf.append(scopeValueAsString(sd, sv));
buf.append(") "); buf.append(") ");
} }
@ -1246,7 +1356,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append("(owner = "); buf.append("(owner = ");
ScopeValue owner = mv.owner(); ScopeValue owner = mv.owner();
if (owner != null) { if (owner != null) {
buf.append(scopeValueAsString(owner)); buf.append(scopeValueAsString(sd, owner));
} else { } else {
buf.append("null"); buf.append("null");
} }
@ -1324,11 +1434,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append(instr.asString(currentPc, symFinder)); buf.append(instr.asString(currentPc, symFinder));
} }
buf.br();
if (isSafepoint && !prevWasCall) { if (isSafepoint && !prevWasCall) {
buf.append(genSafepointInfo(nmethod, pcDesc)); buf.append(genSafepointInfo(nmethod, pcDesc));
} }
buf.br();
prevWasCall = instr.isCall(); prevWasCall = instr.isCall();
} }

View file

@ -1047,7 +1047,7 @@ while (tmp.itr.hasNext()) {
} else { } else {
// some type names have ':'. replace to make it as a // some type names have ':'. replace to make it as a
// JavaScript identifier // JavaScript identifier
tmp.name = tmp.name.replace(':', '_'); tmp.name = tmp.name.replace(':', '_').replace('<', '_').replace('>', '_').replace('*', '_').replace(' ', '_');
eval("function read" + tmp.name + "(addr) {" + eval("function read" + tmp.name + "(addr) {" +
" return readVMType('" + tmp.name + "', addr);}"); " return readVMType('" + tmp.name + "', addr);}");
eval("function print" + tmp.name + "(addr) {" + eval("function print" + tmp.name + "(addr) {" +

View file

@ -84,6 +84,7 @@ endif
C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1 C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
C2_VM_TARGETS=product fastdebug optimized jvmg C2_VM_TARGETS=product fastdebug optimized jvmg
KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
# JDK directory list # JDK directory list
JDK_DIRS=bin include jre lib demo JDK_DIRS=bin include jre lib demo
@ -94,6 +95,12 @@ all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
all_debug: jvmg jvmg1 jvmgkernel docs export_debug all_debug: jvmg jvmg1 jvmgkernel docs export_debug
all_optimized: optimized optimized1 optimizedkernel docs export_optimized all_optimized: optimized optimized1 optimizedkernel docs export_optimized
allzero: all_productzero all_fastdebugzero
all_productzero: productzero docs export_product
all_fastdebugzero: fastdebugzero docs export_fastdebug
all_debugzero: jvmgzero docs export_debug
all_optimizedzero: optimizedzero docs export_optimized
# Do everything # Do everything
world: all create_jdk world: all create_jdk
@ -120,6 +127,10 @@ $(KERNEL_VM_TARGETS):
$(CD) $(GAMMADIR)/make; \ $(CD) $(GAMMADIR)/make; \
$(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT) $(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
$(ZERO_VM_TARGETS):
$(CD) $(GAMMADIR)/make; \
$(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
# Build compiler1 (client) rule, different for platforms # Build compiler1 (client) rule, different for platforms
generic_build1: generic_build1:
$(MKDIR) -p $(OUTPUTDIR) $(MKDIR) -p $(OUTPUTDIR)
@ -180,6 +191,12 @@ else
@$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)" @$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
endif endif
generic_buildzero:
$(MKDIR) -p $(OUTPUTDIR)
$(CD) $(OUTPUTDIR); \
$(MAKE) -f $(ABS_OS_MAKEFILE) \
$(MAKE_ARGS) $(VM_TARGET)
# Export file rule # Export file rule
generic_export: $(EXPORT_LIST) generic_export: $(EXPORT_LIST)
export_product: export_product:
@ -210,11 +227,17 @@ DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1 C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2 C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR) C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR) C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR) KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
# Misc files and generated files need to come from C1 or C2 area # Misc files and generated files need to come from C1 or C2 area
ifeq ($(ZERO_BUILD), true)
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
else
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
MISC_DIR=$(C1_DIR) MISC_DIR=$(C1_DIR)
GEN_DIR=$(C1_BASE_DIR)/generated GEN_DIR=$(C1_BASE_DIR)/generated
@ -222,6 +245,7 @@ else
MISC_DIR=$(C2_DIR) MISC_DIR=$(C2_DIR)
GEN_DIR=$(C2_BASE_DIR)/generated GEN_DIR=$(C2_BASE_DIR)/generated
endif endif
endif
# Bin files (windows) # Bin files (windows)
ifeq ($(OSNAME),windows) ifeq ($(OSNAME),windows)
@ -265,6 +289,12 @@ endif
# Shared Library # Shared Library
ifneq ($(OSNAME),windows) ifneq ($(OSNAME),windows)
ifeq ($(ZERO_BUILD), true)
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
$(install-file)
$(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
$(install-file)
else
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
$(install-file) $(install-file)
$(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so $(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
@ -275,6 +305,7 @@ $(EXPORT_SERVER_DIR)/%.so: $(C2_DIR)/%.so
$(install-file) $(install-file)
$(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so $(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so
$(install-file) $(install-file)
endif
endif endif
# Jar file (sa-jdi.jar) # Jar file (sa-jdi.jar)
@ -313,6 +344,7 @@ clean_build:
$(RM) -r $(C1_DIR) $(RM) -r $(C1_DIR)
$(RM) -r $(C2_DIR) $(RM) -r $(C2_DIR)
$(RM) -r $(KERNEL_DIR) $(RM) -r $(KERNEL_DIR)
$(RM) -r $(ZERO_DIR)
clean_export: clean_export:
$(RM) -r $(EXPORT_PATH) $(RM) -r $(EXPORT_PATH)
clean_jdk: clean_jdk:
@ -335,8 +367,10 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -) ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
test_jdk: test_jdk:
ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
$(JDK_IMAGE_DIR)/bin/java -client -version $(JDK_IMAGE_DIR)/bin/java -client -version
endif
endif endif
$(JDK_IMAGE_DIR)/bin/java -server -version $(JDK_IMAGE_DIR)/bin/java -server -version

View file

@ -192,13 +192,14 @@ ifneq ($(OSNAME),windows)
# Use uname output for SRCARCH, but deal with platform differences. If ARCH # Use uname output for SRCARCH, but deal with platform differences. If ARCH
# is not explicitly listed below, it is treated as x86. # is not explicitly listed below, it is treated as x86.
SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64,$(ARCH))) SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 zero,$(ARCH)))
ARCH/ = x86 ARCH/ = x86
ARCH/sparc = sparc ARCH/sparc = sparc
ARCH/sparc64= sparc ARCH/sparc64= sparc
ARCH/ia64 = ia64 ARCH/ia64 = ia64
ARCH/amd64 = x86 ARCH/amd64 = x86
ARCH/x86_64 = x86 ARCH/x86_64 = x86
ARCH/zero = zero
# BUILDARCH is usually the same as SRCARCH, except for sparcv9 # BUILDARCH is usually the same as SRCARCH, except for sparcv9
BUILDARCH = $(SRCARCH) BUILDARCH = $(SRCARCH)
@ -222,8 +223,9 @@ ifneq ($(OSNAME),windows)
LIBARCH/sparc = sparc LIBARCH/sparc = sparc
LIBARCH/sparcv9 = sparcv9 LIBARCH/sparcv9 = sparcv9
LIBARCH/ia64 = ia64 LIBARCH/ia64 = ia64
LIBARCH/zero = $(ZERO_LIBARCH)
LP64_ARCH = sparcv9 amd64 ia64 LP64_ARCH = sparcv9 amd64 ia64 zero
endif endif
# Required make macro settings for all platforms # Required make macro settings for all platforms

View file

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2009
HS_MAJOR_VER=17 HS_MAJOR_VER=17
HS_MINOR_VER=0 HS_MINOR_VER=0
HS_BUILD_NUMBER=03 HS_BUILD_NUMBER=05
JDK_MAJOR_VER=1 JDK_MAJOR_VER=1
JDK_MINOR_VER=7 JDK_MINOR_VER=7

View file

@ -29,17 +29,24 @@ ifdef JPRT_BUILD_VERSION
MILESTONE=$(JPRT_BUILD_VERSION) MILESTONE=$(JPRT_BUILD_VERSION)
endif endif
ifeq ($(OSNAME),windows)
ZIPFLAGS=-q
else
# store symbolic links as the link
ZIPFLAGS=-q -y
endif
jprt_build_product: all_product copy_product_jdk export_product_jdk jprt_build_product: all_product copy_product_jdk export_product_jdk
( $(CD) $(JDK_IMAGE_DIR) && \ ( $(CD) $(JDK_IMAGE_DIR) && \
$(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) $(ZIPEXE) $(ZIPFLAGS) -r $(JPRT_ARCHIVE_BUNDLE) . )
jprt_build_fastdebug: all_fastdebug copy_fastdebug_jdk export_fastdebug_jdk jprt_build_fastdebug: all_fastdebug copy_fastdebug_jdk export_fastdebug_jdk
( $(CD) $(JDK_IMAGE_DIR)/fastdebug && \ ( $(CD) $(JDK_IMAGE_DIR)/fastdebug && \
$(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) $(ZIPEXE) $(ZIPFLAGS) -r $(JPRT_ARCHIVE_BUNDLE) . )
jprt_build_debug: all_debug copy_debug_jdk export_debug_jdk jprt_build_debug: all_debug copy_debug_jdk export_debug_jdk
( $(CD) $(JDK_IMAGE_DIR)/debug && \ ( $(CD) $(JDK_IMAGE_DIR)/debug && \
$(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . ) $(ZIPEXE) $(ZIPFLAGS) -r $(JPRT_ARCHIVE_BUNDLE) . )
.PHONY: jprt_build_product jprt_build_fastdebug jprt_build_debug .PHONY: jprt_build_product jprt_build_fastdebug jprt_build_debug

View file

@ -132,6 +132,9 @@ ifeq ($(OSNAME),solaris)
endif endif
# BUILDARCH is set to "zero" for Zero builds. VARIANTARCH
# is used to give the build directories meaningful names.
VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# There is a (semi-) regular correspondence between make targets and actions: # There is a (semi-) regular correspondence between make targets and actions:
# #
@ -158,6 +161,13 @@ endif
# profiledcore core <os>_<arch>_core/profiled # profiledcore core <os>_<arch>_core/profiled
# productcore core <os>_<arch>_core/product # productcore core <os>_<arch>_core/product
# #
# debugzero zero <os>_<arch>_zero/debug
# fastdebugzero zero <os>_<arch>_zero/fastdebug
# jvmgzero zero <os>_<arch>_zero/jvmg
# optimizedzero zero <os>_<arch>_zero/optimized
# profiledzero zero <os>_<arch>_zero/profiled
# productzero zero <os>_<arch>_zero/product
#
# What you get with each target: # What you get with each target:
# #
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher # debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
@ -171,16 +181,22 @@ endif
# in the build.sh script: # in the build.sh script:
TARGETS = debug jvmg fastdebug optimized profiled product TARGETS = debug jvmg fastdebug optimized profiled product
SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs ifeq ($(ZERO_BUILD), true)
SUBDIR_DOCS = $(OSNAME)_$(VARIANTARCH)_docs
else
SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
endif
SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS)) SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS)) SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS)) SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS)) SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
TARGETS_C2 = $(TARGETS) TARGETS_C2 = $(TARGETS)
TARGETS_C1 = $(addsuffix 1,$(TARGETS)) TARGETS_C1 = $(addsuffix 1,$(TARGETS))
TARGETS_TIERED = $(addsuffix tiered,$(TARGETS)) TARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
TARGETS_CORE = $(addsuffix core,$(TARGETS)) TARGETS_CORE = $(addsuffix core,$(TARGETS))
TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
@ -196,6 +212,7 @@ all:
@echo " $(TARGETS_C2)" @echo " $(TARGETS_C2)"
@echo " $(TARGETS_C1)" @echo " $(TARGETS_C1)"
@echo " $(TARGETS_CORE)" @echo " $(TARGETS_CORE)"
@echo " $(TARGETS_ZERO)"
checks: check_os_version check_j2se_version checks: check_os_version check_j2se_version
@ -245,6 +262,13 @@ $(SUBDIRS_CORE): $(BUILDTREE_MAKE)
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=core $(BUILDTREE) VARIANT=core
$(SUBDIRS_ZERO): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=zero VARIANTARCH=$(VARIANTARCH)
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME # Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
$(TARGETS_C2): $(SUBDIRS_C2) $(TARGETS_C2): $(SUBDIRS_C2)
@ -275,10 +299,18 @@ ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif endif
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
# Just build the tree, and nothing else: # Just build the tree, and nothing else:
tree: $(SUBDIRS_C2) tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1) tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE) treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
# Doc target. This is the same for all build options. # Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...] # Hence create a docs directory beside ...$(ARCH)_[...]
@ -293,20 +325,22 @@ compiler1: jvmg1 product1
core: jvmgcore productcore core: jvmgcore productcore
zero: jvmgzero productzero
clean_docs: clean_docs:
rm -rf $(SUBDIR_DOCS) rm -rf $(SUBDIR_DOCS)
clean_compiler1 clean_compiler2 clean_core: clean_compiler1 clean_compiler2 clean_core clean_zero:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@) rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
clean: clean_compiler2 clean_compiler1 clean_core clean_docs clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_docs
include $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make include $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) .PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO)
.PHONY: tree tree1 treecore .PHONY: tree tree1 treecore treezero
.PHONY: all compiler1 compiler2 core .PHONY: all compiler1 compiler2 core zero
.PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs .PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero docs clean_docs
.PHONY: checks check_os_version check_j2se_version .PHONY: checks check_os_version check_j2se_version

View file

@ -63,20 +63,30 @@ QUIETLY$(MAKE_VERBOSE) = @
# For now, until the compiler is less wobbly: # For now, until the compiler is less wobbly:
TESTFLAGS = -Xbatch -showversion TESTFLAGS = -Xbatch -showversion
ifdef USE_SUNCC ifeq ($(ZERO_BUILD), true)
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
else else
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH) ifdef USE_SUNCC
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc
else
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
endif
endif
# Allow overriding of the arch part of the directory but default
# to BUILDARCH if nothing is specified
ifeq ($(VARIANTARCH),)
VARIANTARCH=$(BUILDARCH)
endif endif
ifdef FORCE_TIERED ifdef FORCE_TIERED
ifeq ($(VARIANT),tiered) ifeq ($(VARIANT),tiered)
PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_compiler2 PLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_compiler2
else else
PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT) PLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_$(VARIANT)
endif endif
else else
PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT) PLATFORM_DIR = $(OS_FAMILY)_$(VARIANTARCH)_$(VARIANT)
endif endif
# #
@ -321,6 +331,7 @@ DATA_MODE/sparc = 32
DATA_MODE/sparcv9 = 64 DATA_MODE/sparcv9 = 64
DATA_MODE/amd64 = 64 DATA_MODE/amd64 = 64
DATA_MODE/ia64 = 64 DATA_MODE/ia64 = 64
DATA_MODE/zero = $(ARCH_DATA_MODEL)
JAVA_FLAG/32 = -d32 JAVA_FLAG/32 = -d32
JAVA_FLAG/64 = -d64 JAVA_FLAG/64 = -d64

View file

@ -37,6 +37,17 @@ else
ARCH_DATA_MODEL ?= 32 ARCH_DATA_MODEL ?= 32
endif endif
# zero
ifeq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 64)
MAKE_ARGS += LP64=1
endif
PLATFORM = linux-zero
VM_PLATFORM = linux_$(subst i386,i486,$(ZERO_LIBARCH))
HS_ARCH = zero
ARCH = zero
endif
# ia64 # ia64
ifeq ($(ARCH), ia64) ifeq ($(ARCH), ia64)
ARCH_DATA_MODEL = 64 ARCH_DATA_MODEL = 64
@ -93,21 +104,25 @@ JDK_INCLUDE_SUBDIR=linux
VM_DEBUG=jvmg VM_DEBUG=jvmg
EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
ifeq ($(ARCH_DATA_MODEL), 32) ifneq ($(ZERO_BUILD), true)
ifeq ($(ARCH_DATA_MODEL), 32)
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
else else
ifeq ($(ARCH),ia64) ifeq ($(ARCH),ia64)
else else
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
endif endif
endif
endif endif

View file

@ -52,6 +52,9 @@ VM_PICFLAG/LIBJVM = $(PICFLAG)
VM_PICFLAG/AOUT = VM_PICFLAG/AOUT =
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
ifeq ($(ZERO_BUILD), true)
CFLAGS += $(LIBFFI_CFLAGS)
endif
CFLAGS += $(VM_PICFLAG) CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions CFLAGS += -fno-exceptions
@ -64,6 +67,7 @@ ARCHFLAG/amd64 = -m64
ARCHFLAG/ia64 = ARCHFLAG/ia64 =
ARCHFLAG/sparc = -m32 -mcpu=v9 ARCHFLAG/sparc = -m32 -mcpu=v9
ARCHFLAG/sparcv9 = -m64 -mcpu=v9 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
ARCHFLAG/zero = $(ZERO_ARCHFLAG)
CFLAGS += $(ARCHFLAG) CFLAGS += $(ARCHFLAG)
AOUT_FLAGS += $(ARCHFLAG) AOUT_FLAGS += $(ARCHFLAG)

View file

@ -52,10 +52,10 @@ SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VE
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA # if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium. # also, we don't build SA on Itanium or zero.
all: all:
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \ if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi fi

View file

@ -49,10 +49,10 @@ ifeq ($(DEBUG_BINARIES), true)
endif endif
# if $(AGENT_DIR) does not exist, we don't build SA # if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium. # also, we don't build SA on Itanium or zero.
checkAndBuildSA: checkAndBuildSA:
$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \ $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f vm.make $(LIBSAPROC); \ $(MAKE) -f vm.make $(LIBSAPROC); \
fi fi

View file

@ -74,6 +74,7 @@ Include_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \
Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2 Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2 Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
Include_DBs/ZERO = $(Include_DBs/CORE) $(VM)/includeDB_zero
Include_DBs = $(Include_DBs/$(TYPE)) Include_DBs = $(Include_DBs/$(TYPE))
Cached_plat = $(GENERATED)/platform.current Cached_plat = $(GENERATED)/platform.current

View file

@ -40,7 +40,11 @@ GENERATED = ../generated
include $(GENERATED)/Dependencies include $(GENERATED)/Dependencies
# read machine-specific adjustments (%%% should do this via buildtree.make?) # read machine-specific adjustments (%%% should do this via buildtree.make?)
include $(MAKEFILES_DIR)/$(BUILDARCH).make ifeq ($(ZERO_BUILD), true)
include $(MAKEFILES_DIR)/zeroshark.make
else
include $(MAKEFILES_DIR)/$(BUILDARCH).make
endif
# set VPATH so make knows where to look for source files # set VPATH so make knows where to look for source files
# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm # Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
@ -124,7 +128,11 @@ mapfile_reorder : mapfile $(REORDERFILE)
rm -f $@ rm -f $@
cat $^ > $@ cat $^ > $@
STATIC_CXX = true ifeq ($(ZERO_LIBARCH), ppc64)
STATIC_CXX = false
else
STATIC_CXX = true
endif
ifeq ($(LINK_INTO),AOUT) ifeq ($(LINK_INTO),AOUT)
LIBJVM.o = LIBJVM.o =
@ -148,6 +156,9 @@ else
LIBS_VM += $(LIBS) LIBS_VM += $(LIBS)
endif endif
ifeq ($(ZERO_BUILD), true)
LIBS_VM += $(LIBFFI_LIBS)
endif
LINK_VM = $(LINK_LIB.c) LINK_VM = $(LINK_LIB.c)

View file

@ -1,12 +1,11 @@
# #
# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. # Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2009 Red Hat, Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as # under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this # published by the Free Software Foundation.
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
# #
# This code is distributed in the hope that it will be useful, but WITHOUT # This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -22,5 +21,12 @@
# CA 95054 USA or visit www.sun.com if you need additional information or # CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions. # have any questions.
# #
#
ANONYMOUS_TYPE_CYCLE=Anonymous types form an infinite cycle: {0} # Setup for Zero (non-Shark) version of VM
# Select which includeDB files to use (in top.make)
TYPE = ZERO
# Install libjvm.so, etc in in server directory.
VM_SUBDIR = server

View file

@ -1,12 +1,11 @@
# #
# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2007, 2008 Red Hat, Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as # under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this # published by the Free Software Foundation.
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
# #
# This code is distributed in the hope that it will be useful, but WITHOUT # This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -22,21 +21,23 @@
# CA 95054 USA or visit www.sun.com if you need additional information or # CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions. # have any questions.
# #
#
ValidationEventCollector.UnrecognizedSeverity = \ # Setup common to Zero (non-Shark) and Shark versions of VM
Unrecognized event severity field "{0}"
JAXBResult.NullContext = \ # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
JAXBContext can not be null OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
JAXBResult.NullUnmarshaller = \ # Specify that the CPU is little endian, if necessary
Unmarshaller can not be null ifeq ($(ZERO_ENDIANNESS), little)
CFLAGS += -DVM_LITTLE_ENDIAN
endif
JAXBSource.NullContext = \ # Specify that the CPU is 64 bit, if necessary
JAXBContext can not be null ifeq ($(ARCH_DATA_MODEL), 64)
CFLAGS += -D_LP64=1
endif
JAXBSource.NullContent = \ OPT_CFLAGS/compactingPermGenGen.o = -O1
Content object can not be null
JAXBSource.NullMarshaller = \
Marshaller can not be null

View file

@ -0,0 +1,17 @@
os_family = linux
arch = zero
arch_model = zero
os_arch = linux_zero
os_arch_model = linux_zero
lib_arch = zero
compiler = gcc
gnu_dis_arch = zero
sysdefs = -DLINUX -D_GNU_SOURCE -DCC_INTERP -DZERO -D@ZERO_ARCHDEF@ -DZERO_LIBARCH=\"@ZERO_LIBARCH@\"

View file

@ -65,16 +65,18 @@ JDK_INCLUDE_SUBDIR=solaris
VM_DEBUG=jvmg VM_DEBUG=jvmg
EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.so EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.so
EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.so EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.so
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.so EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.so
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so

View file

@ -2631,13 +2631,13 @@ void MacroAssembler::regcon_inc_ptr( RegisterOrConstant& dest, RegisterOrConstan
(src.is_register() && src.as_register() == G0)) { (src.is_register() && src.as_register() == G0)) {
// do nothing // do nothing
} else if (dest.is_register()) { } else if (dest.is_register()) {
add(dest.as_register(), ensure_rs2(src, temp), dest.as_register()); add(dest.as_register(), ensure_simm13_or_reg(src, temp), dest.as_register());
} else if (src.is_constant()) { } else if (src.is_constant()) {
intptr_t res = dest.as_constant() + src.as_constant(); intptr_t res = dest.as_constant() + src.as_constant();
dest = RegisterOrConstant(res); // side effect seen by caller dest = RegisterOrConstant(res); // side effect seen by caller
} else { } else {
assert(temp != noreg, "cannot handle constant += register"); assert(temp != noreg, "cannot handle constant += register");
add(src.as_register(), ensure_rs2(dest, temp), temp); add(src.as_register(), ensure_simm13_or_reg(dest, temp), temp);
dest = RegisterOrConstant(temp); // side effect seen by caller dest = RegisterOrConstant(temp); // side effect seen by caller
} }
} }
@ -2710,7 +2710,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
RegisterOrConstant itable_offset = itable_index; RegisterOrConstant itable_offset = itable_index;
regcon_sll_ptr(itable_offset, exact_log2(itableMethodEntry::size() * wordSize)); regcon_sll_ptr(itable_offset, exact_log2(itableMethodEntry::size() * wordSize));
regcon_inc_ptr(itable_offset, itableMethodEntry::method_offset_in_bytes()); regcon_inc_ptr(itable_offset, itableMethodEntry::method_offset_in_bytes());
add(recv_klass, ensure_rs2(itable_offset, sethi_temp), recv_klass); add(recv_klass, ensure_simm13_or_reg(itable_offset, sethi_temp), recv_klass);
// for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) { // for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) {
// if (scan->interface() == intf) { // if (scan->interface() == intf) {

View file

@ -1279,6 +1279,7 @@ public:
// 171 // 171
inline void ldf(FloatRegisterImpl::Width w, Register s1, RegisterOrConstant s2, FloatRegister d);
inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d); inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d);
inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder()); inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder());
@ -1535,7 +1536,8 @@ public:
// pp 222 // pp 222
inline void stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2 ); inline void stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, RegisterOrConstant s2);
inline void stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2);
inline void stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a); inline void stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a);
inline void stf( FloatRegisterImpl::Width w, FloatRegister d, const Address& a, int offset = 0); inline void stf( FloatRegisterImpl::Width w, FloatRegister d, const Address& a, int offset = 0);
@ -2049,12 +2051,13 @@ public:
Register temp = noreg ); Register temp = noreg );
void regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src, void regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src,
Register temp = noreg ); Register temp = noreg );
RegisterOrConstant ensure_rs2(RegisterOrConstant rs2, Register sethi_temp) {
guarantee(sethi_temp != noreg, "constant offset overflow"); RegisterOrConstant ensure_simm13_or_reg(RegisterOrConstant roc, Register Rtemp) {
if (is_simm13(rs2.constant_or_zero())) guarantee(Rtemp != noreg, "constant offset overflow");
return rs2; // register or short constant if (is_simm13(roc.constant_or_zero()))
set(rs2.as_constant(), sethi_temp); return roc; // register or short constant
return sethi_temp; set(roc.as_constant(), Rtemp);
return RegisterOrConstant(Rtemp);
} }
// -------------------------------------------------- // --------------------------------------------------

View file

@ -99,6 +99,11 @@ inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op
inline void Assembler::jmpl( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); } inline void Assembler::jmpl( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); }
inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); } inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); }
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, RegisterOrConstant s2, FloatRegister d) {
if (s2.is_register()) ldf(w, s1, s2.as_register(), d);
else ldf(w, s1, s2.as_constant(), d);
}
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); } inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); }
@ -224,6 +229,11 @@ inline void Assembler::sethi( int imm22a, Register d, RelocationHolder const& rs
// pp 222 // pp 222
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, RegisterOrConstant s2) {
if (s2.is_register()) stf(w, d, s1, s2.as_register());
else stf(w, d, s1, s2.as_constant());
}
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); } inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); }
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13)); } inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
@ -284,6 +294,7 @@ inline void Assembler::stx(Register d, const Address& a, int offset) {
inline void Assembler::stb(Register d, Register s1, RegisterOrConstant s2) { stb(d, Address(s1, s2)); } inline void Assembler::stb(Register d, Register s1, RegisterOrConstant s2) { stb(d, Address(s1, s2)); }
inline void Assembler::sth(Register d, Register s1, RegisterOrConstant s2) { sth(d, Address(s1, s2)); } inline void Assembler::sth(Register d, Register s1, RegisterOrConstant s2) { sth(d, Address(s1, s2)); }
inline void Assembler::stw(Register d, Register s1, RegisterOrConstant s2) { stw(d, Address(s1, s2)); }
inline void Assembler::stx(Register d, Register s1, RegisterOrConstant s2) { stx(d, Address(s1, s2)); } inline void Assembler::stx(Register d, Register s1, RegisterOrConstant s2) { stx(d, Address(s1, s2)); }
inline void Assembler::std(Register d, Register s1, RegisterOrConstant s2) { std(d, Address(s1, s2)); } inline void Assembler::std(Register d, Register s1, RegisterOrConstant s2) { std(d, Address(s1, s2)); }
inline void Assembler::st( Register d, Register s1, RegisterOrConstant s2) { st( d, Address(s1, s2)); } inline void Assembler::st( Register d, Register s1, RegisterOrConstant s2) { st( d, Address(s1, s2)); }

View file

@ -107,7 +107,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
// are saved in register windows - I's and L's in the caller's frame and O's in the stub frame // are saved in register windows - I's and L's in the caller's frame and O's in the stub frame
// (as the stub's I's) when the runtime routine called by the stub creates its frame. // (as the stub's I's) when the runtime routine called by the stub creates its frame.
int i; int i;
// Always make the frame size 16 bytr aligned. // Always make the frame size 16 byte aligned.
int frame_size = round_to(additional_frame_words + register_save_size, 16); int frame_size = round_to(additional_frame_words + register_save_size, 16);
// OopMap frame size is in c2 stack slots (sizeof(jint)) not bytes or words // OopMap frame size is in c2 stack slots (sizeof(jint)) not bytes or words
int frame_size_in_slots = frame_size / sizeof(jint); int frame_size_in_slots = frame_size / sizeof(jint);
@ -201,15 +201,14 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
__ stx(G5, SP, ccr_offset+STACK_BIAS); __ stx(G5, SP, ccr_offset+STACK_BIAS);
__ stxfsr(SP, fsr_offset+STACK_BIAS); __ stxfsr(SP, fsr_offset+STACK_BIAS);
// Save all the FP registers // Save all the FP registers: 32 doubles (32 floats correspond to the 2 halves of the first 16 doubles)
int offset = d00_offset; int offset = d00_offset;
for( int i=0; i<64; i+=2 ) { for( int i=0; i<FloatRegisterImpl::number_of_registers; i+=2 ) {
FloatRegister f = as_FloatRegister(i); FloatRegister f = as_FloatRegister(i);
__ stf(FloatRegisterImpl::D, f, SP, offset+STACK_BIAS); __ stf(FloatRegisterImpl::D, f, SP, offset+STACK_BIAS);
// Record as callee saved both halves of double registers (2 float registers).
map->set_callee_saved(VMRegImpl::stack2reg(offset>>2), f->as_VMReg()); map->set_callee_saved(VMRegImpl::stack2reg(offset>>2), f->as_VMReg());
if (true) {
map->set_callee_saved(VMRegImpl::stack2reg((offset + sizeof(float))>>2), f->as_VMReg()->next()); map->set_callee_saved(VMRegImpl::stack2reg((offset + sizeof(float))>>2), f->as_VMReg()->next());
}
offset += sizeof(double); offset += sizeof(double);
} }
@ -224,7 +223,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
void RegisterSaver::restore_live_registers(MacroAssembler* masm) { void RegisterSaver::restore_live_registers(MacroAssembler* masm) {
// Restore all the FP registers // Restore all the FP registers
for( int i=0; i<64; i+=2 ) { for( int i=0; i<FloatRegisterImpl::number_of_registers; i+=2 ) {
__ ldf(FloatRegisterImpl::D, SP, d00_offset+i*sizeof(float)+STACK_BIAS, as_FloatRegister(i)); __ ldf(FloatRegisterImpl::D, SP, d00_offset+i*sizeof(float)+STACK_BIAS, as_FloatRegister(i));
} }
@ -540,14 +539,12 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
} }
// Helper class mostly to avoid passing masm everywhere, and handle store // Helper class mostly to avoid passing masm everywhere, and handle
// displacement overflow logic for LP64 // store displacement overflow logic.
class AdapterGenerator { class AdapterGenerator {
MacroAssembler *masm; MacroAssembler *masm;
#ifdef _LP64
Register Rdisp; Register Rdisp;
void set_Rdisp(Register r) { Rdisp = r; } void set_Rdisp(Register r) { Rdisp = r; }
#endif // _LP64
void patch_callers_callsite(); void patch_callers_callsite();
void tag_c2i_arg(frame::Tag t, Register base, int st_off, Register scratch); void tag_c2i_arg(frame::Tag t, Register base, int st_off, Register scratch);
@ -558,15 +555,18 @@ class AdapterGenerator {
return st_off - Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes(); return st_off - Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes();
} }
#ifdef _LP64 int tag_offset(const int st_off) { return st_off + Interpreter::tag_offset_in_bytes(); }
// On _LP64 argument slot values are loaded first into a register int next_tag_offset(const int st_off) {
// because they might not fit into displacement. return st_off - Interpreter::stackElementSize() + Interpreter::tag_offset_in_bytes();
Register arg_slot(const int st_off); }
Register next_arg_slot(const int st_off);
#else // Argument slot values may be loaded first into a register because
int arg_slot(const int st_off) { return arg_offset(st_off); } // they might not fit into displacement.
int next_arg_slot(const int st_off) { return next_arg_offset(st_off); } RegisterOrConstant arg_slot(const int st_off);
#endif // _LP64 RegisterOrConstant next_arg_slot(const int st_off);
RegisterOrConstant tag_slot(const int st_off);
RegisterOrConstant next_tag_slot(const int st_off);
// Stores long into offset pointed to by base // Stores long into offset pointed to by base
void store_c2i_long(Register r, Register base, void store_c2i_long(Register r, Register base,
@ -656,44 +656,42 @@ void AdapterGenerator::patch_callers_callsite() {
void AdapterGenerator::tag_c2i_arg(frame::Tag t, Register base, int st_off, void AdapterGenerator::tag_c2i_arg(frame::Tag t, Register base, int st_off,
Register scratch) { Register scratch) {
if (TaggedStackInterpreter) { if (TaggedStackInterpreter) {
int tag_off = st_off + Interpreter::tag_offset_in_bytes(); RegisterOrConstant slot = tag_slot(st_off);
#ifdef _LP64
Register tag_slot = Rdisp;
__ set(tag_off, tag_slot);
#else
int tag_slot = tag_off;
#endif // _LP64
// have to store zero because local slots can be reused (rats!) // have to store zero because local slots can be reused (rats!)
if (t == frame::TagValue) { if (t == frame::TagValue) {
__ st_ptr(G0, base, tag_slot); __ st_ptr(G0, base, slot);
} else if (t == frame::TagCategory2) { } else if (t == frame::TagCategory2) {
__ st_ptr(G0, base, tag_slot); __ st_ptr(G0, base, slot);
int next_tag_off = st_off - Interpreter::stackElementSize() + __ st_ptr(G0, base, next_tag_slot(st_off));
Interpreter::tag_offset_in_bytes();
#ifdef _LP64
__ set(next_tag_off, tag_slot);
#else
tag_slot = next_tag_off;
#endif // _LP64
__ st_ptr(G0, base, tag_slot);
} else { } else {
__ mov(t, scratch); __ mov(t, scratch);
__ st_ptr(scratch, base, tag_slot); __ st_ptr(scratch, base, slot);
} }
} }
} }
#ifdef _LP64
Register AdapterGenerator::arg_slot(const int st_off) { RegisterOrConstant AdapterGenerator::arg_slot(const int st_off) {
__ set( arg_offset(st_off), Rdisp); RegisterOrConstant roc(arg_offset(st_off));
return Rdisp; return __ ensure_simm13_or_reg(roc, Rdisp);
} }
Register AdapterGenerator::next_arg_slot(const int st_off){ RegisterOrConstant AdapterGenerator::next_arg_slot(const int st_off) {
__ set( next_arg_offset(st_off), Rdisp); RegisterOrConstant roc(next_arg_offset(st_off));
return Rdisp; return __ ensure_simm13_or_reg(roc, Rdisp);
} }
#endif // _LP64
RegisterOrConstant AdapterGenerator::tag_slot(const int st_off) {
RegisterOrConstant roc(tag_offset(st_off));
return __ ensure_simm13_or_reg(roc, Rdisp);
}
RegisterOrConstant AdapterGenerator::next_tag_slot(const int st_off) {
RegisterOrConstant roc(next_tag_offset(st_off));
return __ ensure_simm13_or_reg(roc, Rdisp);
}
// Stores long into offset pointed to by base // Stores long into offset pointed to by base
void AdapterGenerator::store_c2i_long(Register r, Register base, void AdapterGenerator::store_c2i_long(Register r, Register base,
@ -1052,9 +1050,7 @@ void AdapterGenerator::gen_i2c_adapter(
// Load in argument order going down. // Load in argument order going down.
const int ld_off = (total_args_passed-i)*Interpreter::stackElementSize(); const int ld_off = (total_args_passed-i)*Interpreter::stackElementSize();
#ifdef _LP64
set_Rdisp(G1_scratch); set_Rdisp(G1_scratch);
#endif // _LP64
VMReg r_1 = regs[i].first(); VMReg r_1 = regs[i].first();
VMReg r_2 = regs[i].second(); VMReg r_2 = regs[i].second();
@ -1074,7 +1070,7 @@ void AdapterGenerator::gen_i2c_adapter(
#ifdef _LP64 #ifdef _LP64
// In V9, longs are given 2 64-bit slots in the interpreter, but the // In V9, longs are given 2 64-bit slots in the interpreter, but the
// data is passed in only 1 slot. // data is passed in only 1 slot.
Register slot = (sig_bt[i]==T_LONG) ? RegisterOrConstant slot = (sig_bt[i] == T_LONG) ?
next_arg_slot(ld_off) : arg_slot(ld_off); next_arg_slot(ld_off) : arg_slot(ld_off);
__ ldx(Gargs, slot, r); __ ldx(Gargs, slot, r);
#else #else
@ -1092,7 +1088,7 @@ void AdapterGenerator::gen_i2c_adapter(
// data is passed in only 1 slot. This code also handles longs that // data is passed in only 1 slot. This code also handles longs that
// are passed on the stack, but need a stack-to-stack move through a // are passed on the stack, but need a stack-to-stack move through a
// spare float register. // spare float register.
Register slot = (sig_bt[i]==T_LONG || sig_bt[i] == T_DOUBLE) ? RegisterOrConstant slot = (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) ?
next_arg_slot(ld_off) : arg_slot(ld_off); next_arg_slot(ld_off) : arg_slot(ld_off);
__ ldf(FloatRegisterImpl::D, Gargs, slot, r_1->as_FloatRegister()); __ ldf(FloatRegisterImpl::D, Gargs, slot, r_1->as_FloatRegister());
#else #else
@ -1109,8 +1105,9 @@ void AdapterGenerator::gen_i2c_adapter(
// Convert stack slot to an SP offset // Convert stack slot to an SP offset
int st_off = reg2offset(regs[i].first()) + STACK_BIAS; int st_off = reg2offset(regs[i].first()) + STACK_BIAS;
// Store down the shuffled stack word. Target address _is_ aligned. // Store down the shuffled stack word. Target address _is_ aligned.
if (!r_2->is_valid()) __ stf(FloatRegisterImpl::S, r_1->as_FloatRegister(), SP, st_off); RegisterOrConstant slot = __ ensure_simm13_or_reg(st_off, Rdisp);
else __ stf(FloatRegisterImpl::D, r_1->as_FloatRegister(), SP, st_off); if (!r_2->is_valid()) __ stf(FloatRegisterImpl::S, r_1->as_FloatRegister(), SP, slot);
else __ stf(FloatRegisterImpl::D, r_1->as_FloatRegister(), SP, slot);
} }
} }
bool made_space = false; bool made_space = false;
@ -3216,9 +3213,8 @@ void SharedRuntime::generate_deopt_blob() {
Register Oreturn0 = O0; Register Oreturn0 = O0;
Register Oreturn1 = O1; Register Oreturn1 = O1;
Register O2UnrollBlock = O2; Register O2UnrollBlock = O2;
Register O3tmp = O3; Register L0deopt_mode = L0;
Register I5exception_tmp = I5; Register G4deopt_mode = G4_scratch;
Register G4exception_tmp = G4_scratch;
int frame_size_words; int frame_size_words;
Address saved_Freturn0_addr(FP, -sizeof(double) + STACK_BIAS); Address saved_Freturn0_addr(FP, -sizeof(double) + STACK_BIAS);
#if !defined(_LP64) && defined(COMPILER2) #if !defined(_LP64) && defined(COMPILER2)
@ -3268,7 +3264,7 @@ void SharedRuntime::generate_deopt_blob() {
map = RegisterSaver::save_live_registers(masm, 0, &frame_size_words); map = RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
__ ba(false, cont); __ ba(false, cont);
__ delayed()->mov(Deoptimization::Unpack_deopt, I5exception_tmp); __ delayed()->mov(Deoptimization::Unpack_deopt, L0deopt_mode);
int exception_offset = __ offset() - start; int exception_offset = __ offset() - start;
@ -3319,7 +3315,7 @@ void SharedRuntime::generate_deopt_blob() {
#endif #endif
__ ba(false, cont); __ ba(false, cont);
__ delayed()->mov(Deoptimization::Unpack_exception, I5exception_tmp);; __ delayed()->mov(Deoptimization::Unpack_exception, L0deopt_mode);;
// //
// Reexecute entry, similar to c2 uncommon trap // Reexecute entry, similar to c2 uncommon trap
@ -3329,7 +3325,7 @@ void SharedRuntime::generate_deopt_blob() {
// No need to update oop_map as each call to save_live_registers will produce identical oopmap // No need to update oop_map as each call to save_live_registers will produce identical oopmap
(void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words); (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
__ mov(Deoptimization::Unpack_reexecute, I5exception_tmp); __ mov(Deoptimization::Unpack_reexecute, L0deopt_mode);
__ bind(cont); __ bind(cont);
@ -3352,14 +3348,14 @@ void SharedRuntime::generate_deopt_blob() {
// NOTE: we know that only O0/O1 will be reloaded by restore_result_registers // NOTE: we know that only O0/O1 will be reloaded by restore_result_registers
// so this move will survive // so this move will survive
__ mov(I5exception_tmp, G4exception_tmp); __ mov(L0deopt_mode, G4deopt_mode);
__ mov(O0, O2UnrollBlock->after_save()); __ mov(O0, O2UnrollBlock->after_save());
RegisterSaver::restore_result_registers(masm); RegisterSaver::restore_result_registers(masm);
Label noException; Label noException;
__ cmp(G4exception_tmp, Deoptimization::Unpack_exception); // Was exception pending? __ cmp(G4deopt_mode, Deoptimization::Unpack_exception); // Was exception pending?
__ br(Assembler::notEqual, false, Assembler::pt, noException); __ br(Assembler::notEqual, false, Assembler::pt, noException);
__ delayed()->nop(); __ delayed()->nop();
@ -3393,10 +3389,10 @@ void SharedRuntime::generate_deopt_blob() {
} }
#endif #endif
__ set_last_Java_frame(SP, noreg); __ set_last_Java_frame(SP, noreg);
__ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, G4exception_tmp); __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, G4deopt_mode);
#else #else
// LP64 uses g4 in set_last_Java_frame // LP64 uses g4 in set_last_Java_frame
__ mov(G4exception_tmp, O1); __ mov(G4deopt_mode, O1);
__ set_last_Java_frame(SP, G0); __ set_last_Java_frame(SP, G0);
__ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, O1); __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, O1);
#endif #endif
@ -3449,7 +3445,6 @@ void SharedRuntime::generate_uncommon_trap_blob() {
#endif #endif
MacroAssembler* masm = new MacroAssembler(&buffer); MacroAssembler* masm = new MacroAssembler(&buffer);
Register O2UnrollBlock = O2; Register O2UnrollBlock = O2;
Register O3tmp = O3;
Register O2klass_index = O2; Register O2klass_index = O2;
// //

View file

@ -193,38 +193,38 @@ reg_def R_F31( SOC, SOC, Op_RegF, 31, F31->as_VMReg());
// I believe we can't handle callee-save doubles D32 and up until // I believe we can't handle callee-save doubles D32 and up until
// the place in the sparc stack crawler that asserts on the 255 is // the place in the sparc stack crawler that asserts on the 255 is
// fixed up. // fixed up.
reg_def R_D32x(SOC, SOC, Op_RegD,255, F32->as_VMReg()); reg_def R_D32 (SOC, SOC, Op_RegD, 1, F32->as_VMReg());
reg_def R_D32 (SOC, SOC, Op_RegD, 1, F32->as_VMReg()->next()); reg_def R_D32x(SOC, SOC, Op_RegD,255, F32->as_VMReg()->next());
reg_def R_D34x(SOC, SOC, Op_RegD,255, F34->as_VMReg()); reg_def R_D34 (SOC, SOC, Op_RegD, 3, F34->as_VMReg());
reg_def R_D34 (SOC, SOC, Op_RegD, 3, F34->as_VMReg()->next()); reg_def R_D34x(SOC, SOC, Op_RegD,255, F34->as_VMReg()->next());
reg_def R_D36x(SOC, SOC, Op_RegD,255, F36->as_VMReg()); reg_def R_D36 (SOC, SOC, Op_RegD, 5, F36->as_VMReg());
reg_def R_D36 (SOC, SOC, Op_RegD, 5, F36->as_VMReg()->next()); reg_def R_D36x(SOC, SOC, Op_RegD,255, F36->as_VMReg()->next());
reg_def R_D38x(SOC, SOC, Op_RegD,255, F38->as_VMReg()); reg_def R_D38 (SOC, SOC, Op_RegD, 7, F38->as_VMReg());
reg_def R_D38 (SOC, SOC, Op_RegD, 7, F38->as_VMReg()->next()); reg_def R_D38x(SOC, SOC, Op_RegD,255, F38->as_VMReg()->next());
reg_def R_D40x(SOC, SOC, Op_RegD,255, F40->as_VMReg()); reg_def R_D40 (SOC, SOC, Op_RegD, 9, F40->as_VMReg());
reg_def R_D40 (SOC, SOC, Op_RegD, 9, F40->as_VMReg()->next()); reg_def R_D40x(SOC, SOC, Op_RegD,255, F40->as_VMReg()->next());
reg_def R_D42x(SOC, SOC, Op_RegD,255, F42->as_VMReg()); reg_def R_D42 (SOC, SOC, Op_RegD, 11, F42->as_VMReg());
reg_def R_D42 (SOC, SOC, Op_RegD, 11, F42->as_VMReg()->next()); reg_def R_D42x(SOC, SOC, Op_RegD,255, F42->as_VMReg()->next());
reg_def R_D44x(SOC, SOC, Op_RegD,255, F44->as_VMReg()); reg_def R_D44 (SOC, SOC, Op_RegD, 13, F44->as_VMReg());
reg_def R_D44 (SOC, SOC, Op_RegD, 13, F44->as_VMReg()->next()); reg_def R_D44x(SOC, SOC, Op_RegD,255, F44->as_VMReg()->next());
reg_def R_D46x(SOC, SOC, Op_RegD,255, F46->as_VMReg()); reg_def R_D46 (SOC, SOC, Op_RegD, 15, F46->as_VMReg());
reg_def R_D46 (SOC, SOC, Op_RegD, 15, F46->as_VMReg()->next()); reg_def R_D46x(SOC, SOC, Op_RegD,255, F46->as_VMReg()->next());
reg_def R_D48x(SOC, SOC, Op_RegD,255, F48->as_VMReg()); reg_def R_D48 (SOC, SOC, Op_RegD, 17, F48->as_VMReg());
reg_def R_D48 (SOC, SOC, Op_RegD, 17, F48->as_VMReg()->next()); reg_def R_D48x(SOC, SOC, Op_RegD,255, F48->as_VMReg()->next());
reg_def R_D50x(SOC, SOC, Op_RegD,255, F50->as_VMReg()); reg_def R_D50 (SOC, SOC, Op_RegD, 19, F50->as_VMReg());
reg_def R_D50 (SOC, SOC, Op_RegD, 19, F50->as_VMReg()->next()); reg_def R_D50x(SOC, SOC, Op_RegD,255, F50->as_VMReg()->next());
reg_def R_D52x(SOC, SOC, Op_RegD,255, F52->as_VMReg()); reg_def R_D52 (SOC, SOC, Op_RegD, 21, F52->as_VMReg());
reg_def R_D52 (SOC, SOC, Op_RegD, 21, F52->as_VMReg()->next()); reg_def R_D52x(SOC, SOC, Op_RegD,255, F52->as_VMReg()->next());
reg_def R_D54x(SOC, SOC, Op_RegD,255, F54->as_VMReg()); reg_def R_D54 (SOC, SOC, Op_RegD, 23, F54->as_VMReg());
reg_def R_D54 (SOC, SOC, Op_RegD, 23, F54->as_VMReg()->next()); reg_def R_D54x(SOC, SOC, Op_RegD,255, F54->as_VMReg()->next());
reg_def R_D56x(SOC, SOC, Op_RegD,255, F56->as_VMReg()); reg_def R_D56 (SOC, SOC, Op_RegD, 25, F56->as_VMReg());
reg_def R_D56 (SOC, SOC, Op_RegD, 25, F56->as_VMReg()->next()); reg_def R_D56x(SOC, SOC, Op_RegD,255, F56->as_VMReg()->next());
reg_def R_D58x(SOC, SOC, Op_RegD,255, F58->as_VMReg()); reg_def R_D58 (SOC, SOC, Op_RegD, 27, F58->as_VMReg());
reg_def R_D58 (SOC, SOC, Op_RegD, 27, F58->as_VMReg()->next()); reg_def R_D58x(SOC, SOC, Op_RegD,255, F58->as_VMReg()->next());
reg_def R_D60x(SOC, SOC, Op_RegD,255, F60->as_VMReg()); reg_def R_D60 (SOC, SOC, Op_RegD, 29, F60->as_VMReg());
reg_def R_D60 (SOC, SOC, Op_RegD, 29, F60->as_VMReg()->next()); reg_def R_D60x(SOC, SOC, Op_RegD,255, F60->as_VMReg()->next());
reg_def R_D62x(SOC, SOC, Op_RegD,255, F62->as_VMReg()); reg_def R_D62 (SOC, SOC, Op_RegD, 31, F62->as_VMReg());
reg_def R_D62 (SOC, SOC, Op_RegD, 31, F62->as_VMReg()->next()); reg_def R_D62x(SOC, SOC, Op_RegD,255, F62->as_VMReg()->next());
// ---------------------------- // ----------------------------
@ -3016,7 +3016,7 @@ enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, notemp_iRegI r
// return true if the same array // return true if the same array
__ cmp(ary1_reg, ary2_reg); __ cmp(ary1_reg, ary2_reg);
__ br(Assembler::equal, true, Assembler::pn, Ldone); __ brx(Assembler::equal, true, Assembler::pn, Ldone);
__ delayed()->add(G0, 1, result_reg); // equal __ delayed()->add(G0, 1, result_reg); // equal
__ br_null(ary1_reg, true, Assembler::pn, Ldone); __ br_null(ary1_reg, true, Assembler::pn, Ldone);
@ -9419,8 +9419,9 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{
// x |= (x >> 8); // x |= (x >> 8);
// x |= (x >> 16); // x |= (x >> 16);
// return (WORDBITS - popc(x)); // return (WORDBITS - popc(x));
format %{ "SRL $src,1,$dst\t! count leading zeros (int)\n\t" format %{ "SRL $src,1,$tmp\t! count leading zeros (int)\n\t"
"OR $src,$tmp,$dst\n\t" "SRL $src,0,$dst\t! 32-bit zero extend\n\t"
"OR $dst,$tmp,$dst\n\t"
"SRL $dst,2,$tmp\n\t" "SRL $dst,2,$tmp\n\t"
"OR $dst,$tmp,$dst\n\t" "OR $dst,$tmp,$dst\n\t"
"SRL $dst,4,$tmp\n\t" "SRL $dst,4,$tmp\n\t"
@ -9437,7 +9438,8 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{
Register Rsrc = $src$$Register; Register Rsrc = $src$$Register;
Register Rtmp = $tmp$$Register; Register Rtmp = $tmp$$Register;
__ srl(Rsrc, 1, Rtmp); __ srl(Rsrc, 1, Rtmp);
__ or3(Rsrc, Rtmp, Rdst); __ srl(Rsrc, 0, Rdst);
__ or3(Rdst, Rtmp, Rdst);
__ srl(Rdst, 2, Rtmp); __ srl(Rdst, 2, Rtmp);
__ or3(Rdst, Rtmp, Rdst); __ or3(Rdst, Rtmp, Rdst);
__ srl(Rdst, 4, Rtmp); __ srl(Rdst, 4, Rtmp);
@ -9465,7 +9467,7 @@ instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{
// x |= (x >> 16); // x |= (x >> 16);
// x |= (x >> 32); // x |= (x >> 32);
// return (WORDBITS - popc(x)); // return (WORDBITS - popc(x));
format %{ "SRLX $src,1,$dst\t! count leading zeros (long)\n\t" format %{ "SRLX $src,1,$tmp\t! count leading zeros (long)\n\t"
"OR $src,$tmp,$dst\n\t" "OR $src,$tmp,$dst\n\t"
"SRLX $dst,2,$tmp\n\t" "SRLX $dst,2,$tmp\n\t"
"OR $dst,$tmp,$dst\n\t" "OR $dst,$tmp,$dst\n\t"

View file

@ -8214,6 +8214,15 @@ void MacroAssembler::store_heap_oop(Address dst, Register src) {
} }
} }
// Used for storing NULLs.
void MacroAssembler::store_heap_oop_null(Address dst) {
if (UseCompressedOops) {
movl(dst, (int32_t)NULL_WORD);
} else {
movslq(dst, (int32_t)NULL_WORD);
}
}
// Algorithm must match oop.inline.hpp encode_heap_oop. // Algorithm must match oop.inline.hpp encode_heap_oop.
void MacroAssembler::encode_heap_oop(Register r) { void MacroAssembler::encode_heap_oop(Register r) {
assert (UseCompressedOops, "should be compressed"); assert (UseCompressedOops, "should be compressed");
@ -8634,8 +8643,10 @@ void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Regist
if (is_array_equ) { if (is_array_equ) {
// Need additional checks for arrays_equals. // Need additional checks for arrays_equals.
andptr(ary1, ary2); testptr(ary1, ary1);
jcc(Assembler::zero, FALSE_LABEL); // One pointer is NULL jcc(Assembler::zero, FALSE_LABEL);
testptr(ary2, ary2);
jcc(Assembler::zero, FALSE_LABEL);
// Check the lengths // Check the lengths
movl(limit, Address(ary1, length_offset)); movl(limit, Address(ary1, length_offset));

View file

@ -1682,6 +1682,17 @@ class MacroAssembler: public Assembler {
void load_heap_oop(Register dst, Address src); void load_heap_oop(Register dst, Address src);
void store_heap_oop(Address dst, Register src); void store_heap_oop(Address dst, Register src);
// This dummy is to prevent a call to store_heap_oop from
// converting a zero (like NULL) into a Register by giving
// the compiler two choices it can't resolve
void store_heap_oop(Address dst, void* dummy);
// Used for storing NULL. All other oop constants should be
// stored using routines that take a jobject.
void store_heap_oop_null(Address dst);
void encode_heap_oop(Register r); void encode_heap_oop(Register r);
void decode_heap_oop(Register r); void decode_heap_oop(Register r);
void encode_heap_oop_not_null(Register r); void encode_heap_oop_not_null(Register r);

View file

@ -271,9 +271,15 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm,
void trace_method_handle_stub(const char* adaptername, void trace_method_handle_stub(const char* adaptername,
oopDesc* mh, oopDesc* mh,
intptr_t* entry_sp, intptr_t* entry_sp,
intptr_t* saved_sp) { intptr_t* saved_sp,
intptr_t* saved_bp) {
// called as a leaf from native code: do not block the JVM! // called as a leaf from native code: do not block the JVM!
printf("MH %s "PTR_FORMAT" "PTR_FORMAT" "INTX_FORMAT"\n", adaptername, (void*)mh, entry_sp, entry_sp - saved_sp); intptr_t* last_sp = (intptr_t*) saved_bp[frame::interpreter_frame_last_sp_offset];
intptr_t* base_sp = (intptr_t*) saved_bp[frame::interpreter_frame_monitor_block_top_offset];
printf("MH %s mh="INTPTR_FORMAT" sp=("INTPTR_FORMAT"+"INTX_FORMAT") stack_size="INTX_FORMAT" bp="INTPTR_FORMAT"\n",
adaptername, (intptr_t)mh, (intptr_t)entry_sp, (intptr_t)(saved_sp - entry_sp), (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp);
if (last_sp != saved_sp)
printf("*** last_sp="INTPTR_FORMAT"\n", (intptr_t)last_sp);
} }
#endif //PRODUCT #endif //PRODUCT
@ -293,6 +299,10 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
Register rbx_temp = rbx; Register rbx_temp = rbx;
Register rdx_temp = rdx; Register rdx_temp = rdx;
// This guy is set up by prepare_to_jump_from_interpreted (from interpreted calls)
// and gen_c2i_adapter (from compiled calls):
Register saved_last_sp = LP64_ONLY(r13) NOT_LP64(rsi);
guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets"); guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
// some handy addresses // some handy addresses
@ -315,6 +325,8 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
assert(tag_offset = wordSize, "stack grows as expected"); assert(tag_offset = wordSize, "stack grows as expected");
} }
const int java_mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
if (have_entry(ek)) { if (have_entry(ek)) {
__ nop(); // empty stubs make SG sick __ nop(); // empty stubs make SG sick
return; return;
@ -328,45 +340,65 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ push(rax); __ push(rbx); __ push(rcx); __ push(rdx); __ push(rsi); __ push(rdi); __ push(rax); __ push(rbx); __ push(rcx); __ push(rdx); __ push(rsi); __ push(rdi);
__ lea(rax, Address(rsp, wordSize*6)); // entry_sp __ lea(rax, Address(rsp, wordSize*6)); // entry_sp
// arguments: // arguments:
__ push(rbp); // interpreter frame pointer
__ push(rsi); // saved_sp __ push(rsi); // saved_sp
__ push(rax); // entry_sp __ push(rax); // entry_sp
__ push(rcx); // mh __ push(rcx); // mh
__ push(rcx); __ push(rcx);
__ movptr(Address(rsp, 0), (intptr_t)entry_name(ek)); __ movptr(Address(rsp, 0), (intptr_t)entry_name(ek));
__ call_VM_leaf(CAST_FROM_FN_PTR(address, trace_method_handle_stub), 4); __ call_VM_leaf(CAST_FROM_FN_PTR(address, trace_method_handle_stub), 5);
__ pop(rdi); __ pop(rsi); __ pop(rdx); __ pop(rcx); __ pop(rbx); __ pop(rax); __ pop(rdi); __ pop(rsi); __ pop(rdx); __ pop(rcx); __ pop(rbx); __ pop(rax);
} }
#endif //PRODUCT #endif //PRODUCT
switch ((int) ek) { switch ((int) ek) {
case _check_mtype: case _raise_exception:
{ {
// this stub is special, because it requires a live mtype argument // Not a real MH entry, but rather shared code for raising an exception.
Register rax_mtype = rax; // Extra local arguments are pushed on stack, as required type at TOS+8,
// failing object (or NULL) at TOS+4, failing bytecode type at TOS.
// Beyond those local arguments are the PC, of course.
Register rdx_code = rdx_temp;
Register rcx_fail = rcx_recv;
Register rax_want = rax_argslot;
Register rdi_pc = rdi;
__ pop(rdx_code); // TOS+0
__ pop(rcx_fail); // TOS+4
__ pop(rax_want); // TOS+8
__ pop(rdi_pc); // caller PC
// emit WrongMethodType path first, to enable jccb back-branch __ mov(rsp, rsi); // cut the stack back to where the caller started
Label wrong_method_type;
__ bind(wrong_method_type);
__ movptr(rdx_temp, ExternalAddress((address) &_entries[_wrong_method_type]));
__ jmp(Address(rdx_temp, MethodHandleEntry::from_interpreted_entry_offset_in_bytes()));
__ hlt();
interp_entry = __ pc(); // Repush the arguments as if coming from the interpreter.
__ check_method_handle_type(rax_mtype, rcx_recv, rdx_temp, wrong_method_type); if (TaggedStackInterpreter) __ push(frame::tag_for_basic_type(T_INT));
// now rax_mtype is dead; subsequent stubs will use it as a temp __ push(rdx_code);
if (TaggedStackInterpreter) __ push(frame::tag_for_basic_type(T_OBJECT));
__ push(rcx_fail);
if (TaggedStackInterpreter) __ push(frame::tag_for_basic_type(T_OBJECT));
__ push(rax_want);
__ jump_to_method_handle_entry(rcx_recv, rdx_temp); Register rbx_method = rbx_temp;
} Label no_method;
break; // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
__ movptr(rbx_method, ExternalAddress((address) &_raise_exception_method));
__ testptr(rbx_method, rbx_method);
__ jcc(Assembler::zero, no_method);
int jobject_oop_offset = 0;
__ movptr(rbx_method, Address(rbx_method, jobject_oop_offset)); // dereference the jobject
__ testptr(rbx_method, rbx_method);
__ jcc(Assembler::zero, no_method);
__ verify_oop(rbx_method);
__ push(rdi_pc); // and restore caller PC
__ jmp(rbx_method_fie);
case _wrong_method_type: // If we get here, the Java runtime did not do its job of creating the exception.
{ // Do something that is at least causes a valid throw from the interpreter.
// this stub is special, because it requires a live mtype argument __ bind(no_method);
Register rax_mtype = rax; __ pop(rax_want);
if (TaggedStackInterpreter) __ pop(rcx_fail);
interp_entry = __ pc(); __ pop(rcx_fail);
__ push(rax_mtype); // required mtype __ push(rax_want);
__ push(rcx_recv); // random mh (1st stacked argument) __ push(rcx_fail);
__ jump(ExternalAddress(Interpreter::throw_WrongMethodType_entry())); __ jump(ExternalAddress(Interpreter::throw_WrongMethodType_entry()));
} }
break; break;
@ -442,7 +474,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ load_klass(rax_klass, rcx_recv); __ load_klass(rax_klass, rcx_recv);
__ verify_oop(rax_klass); __ verify_oop(rax_klass);
Register rcx_temp = rcx_recv; Register rdi_temp = rdi;
Register rbx_method = rbx_index; Register rbx_method = rbx_index;
// get interface klass // get interface klass
@ -451,7 +483,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ lookup_interface_method(rax_klass, rdx_intf, __ lookup_interface_method(rax_klass, rdx_intf,
// note: next two args must be the same: // note: next two args must be the same:
rbx_index, rbx_method, rbx_index, rbx_method,
rcx_temp, rdi_temp,
no_such_interface); no_such_interface);
__ verify_oop(rbx_method); __ verify_oop(rbx_method);
@ -461,7 +493,10 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ bind(no_such_interface); __ bind(no_such_interface);
// Throw an exception. // Throw an exception.
// For historical reasons, it will be IncompatibleClassChangeError. // For historical reasons, it will be IncompatibleClassChangeError.
__ should_not_reach_here(); // %%% FIXME NYI __ pushptr(Address(rdx_intf, java_mirror_offset)); // required interface
__ push(rcx_recv); // bad receiver
__ push((int)Bytecodes::_invokeinterface); // who is complaining?
__ jump(ExternalAddress(from_interpreted_entry(_raise_exception)));
} }
break; break;
@ -524,6 +559,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
break; break;
case _adapter_retype_only: case _adapter_retype_only:
case _adapter_retype_raw:
// immediately jump to the next MH layer: // immediately jump to the next MH layer:
__ movptr(rcx_recv, rcx_mh_vmtarget); __ movptr(rcx_recv, rcx_mh_vmtarget);
__ verify_oop(rcx_recv); __ verify_oop(rcx_recv);
@ -545,10 +581,6 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ movptr(rbx_klass, rcx_amh_argument); // this is a Class object! __ movptr(rbx_klass, rcx_amh_argument); // this is a Class object!
__ movptr(rbx_klass, Address(rbx_klass, java_lang_Class::klass_offset_in_bytes())); __ movptr(rbx_klass, Address(rbx_klass, java_lang_Class::klass_offset_in_bytes()));
// get the new MH:
__ movptr(rcx_recv, rcx_mh_vmtarget);
// (now we are done with the old MH)
Label done; Label done;
__ movptr(rdx_temp, vmarg); __ movptr(rdx_temp, vmarg);
__ testl(rdx_temp, rdx_temp); __ testl(rdx_temp, rdx_temp);
@ -558,17 +590,23 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
// live at this point: // live at this point:
// - rbx_klass: klass required by the target method // - rbx_klass: klass required by the target method
// - rdx_temp: argument klass to test // - rdx_temp: argument klass to test
// - rcx_recv: method handle to invoke (after cast succeeds) // - rcx_recv: adapter method handle
__ check_klass_subtype(rdx_temp, rbx_klass, rax_argslot, done); __ check_klass_subtype(rdx_temp, rbx_klass, rax_argslot, done);
// If we get here, the type check failed! // If we get here, the type check failed!
// Call the wrong_method_type stub, passing the failing argument type in rax. // Call the wrong_method_type stub, passing the failing argument type in rax.
Register rax_mtype = rax_argslot; Register rax_mtype = rax_argslot;
__ push(rbx_klass); // missed klass (required type) __ movl(rax_argslot, rcx_amh_vmargslot); // reload argslot field
__ push(rdx_temp); // bad actual type (1st stacked argument) __ movptr(rdx_temp, vmarg);
__ jump(ExternalAddress(Interpreter::throw_WrongMethodType_entry()));
__ pushptr(rcx_amh_argument); // required class
__ push(rdx_temp); // bad object
__ push((int)Bytecodes::_checkcast); // who is complaining?
__ jump(ExternalAddress(from_interpreted_entry(_raise_exception)));
__ bind(done); __ bind(done);
// get the new MH:
__ movptr(rcx_recv, rcx_mh_vmtarget);
__ jump_to_method_handle_entry(rcx_recv, rdx_temp); __ jump_to_method_handle_entry(rcx_recv, rdx_temp);
} }
break; break;
@ -1107,11 +1145,17 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
__ bind(bad_array_klass); __ bind(bad_array_klass);
UNPUSH_RSI_RDI; UNPUSH_RSI_RDI;
__ stop("bad array klass NYI"); __ pushptr(Address(rdx_array_klass, java_mirror_offset)); // required type
__ pushptr(vmarg); // bad array
__ push((int)Bytecodes::_aaload); // who is complaining?
__ jump(ExternalAddress(from_interpreted_entry(_raise_exception)));
__ bind(bad_array_length); __ bind(bad_array_length);
UNPUSH_RSI_RDI; UNPUSH_RSI_RDI;
__ stop("bad array length NYI"); __ push(rcx_recv); // AMH requiring a certain length
__ pushptr(vmarg); // bad array
__ push((int)Bytecodes::_arraylength); // who is complaining?
__ jump(ExternalAddress(from_interpreted_entry(_raise_exception)));
#undef UNPUSH_RSI_RDI #undef UNPUSH_RSI_RDI
} }

View file

@ -92,8 +92,7 @@ address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
return entry; return entry;
} }
// Arguments are: required type at TOS+8, failing object (or NULL) at TOS+4. // Arguments are: required type at TOS+4, failing object (or NULL) at TOS.
// pc at TOS (just for debugging)
address TemplateInterpreterGenerator::generate_WrongMethodType_handler() { address TemplateInterpreterGenerator::generate_WrongMethodType_handler() {
address entry = __ pc(); address entry = __ pc();

View file

@ -139,7 +139,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
} }
__ g1_write_barrier_pre(rdx, r8, rbx, val != noreg); __ g1_write_barrier_pre(rdx, r8, rbx, val != noreg);
if (val == noreg) { if (val == noreg) {
__ store_heap_oop(Address(rdx, 0), NULL_WORD); __ store_heap_oop_null(Address(rdx, 0));
} else { } else {
__ store_heap_oop(Address(rdx, 0), val); __ store_heap_oop(Address(rdx, 0), val);
__ g1_write_barrier_post(rdx, val, r8, rbx); __ g1_write_barrier_post(rdx, val, r8, rbx);
@ -152,7 +152,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
case BarrierSet::CardTableExtension: case BarrierSet::CardTableExtension:
{ {
if (val == noreg) { if (val == noreg) {
__ store_heap_oop(obj, NULL_WORD); __ store_heap_oop_null(obj);
} else { } else {
__ store_heap_oop(obj, val); __ store_heap_oop(obj, val);
// flatten object address if needed // flatten object address if needed
@ -168,7 +168,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
case BarrierSet::ModRef: case BarrierSet::ModRef:
case BarrierSet::Other: case BarrierSet::Other:
if (val == noreg) { if (val == noreg) {
__ store_heap_oop(obj, NULL_WORD); __ store_heap_oop_null(obj);
} else { } else {
__ store_heap_oop(obj, val); __ store_heap_oop(obj, val);
} }

View file

@ -0,0 +1,77 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_assembler_zero.cpp.incl"
int AbstractAssembler::code_fill_byte() {
return 0;
}
void Assembler::pd_patch_instruction(address branch, address target) {
ShouldNotCallThis();
}
#ifndef PRODUCT
void Assembler::pd_print_patched_instruction(address branch) {
ShouldNotCallThis();
}
#endif // PRODUCT
void MacroAssembler::align(int modulus) {
while (offset() % modulus != 0)
emit_byte(AbstractAssembler::code_fill_byte());
}
void MacroAssembler::bang_stack_with_offset(int offset) {
ShouldNotCallThis();
}
void MacroAssembler::advance(int bytes) {
_code_pos += bytes;
sync();
}
RegisterOrConstant MacroAssembler::delayed_value_impl(
intptr_t* delayed_value_addr, Register tmpl, int offset) {
ShouldNotCallThis();
}
void MacroAssembler::store_oop(jobject obj) {
code_section()->relocate(pc(), oop_Relocation::spec_for_immediate());
emit_address((address) obj);
}
static void should_not_call() {
report_should_not_call(__FILE__, __LINE__);
}
address ShouldNotCallThisStub() {
return (address) should_not_call;
}
address ShouldNotCallThisEntry() {
return (address) should_not_call;
}

View file

@ -0,0 +1,64 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// In normal, CPU-specific ports of HotSpot these two classes are used
// for generating assembly language. We don't do any of this in zero,
// of course, but we do sneak entry points around in CodeBuffers so we
// generate those here.
class Assembler : public AbstractAssembler {
public:
Assembler(CodeBuffer* code) : AbstractAssembler(code) {}
public:
void pd_patch_instruction(address branch, address target);
#ifndef PRODUCT
static void pd_print_patched_instruction(address branch);
#endif // PRODUCT
};
class MacroAssembler : public Assembler {
public:
MacroAssembler(CodeBuffer* code) : Assembler(code) {}
public:
void align(int modulus);
void bang_stack_with_offset(int offset);
bool needs_explicit_null_check(intptr_t offset);
RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
Register tmp, int offset);
public:
void advance(int bytes);
void store_oop(jobject obj);
};
#ifdef ASSERT
inline bool AbstractAssembler::pd_check_instruction_mark() {
ShouldNotCallThis();
}
#endif
address ShouldNotCallThisStub();
address ShouldNotCallThisEntry();

View file

@ -1,5 +1,6 @@
/* /*
* Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -19,12 +20,7 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
// CustomMXBean.java - see CustomTypeTest // This file is intentionally empty
package customtypes;
public interface CustomMXBean {
public Integer getX();
}

View file

@ -0,0 +1,54 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_cppInterpreter_zero.cpp.incl"
#ifdef CC_INTERP
const char *BytecodeInterpreter::name_of_field_at_address(address addr) {
#define DO(member) {if (addr == (address) &(member)) return XSTR(member);}
DO(_thread);
DO(_bcp);
DO(_locals);
DO(_constants);
DO(_method);
DO(_mdx);
DO(_stack);
DO(_msg);
DO(_result);
DO(_prev_link);
DO(_oop_temp);
DO(_stack_base);
DO(_stack_limit);
DO(_monitor_base);
DO(_self_link);
#undef DO
if (addr > (address) &_result && addr < (address) (&_result + 1))
return "_result)";
return NULL;
}
#endif // CC_INTERP

View file

@ -0,0 +1,148 @@
/*
* Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// Platform specific for C++ based Interpreter
#if defined(PPC) || defined(SPARC) || defined(IA64)
#define LOTS_OF_REGS // Use plenty of registers
#else
#undef LOTS_OF_REGS // Loser platforms
#endif
private:
interpreterState _self_link;
public:
inline void set_locals(intptr_t* new_locals) {
_locals = new_locals;
}
inline void set_method(methodOop new_method) {
_method = new_method;
}
inline interpreterState self_link() {
return _self_link;
}
inline void set_self_link(interpreterState new_self_link) {
_self_link = new_self_link;
}
inline interpreterState prev_link() {
return _prev_link;
}
inline void set_prev_link(interpreterState new_prev_link) {
_prev_link = new_prev_link;
}
inline void set_stack_limit(intptr_t* new_stack_limit) {
_stack_limit = new_stack_limit;
}
inline void set_stack_base(intptr_t* new_stack_base) {
_stack_base = new_stack_base;
}
inline void set_monitor_base(BasicObjectLock *new_monitor_base) {
_monitor_base = new_monitor_base;
}
inline void set_thread(JavaThread* new_thread) {
_thread = new_thread;
}
inline void set_constants(constantPoolCacheOop new_constants) {
_constants = new_constants;
}
inline oop oop_temp() {
return _oop_temp;
}
inline oop *oop_temp_addr() {
return &_oop_temp;
}
inline void set_oop_temp(oop new_oop_temp) {
_oop_temp = new_oop_temp;
}
inline address callee_entry_point() {
return _result._to_call._callee_entry_point;
}
inline address osr_buf() {
return _result._osr._osr_buf;
}
inline address osr_entry() {
return _result._osr._osr_entry;
}
public:
const char *name_of_field_at_address(address addr);
// The frame manager handles this
#define SET_LAST_JAVA_FRAME()
#define RESET_LAST_JAVA_FRAME()
// ZeroStack Implementation
#undef STACK_INT
#undef STACK_FLOAT
#undef STACK_ADDR
#undef STACK_OBJECT
#undef STACK_DOUBLE
#undef STACK_LONG
#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)]))
#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)])
#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)]))
#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)]))
#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)]))
#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)]))
#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d)
#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l)
#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value))
#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value))
#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value))
#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value))
#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value))
#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value))
#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \
((VMJavaVal64*)(addr))->d)
#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value))
#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \
((VMJavaVal64*)(addr))->l)
// JavaLocals implementation
#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)])
#define LOCALS_ADDR(offset) ((address)locals[-(offset)])
#define LOCALS_INT(offset) (*((jint*)&locals[-(offset)]))
#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)]))
#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)])
#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value))
#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value))
#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value))
#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value))
#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
((VMJavaVal64*)(addr))->d)
#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
((VMJavaVal64*)(addr))->l)

View file

@ -0,0 +1,301 @@
/*
* Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// Inline interpreter functions for zero
inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
return op1 + op2;
}
inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) {
return op1 - op2;
}
inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) {
return op1 * op2;
}
inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) {
return op1 / op2;
}
inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) {
return fmod(op1, op2);
}
inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) {
return -op;
}
inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1,
jfloat op2,
int32_t direction) {
return ( op1 < op2 ? -1 :
op1 > op2 ? 1 :
op1 == op2 ? 0 :
(direction == -1 || direction == 1) ? direction : 0);
}
inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2],
const uint32_t from[2]) {
*(uint64_t *) to = *(uint64_t *) from;
}
inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) {
return op1 + op2;
}
inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) {
return op1 & op2;
}
inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) {
/* it's possible we could catch this special case implicitly */
if (op1 == (jlong) 0x8000000000000000LL && op2 == -1) return op1;
else return op1 / op2;
}
inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) {
return op1 * op2;
}
inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) {
return op1 | op2;
}
inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) {
return op1 - op2;
}
inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) {
return op1 ^ op2;
}
inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) {
/* it's possible we could catch this special case implicitly */
if (op1 == (jlong) 0x8000000000000000LL && op2 == -1) return 0;
else return op1 % op2;
}
inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) {
return ((unsigned long long) op1) >> (op2 & 0x3F);
}
inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) {
return op1 >> (op2 & 0x3F);
}
inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) {
return op1 << (op2 & 0x3F);
}
inline jlong BytecodeInterpreter::VMlongNeg(jlong op) {
return -op;
}
inline jlong BytecodeInterpreter::VMlongNot(jlong op) {
return ~op;
}
inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) {
return (op <= 0);
}
inline int32_t BytecodeInterpreter::VMlongGez(jlong op) {
return (op >= 0);
}
inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) {
return (op == 0);
}
inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) {
return (op1 == op2);
}
inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) {
return (op1 != op2);
}
inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) {
return (op1 >= op2);
}
inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) {
return (op1 <= op2);
}
inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) {
return (op1 < op2);
}
inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) {
return (op1 > op2);
}
inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) {
return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0);
}
// Long conversions
inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) {
return (jdouble) val;
}
inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) {
return (jfloat) val;
}
inline jint BytecodeInterpreter::VMlong2Int(jlong val) {
return (jint) val;
}
// Double Arithmetic
inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) {
return op1 + op2;
}
inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) {
// Divide by zero... QQQ
return op1 / op2;
}
inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) {
return op1 * op2;
}
inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) {
return -op;
}
inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) {
return fmod(op1, op2);
}
inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) {
return op1 - op2;
}
inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1,
jdouble op2,
int32_t direction) {
return ( op1 < op2 ? -1 :
op1 > op2 ? 1 :
op1 == op2 ? 0 :
(direction == -1 || direction == 1) ? direction : 0);
}
// Double Conversions
inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) {
return (jfloat) val;
}
// Float Conversions
inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) {
return (jdouble) op;
}
// Integer Arithmetic
inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) {
return op1 + op2;
}
inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) {
return op1 & op2;
}
inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) {
/* it's possible we could catch this special case implicitly */
if (op1 == (jint) 0x80000000 && op2 == -1) return op1;
else return op1 / op2;
}
inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) {
return op1 * op2;
}
inline jint BytecodeInterpreter::VMintNeg(jint op) {
return -op;
}
inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) {
return op1 | op2;
}
inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
/* it's possible we could catch this special case implicitly */
if (op1 == (jint) 0x80000000 && op2 == -1) return 0;
else return op1 % op2;
}
inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
return op1 << (op2 & 0x1F);
}
inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
return op1 >> (op2 & 0x1F);
}
inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
return op1 - op2;
}
inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
return ((juint) op1) >> (op2 & 0x1F);
}
inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {
return op1 ^ op2;
}
inline jdouble BytecodeInterpreter::VMint2Double(jint val) {
return (jdouble) val;
}
inline jfloat BytecodeInterpreter::VMint2Float(jint val) {
return (jfloat) val;
}
inline jlong BytecodeInterpreter::VMint2Long(jint val) {
return (jlong) val;
}
inline jchar BytecodeInterpreter::VMint2Char(jint val) {
return (jchar) val;
}
inline jshort BytecodeInterpreter::VMint2Short(jint val) {
return (jshort) val;
}
inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
return (jbyte) val;
}

View file

@ -0,0 +1,31 @@
/*
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_bytecodes_zero.cpp.incl"
void Bytecodes::pd_initialize() {
// No zero specific initialization
}

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,7 +20,7 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
package com.sun.xml.internal.rngom.ast.om;
public interface Location { } // This file is intentionally empty

View file

@ -0,0 +1,164 @@
/*
* Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
typedef union unaligned {
u4 u;
u2 us;
u8 ul;
} __attribute__((packed)) unaligned;
class Bytes: AllStatic {
public:
// Returns true if the byte ordering used by Java is different
// from the native byte ordering of the underlying machine.
static inline bool is_Java_byte_ordering_different() {
#ifdef VM_LITTLE_ENDIAN
return true;
#else
return false;
#endif
}
// Efficient reading and writing of unaligned unsigned data in
// platform-specific byte ordering.
static inline u2 get_native_u2(address p){
unaligned *up = (unaligned *) p;
return up->us;
}
static inline u4 get_native_u4(address p) {
unaligned *up = (unaligned *) p;
return up->u;
}
static inline u8 get_native_u8(address p) {
unaligned *up = (unaligned *) p;
return up->ul;
}
static inline void put_native_u2(address p, u2 x) {
unaligned *up = (unaligned *) p;
up->us = x;
}
static inline void put_native_u4(address p, u4 x) {
unaligned *up = (unaligned *) p;
up->u = x;
}
static inline void put_native_u8(address p, u8 x) {
unaligned *up = (unaligned *) p;
up->ul = x;
}
// Efficient reading and writing of unaligned unsigned data in Java
// byte ordering (i.e. big-endian ordering).
#ifdef VM_LITTLE_ENDIAN
// Byte-order reversal is needed
static inline u2 get_Java_u2(address p) {
return (u2(p[0]) << 8) |
(u2(p[1]) );
}
static inline u4 get_Java_u4(address p) {
return (u4(p[0]) << 24) |
(u4(p[1]) << 16) |
(u4(p[2]) << 8) |
(u4(p[3]) );
}
static inline u8 get_Java_u8(address p) {
u4 hi, lo;
hi = (u4(p[0]) << 24) |
(u4(p[1]) << 16) |
(u4(p[2]) << 8) |
(u4(p[3]) );
lo = (u4(p[4]) << 24) |
(u4(p[5]) << 16) |
(u4(p[6]) << 8) |
(u4(p[7]) );
return u8(lo) | (u8(hi) << 32);
}
static inline void put_Java_u2(address p, u2 x) {
p[0] = x >> 8;
p[1] = x;
}
static inline void put_Java_u4(address p, u4 x) {
p[0] = x >> 24;
p[1] = x >> 16;
p[2] = x >> 8;
p[3] = x;
}
static inline void put_Java_u8(address p, u8 x) {
u4 hi, lo;
lo = x;
hi = x >> 32;
p[0] = hi >> 24;
p[1] = hi >> 16;
p[2] = hi >> 8;
p[3] = hi;
p[4] = lo >> 24;
p[5] = lo >> 16;
p[6] = lo >> 8;
p[7] = lo;
}
// Efficient swapping of byte ordering
static inline u2 swap_u2(u2 x);
static inline u4 swap_u4(u4 x);
static inline u8 swap_u8(u8 x);
#else
// No byte-order reversal is needed
static inline u2 get_Java_u2(address p) {
return get_native_u2(p);
}
static inline u4 get_Java_u4(address p) {
return get_native_u4(p);
}
static inline u8 get_Java_u8(address p) {
return get_native_u8(p);
}
static inline void put_Java_u2(address p, u2 x) {
put_native_u2(p, x);
}
static inline void put_Java_u4(address p, u4 x) {
put_native_u4(p, x);
}
static inline void put_Java_u8(address p, u8 x) {
put_native_u8(p, x);
}
// No byte-order reversal is needed
static inline u2 swap_u2(u2 x) { return x; }
static inline u4 swap_u4(u4 x) { return x; }
static inline u8 swap_u8(u8 x) { return x; }
#endif // VM_LITTLE_ENDIAN
};
#ifdef VM_LITTLE_ENDIAN
// The following header contains the implementations of swap_u2,
// swap_u4, and swap_u8
#include "incls/_bytes_pd.inline.hpp.incl"
#endif // VM_LITTLE_ENDIAN

View file

@ -0,0 +1,27 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
private:
void pd_initialize() {}

View file

@ -0,0 +1,178 @@
/*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// Inline functions for memory copy and fill.
static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
memmove(to, from, count * HeapWordSize);
}
static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
switch (count) {
case 8: to[7] = from[7];
case 7: to[6] = from[6];
case 6: to[5] = from[5];
case 5: to[4] = from[4];
case 4: to[3] = from[3];
case 3: to[2] = from[2];
case 2: to[1] = from[1];
case 1: to[0] = from[0];
case 0: break;
default:
memcpy(to, from, count * HeapWordSize);
break;
}
}
static void pd_disjoint_words_atomic(HeapWord* from,
HeapWord* to,
size_t count) {
switch (count) {
case 8: to[7] = from[7];
case 7: to[6] = from[6];
case 6: to[5] = from[5];
case 5: to[4] = from[4];
case 4: to[3] = from[3];
case 3: to[2] = from[2];
case 2: to[1] = from[1];
case 1: to[0] = from[0];
case 0: break;
default:
while (count-- > 0) {
*to++ = *from++;
}
break;
}
}
static void pd_aligned_conjoint_words(HeapWord* from,
HeapWord* to,
size_t count) {
memmove(to, from, count * HeapWordSize);
}
static void pd_aligned_disjoint_words(HeapWord* from,
HeapWord* to,
size_t count) {
pd_disjoint_words(from, to, count);
}
static void pd_conjoint_bytes(void* from, void* to, size_t count) {
memmove(to, from, count);
}
static void pd_conjoint_bytes_atomic(void* from, void* to, size_t count) {
memmove(to, from, count);
}
static void pd_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
_Copy_conjoint_jshorts_atomic(from, to, count);
}
static void pd_conjoint_jints_atomic(jint* from, jint* to, size_t count) {
_Copy_conjoint_jints_atomic(from, to, count);
}
static void pd_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) {
_Copy_conjoint_jlongs_atomic(from, to, count);
}
static void pd_conjoint_oops_atomic(oop* from, oop* to, size_t count) {
#ifdef _LP64
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
_Copy_conjoint_jlongs_atomic((jlong*)from, (jlong*)to, count);
#else
assert(BytesPerInt == BytesPerOop, "jints and oops must be the same size");
_Copy_conjoint_jints_atomic((jint*)from, (jint*)to, count);
#endif // _LP64
}
static void pd_arrayof_conjoint_bytes(HeapWord* from,
HeapWord* to,
size_t count) {
_Copy_arrayof_conjoint_bytes(from, to, count);
}
static void pd_arrayof_conjoint_jshorts(HeapWord* from,
HeapWord* to,
size_t count) {
_Copy_arrayof_conjoint_jshorts(from, to, count);
}
static void pd_arrayof_conjoint_jints(HeapWord* from,
HeapWord* to,
size_t count) {
_Copy_arrayof_conjoint_jints(from, to, count);
}
static void pd_arrayof_conjoint_jlongs(HeapWord* from,
HeapWord* to,
size_t count) {
_Copy_arrayof_conjoint_jlongs(from, to, count);
}
static void pd_arrayof_conjoint_oops(HeapWord* from,
HeapWord* to,
size_t count) {
#ifdef _LP64
assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
_Copy_arrayof_conjoint_jlongs(from, to, count);
#else
assert(BytesPerInt == BytesPerOop, "jints and oops must be the same size");
_Copy_arrayof_conjoint_jints(from, to, count);
#endif // _LP64
}
static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
#ifdef _LP64
julong* to = (julong*) tohw;
julong v = ((julong) value << 32) | value;
#else
juint* to = (juint*) tohw;
juint v = value;
#endif // _LP64
while (count-- > 0) {
*to++ = v;
}
}
static void pd_fill_to_aligned_words(HeapWord* tohw,
size_t count,
juint value) {
pd_fill_to_words(tohw, count, value);
}
static void pd_fill_to_bytes(void* to, size_t count, jubyte value) {
memset(to, value, count);
}
static void pd_zero_to_words(HeapWord* tohw, size_t count) {
pd_fill_to_words(tohw, count, 0);
}
static void pd_zero_to_bytes(void* to, size_t count) {
memset(to, 0, count);
}

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,13 +20,18 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/
/**
* *
* @author WS Development Team
*/ */
@com.sun.xml.internal.txw2.annotation.XmlNamespace("http://schemas.xmlsoap.org/wsdl/http/")
package com.sun.xml.internal.ws.wsdl.writer.document.http; protected:
MacroAssembler* assembler() const {
return _masm;
}
protected:
address generate_entry(address entry_point) {
ZeroEntry *entry = (ZeroEntry *) assembler()->pc();
assembler()->advance(sizeof(ZeroEntry));
entry->set_entry_point(entry_point);
return (address) entry;
}

View file

@ -0,0 +1,946 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_cppInterpreter_zero.cpp.incl"
#ifdef CC_INTERP
#define fixup_after_potential_safepoint() \
method = istate->method()
#define CALL_VM_NOCHECK(func) \
thread->set_last_Java_frame(); \
func; \
thread->reset_last_Java_frame(); \
fixup_after_potential_safepoint()
void CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
// Adjust the caller's stack frame to accomodate any additional
// local variables we have contiguously with our parameters.
int extra_locals = method->max_locals() - method->size_of_parameters();
if (extra_locals > 0) {
if (extra_locals > stack->available_words()) {
Unimplemented();
}
for (int i = 0; i < extra_locals; i++)
stack->push(0);
}
// Allocate and initialize our frame.
InterpreterFrame *frame = InterpreterFrame::build(stack, method, thread);
thread->push_zero_frame(frame);
// Execute those bytecodes!
main_loop(0, THREAD);
}
void CppInterpreter::main_loop(int recurse, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
// If we are entering from a deopt we may need to call
// ourself a few times in order to get to our frame.
if (recurse)
main_loop(recurse - 1, THREAD);
InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
interpreterState istate = frame->interpreter_state();
methodOop method = istate->method();
intptr_t *result = NULL;
int result_slots = 0;
// Check we're not about to run out of stack
if (stack_overflow_imminent(thread)) {
CALL_VM_NOCHECK(InterpreterRuntime::throw_StackOverflowError(thread));
goto unwind_and_return;
}
while (true) {
// We can set up the frame anchor with everything we want at
// this point as we are thread_in_Java and no safepoints can
// occur until we go to vm mode. We do have to clear flags
// on return from vm but that is it.
thread->set_last_Java_frame();
// Call the interpreter
if (JvmtiExport::can_post_interpreter_events())
BytecodeInterpreter::runWithChecks(istate);
else
BytecodeInterpreter::run(istate);
fixup_after_potential_safepoint();
// Clear the frame anchor
thread->reset_last_Java_frame();
// Examine the message from the interpreter to decide what to do
if (istate->msg() == BytecodeInterpreter::call_method) {
methodOop callee = istate->callee();
// Trim back the stack to put the parameters at the top
stack->set_sp(istate->stack() + 1);
// Make the call
Interpreter::invoke_method(callee, istate->callee_entry_point(), THREAD);
fixup_after_potential_safepoint();
// Convert the result
istate->set_stack(stack->sp() - 1);
// Restore the stack
stack->set_sp(istate->stack_limit() + 1);
// Resume the interpreter
istate->set_msg(BytecodeInterpreter::method_resume);
}
else if (istate->msg() == BytecodeInterpreter::more_monitors) {
int monitor_words = frame::interpreter_frame_monitor_size();
// Allocate the space
if (monitor_words > stack->available_words()) {
Unimplemented();
}
stack->alloc(monitor_words * wordSize);
// Move the expression stack contents
for (intptr_t *p = istate->stack() + 1; p < istate->stack_base(); p++)
*(p - monitor_words) = *p;
// Move the expression stack pointers
istate->set_stack_limit(istate->stack_limit() - monitor_words);
istate->set_stack(istate->stack() - monitor_words);
istate->set_stack_base(istate->stack_base() - monitor_words);
// Zero the new monitor so the interpreter can find it.
((BasicObjectLock *) istate->stack_base())->set_obj(NULL);
// Resume the interpreter
istate->set_msg(BytecodeInterpreter::got_monitors);
}
else if (istate->msg() == BytecodeInterpreter::return_from_method) {
// Copy the result into the caller's frame
result_slots = type2size[method->result_type()];
assert(result_slots >= 0 && result_slots <= 2, "what?");
result = istate->stack() + result_slots;
break;
}
else if (istate->msg() == BytecodeInterpreter::throwing_exception) {
assert(HAS_PENDING_EXCEPTION, "should do");
break;
}
else if (istate->msg() == BytecodeInterpreter::do_osr) {
// Unwind the current frame
thread->pop_zero_frame();
// Remove any extension of the previous frame
int extra_locals = method->max_locals() - method->size_of_parameters();
stack->set_sp(stack->sp() + extra_locals);
// Jump into the OSR method
Interpreter::invoke_osr(
method, istate->osr_entry(), istate->osr_buf(), THREAD);
return;
}
else {
ShouldNotReachHere();
}
}
unwind_and_return:
// Unwind the current frame
thread->pop_zero_frame();
// Pop our local variables
stack->set_sp(stack->sp() + method->max_locals());
// Push our result
for (int i = 0; i < result_slots; i++)
stack->push(result[-i]);
}
void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) {
// Make sure method is native and not abstract
assert(method->is_native() && !method->is_abstract(), "should be");
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
// Allocate and initialize our frame
InterpreterFrame *frame = InterpreterFrame::build(stack, method, thread);
thread->push_zero_frame(frame);
interpreterState istate = frame->interpreter_state();
intptr_t *locals = istate->locals();
// Check we're not about to run out of stack
if (stack_overflow_imminent(thread)) {
CALL_VM_NOCHECK(InterpreterRuntime::throw_StackOverflowError(thread));
goto unwind_and_return;
}
// Lock if necessary
BasicObjectLock *monitor;
monitor = NULL;
if (method->is_synchronized()) {
monitor = (BasicObjectLock*) istate->stack_base();
oop lockee = monitor->obj();
markOop disp = lockee->mark()->set_unlocked();
monitor->lock()->set_displaced_header(disp);
if (Atomic::cmpxchg_ptr(monitor, lockee->mark_addr(), disp) != disp) {
if (thread->is_lock_owned((address) disp->clear_lock_bits())) {
monitor->lock()->set_displaced_header(NULL);
}
else {
CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;
}
}
}
// Get the signature handler
InterpreterRuntime::SignatureHandler *handler; {
address handlerAddr = method->signature_handler();
if (handlerAddr == NULL) {
CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;
handlerAddr = method->signature_handler();
assert(handlerAddr != NULL, "eh?");
}
if (handlerAddr == (address) InterpreterRuntime::slow_signature_handler) {
CALL_VM_NOCHECK(handlerAddr =
InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;
}
handler = \
InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
}
// Get the native function entry point
address function;
function = method->native_function();
assert(function != NULL, "should be set if signature handler is");
// Build the argument list
if (handler->argument_count() * 2 > stack->available_words()) {
Unimplemented();
}
void **arguments;
void *mirror; {
arguments =
(void **) stack->alloc(handler->argument_count() * sizeof(void **));
void **dst = arguments;
void *env = thread->jni_environment();
*(dst++) = &env;
if (method->is_static()) {
istate->set_oop_temp(
method->constants()->pool_holder()->klass_part()->java_mirror());
mirror = istate->oop_temp_addr();
*(dst++) = &mirror;
}
intptr_t *src = locals;
for (int i = dst - arguments; i < handler->argument_count(); i++) {
ffi_type *type = handler->argument_type(i);
if (type == &ffi_type_pointer) {
if (*src) {
stack->push((intptr_t) src);
*(dst++) = stack->sp();
}
else {
*(dst++) = src;
}
src--;
}
else if (type->size == 4) {
*(dst++) = src--;
}
else if (type->size == 8) {
src--;
*(dst++) = src--;
}
else {
ShouldNotReachHere();
}
}
}
// Set up the Java frame anchor
thread->set_last_Java_frame();
// Change the thread state to _thread_in_native
ThreadStateTransition::transition_from_java(thread, _thread_in_native);
// Make the call
intptr_t result[4 - LogBytesPerWord];
ffi_call(handler->cif(), (void (*)()) function, result, arguments);
// Change the thread state back to _thread_in_Java.
// ThreadStateTransition::transition_from_native() cannot be used
// here because it does not check for asynchronous exceptions.
// We have to manage the transition ourself.
thread->set_thread_state(_thread_in_native_trans);
// Make sure new state is visible in the GC thread
if (os::is_MP()) {
if (UseMembar) {
OrderAccess::fence();
}
else {
InterfaceSupport::serialize_memory(thread);
}
}
// Handle safepoint operations, pending suspend requests,
// and pending asynchronous exceptions.
if (SafepointSynchronize::do_call_back() ||
thread->has_special_condition_for_native_trans()) {
JavaThread::check_special_condition_for_native_trans(thread);
CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops());
}
// Finally we can change the thread state to _thread_in_Java.
thread->set_thread_state(_thread_in_Java);
fixup_after_potential_safepoint();
// Clear the frame anchor
thread->reset_last_Java_frame();
// If the result was an oop then unbox it and store it in
// oop_temp where the garbage collector can see it before
// we release the handle it might be protected by.
if (handler->result_type() == &ffi_type_pointer) {
if (result[0])
istate->set_oop_temp(*(oop *) result[0]);
else
istate->set_oop_temp(NULL);
}
// Reset handle block
thread->active_handles()->clear();
// Unlock if necessary. It seems totally wrong that this
// is skipped in the event of an exception but apparently
// the template interpreter does this so we do too.
if (monitor && !HAS_PENDING_EXCEPTION) {
BasicLock *lock = monitor->lock();
markOop header = lock->displaced_header();
oop rcvr = monitor->obj();
monitor->set_obj(NULL);
if (header != NULL) {
if (Atomic::cmpxchg_ptr(header, rcvr->mark_addr(), lock) != lock) {
monitor->set_obj(rcvr); {
HandleMark hm(thread);
CALL_VM_NOCHECK(InterpreterRuntime::monitorexit(thread, monitor));
}
}
}
}
unwind_and_return:
// Unwind the current activation
thread->pop_zero_frame();
// Pop our parameters
stack->set_sp(stack->sp() + method->size_of_parameters());
// Push our result
if (!HAS_PENDING_EXCEPTION) {
stack->set_sp(stack->sp() - type2size[method->result_type()]);
switch (method->result_type()) {
case T_VOID:
break;
case T_BOOLEAN:
#ifndef VM_LITTLE_ENDIAN
result[0] <<= (BitsPerWord - BitsPerByte);
#endif
SET_LOCALS_INT(*(jboolean *) result != 0, 0);
break;
case T_CHAR:
#ifndef VM_LITTLE_ENDIAN
result[0] <<= (BitsPerWord - BitsPerShort);
#endif
SET_LOCALS_INT(*(jchar *) result, 0);
break;
case T_BYTE:
#ifndef VM_LITTLE_ENDIAN
result[0] <<= (BitsPerWord - BitsPerByte);
#endif
SET_LOCALS_INT(*(jbyte *) result, 0);
break;
case T_SHORT:
#ifndef VM_LITTLE_ENDIAN
result[0] <<= (BitsPerWord - BitsPerShort);
#endif
SET_LOCALS_INT(*(jshort *) result, 0);
break;
case T_INT:
#ifndef VM_LITTLE_ENDIAN
result[0] <<= (BitsPerWord - BitsPerInt);
#endif
SET_LOCALS_INT(*(jint *) result, 0);
break;
case T_LONG:
SET_LOCALS_LONG(*(jlong *) result, 0);
break;
case T_FLOAT:
SET_LOCALS_FLOAT(*(jfloat *) result, 0);
break;
case T_DOUBLE:
SET_LOCALS_DOUBLE(*(jdouble *) result, 0);
break;
case T_OBJECT:
case T_ARRAY:
SET_LOCALS_OBJECT(istate->oop_temp(), 0);
break;
default:
ShouldNotReachHere();
}
}
}
void CppInterpreter::accessor_entry(methodOop method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
intptr_t *locals = stack->sp();
// Drop into the slow path if we need a safepoint check
if (SafepointSynchronize::do_call_back()) {
normal_entry(method, 0, THREAD);
return;
}
// Load the object pointer and drop into the slow path
// if we have a NullPointerException
oop object = LOCALS_OBJECT(0);
if (object == NULL) {
normal_entry(method, 0, THREAD);
return;
}
// Read the field index from the bytecode, which looks like this:
// 0: aload_0
// 1: getfield
// 2: index
// 3: index
// 4: ireturn/areturn
// NB this is not raw bytecode: index is in machine order
u1 *code = method->code_base();
assert(code[0] == Bytecodes::_aload_0 &&
code[1] == Bytecodes::_getfield &&
(code[4] == Bytecodes::_ireturn ||
code[4] == Bytecodes::_areturn), "should do");
u2 index = Bytes::get_native_u2(&code[2]);
// Get the entry from the constant pool cache, and drop into
// the slow path if it has not been resolved
constantPoolCacheOop cache = method->constants()->cache();
ConstantPoolCacheEntry* entry = cache->entry_at(index);
if (!entry->is_resolved(Bytecodes::_getfield)) {
normal_entry(method, 0, THREAD);
return;
}
// Get the result and push it onto the stack
switch (entry->flag_state()) {
case ltos:
case dtos:
if (stack->available_words() < 1) {
Unimplemented();
}
stack->alloc(wordSize);
break;
}
if (entry->is_volatile()) {
switch (entry->flag_state()) {
case ctos:
SET_LOCALS_INT(object->char_field_acquire(entry->f2()), 0);
break;
case btos:
SET_LOCALS_INT(object->byte_field_acquire(entry->f2()), 0);
break;
case stos:
SET_LOCALS_INT(object->short_field_acquire(entry->f2()), 0);
break;
case itos:
SET_LOCALS_INT(object->int_field_acquire(entry->f2()), 0);
break;
case ltos:
SET_LOCALS_LONG(object->long_field_acquire(entry->f2()), 0);
break;
case ftos:
SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2()), 0);
break;
case dtos:
SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2()), 0);
break;
case atos:
SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2()), 0);
break;
default:
ShouldNotReachHere();
}
}
else {
switch (entry->flag_state()) {
case ctos:
SET_LOCALS_INT(object->char_field(entry->f2()), 0);
break;
case btos:
SET_LOCALS_INT(object->byte_field(entry->f2()), 0);
break;
case stos:
SET_LOCALS_INT(object->short_field(entry->f2()), 0);
break;
case itos:
SET_LOCALS_INT(object->int_field(entry->f2()), 0);
break;
case ltos:
SET_LOCALS_LONG(object->long_field(entry->f2()), 0);
break;
case ftos:
SET_LOCALS_FLOAT(object->float_field(entry->f2()), 0);
break;
case dtos:
SET_LOCALS_DOUBLE(object->double_field(entry->f2()), 0);
break;
case atos:
SET_LOCALS_OBJECT(object->obj_field(entry->f2()), 0);
break;
default:
ShouldNotReachHere();
}
}
}
void CppInterpreter::empty_entry(methodOop method, intptr_t UNUSED, TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
// Drop into the slow path if we need a safepoint check
if (SafepointSynchronize::do_call_back()) {
normal_entry(method, 0, THREAD);
return;
}
// Pop our parameters
stack->set_sp(stack->sp() + method->size_of_parameters());
}
bool CppInterpreter::stack_overflow_imminent(JavaThread *thread) {
// How is the ABI stack?
address stack_top = thread->stack_base() - thread->stack_size();
int free_stack = os::current_stack_pointer() - stack_top;
if (free_stack < StackShadowPages * os::vm_page_size()) {
return true;
}
// How is the Zero stack?
// Throwing a StackOverflowError involves a VM call, which means
// we need a frame on the stack. We should be checking here to
// ensure that methods we call have enough room to install the
// largest possible frame, but that's more than twice the size
// of the entire Zero stack we get by default, so we just check
// we have *some* space instead...
free_stack = thread->zero_stack()->available_words() * wordSize;
if (free_stack < StackShadowPages * os::vm_page_size()) {
return true;
}
return false;
}
InterpreterFrame *InterpreterFrame::build(ZeroStack* stack,
const methodOop method,
JavaThread* thread) {
int monitor_words =
method->is_synchronized() ? frame::interpreter_frame_monitor_size() : 0;
int stack_words = method->is_native() ? 0 : method->max_stack();
if (header_words + monitor_words + stack_words > stack->available_words()) {
Unimplemented();
}
intptr_t *locals;
if (method->is_native())
locals = stack->sp() + (method->size_of_parameters() - 1);
else
locals = stack->sp() + (method->max_locals() - 1);
stack->push(0); // next_frame, filled in later
intptr_t *fp = stack->sp();
assert(fp - stack->sp() == next_frame_off, "should be");
stack->push(INTERPRETER_FRAME);
assert(fp - stack->sp() == frame_type_off, "should be");
interpreterState istate =
(interpreterState) stack->alloc(sizeof(BytecodeInterpreter));
assert(fp - stack->sp() == istate_off, "should be");
istate->set_locals(locals);
istate->set_method(method);
istate->set_self_link(istate);
istate->set_prev_link(NULL);
istate->set_thread(thread);
istate->set_bcp(method->is_native() ? NULL : method->code_base());
istate->set_constants(method->constants()->cache());
istate->set_msg(BytecodeInterpreter::method_entry);
istate->set_oop_temp(NULL);
istate->set_mdx(NULL);
istate->set_callee(NULL);
istate->set_monitor_base((BasicObjectLock *) stack->sp());
if (method->is_synchronized()) {
BasicObjectLock *monitor =
(BasicObjectLock *) stack->alloc(monitor_words * wordSize);
oop object;
if (method->is_static())
object = method->constants()->pool_holder()->klass_part()->java_mirror();
else
object = (oop) locals[0];
monitor->set_obj(object);
}
istate->set_stack_base(stack->sp());
istate->set_stack(stack->sp() - 1);
if (stack_words)
stack->alloc(stack_words * wordSize);
istate->set_stack_limit(stack->sp() - 1);
return (InterpreterFrame *) fp;
}
int AbstractInterpreter::BasicType_as_index(BasicType type) {
int i = 0;
switch (type) {
case T_BOOLEAN: i = 0; break;
case T_CHAR : i = 1; break;
case T_BYTE : i = 2; break;
case T_SHORT : i = 3; break;
case T_INT : i = 4; break;
case T_LONG : i = 5; break;
case T_VOID : i = 6; break;
case T_FLOAT : i = 7; break;
case T_DOUBLE : i = 8; break;
case T_OBJECT : i = 9; break;
case T_ARRAY : i = 9; break;
default : ShouldNotReachHere();
}
assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
"index out of bounds");
return i;
}
address InterpreterGenerator::generate_empty_entry() {
if (!UseFastEmptyMethods)
return NULL;
return generate_entry((address) CppInterpreter::empty_entry);
}
address InterpreterGenerator::generate_accessor_entry() {
if (!UseFastAccessorMethods)
return NULL;
return generate_entry((address) CppInterpreter::accessor_entry);
}
address InterpreterGenerator::generate_native_entry(bool synchronized) {
assert(synchronized == false, "should be");
return generate_entry((address) CppInterpreter::native_entry);
}
address InterpreterGenerator::generate_normal_entry(bool synchronized) {
assert(synchronized == false, "should be");
return generate_entry((address) CppInterpreter::normal_entry);
}
address AbstractInterpreterGenerator::generate_method_entry(
AbstractInterpreter::MethodKind kind) {
address entry_point = NULL;
switch (kind) {
case Interpreter::zerolocals:
case Interpreter::zerolocals_synchronized:
break;
case Interpreter::native:
entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
break;
case Interpreter::native_synchronized:
entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
break;
case Interpreter::empty:
entry_point = ((InterpreterGenerator*) this)->generate_empty_entry();
break;
case Interpreter::accessor:
entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry();
break;
case Interpreter::abstract:
entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry();
break;
case Interpreter::method_handle:
entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();
break;
case Interpreter::java_lang_math_sin:
case Interpreter::java_lang_math_cos:
case Interpreter::java_lang_math_tan:
case Interpreter::java_lang_math_abs:
case Interpreter::java_lang_math_log:
case Interpreter::java_lang_math_log10:
case Interpreter::java_lang_math_sqrt:
entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind);
break;
default:
ShouldNotReachHere();
}
if (entry_point == NULL)
entry_point = ((InterpreterGenerator*) this)->generate_normal_entry(false);
return entry_point;
}
InterpreterGenerator::InterpreterGenerator(StubQueue* code)
: CppInterpreterGenerator(code) {
generate_all();
}
// Deoptimization helpers
InterpreterFrame *InterpreterFrame::build(ZeroStack* stack, int size) {
int size_in_words = size >> LogBytesPerWord;
assert(size_in_words * wordSize == size, "unaligned");
assert(size_in_words >= header_words, "too small");
if (size_in_words > stack->available_words()) {
Unimplemented();
}
stack->push(0); // next_frame, filled in later
intptr_t *fp = stack->sp();
assert(fp - stack->sp() == next_frame_off, "should be");
stack->push(INTERPRETER_FRAME);
assert(fp - stack->sp() == frame_type_off, "should be");
interpreterState istate =
(interpreterState) stack->alloc(sizeof(BytecodeInterpreter));
assert(fp - stack->sp() == istate_off, "should be");
istate->set_self_link(NULL); // mark invalid
stack->alloc((size_in_words - header_words) * wordSize);
return (InterpreterFrame *) fp;
}
int AbstractInterpreter::layout_activation(methodOop method,
int tempcount,
int popframe_extra_args,
int moncount,
int callee_param_count,
int callee_locals,
frame* caller,
frame* interpreter_frame,
bool is_top_frame) {
assert(popframe_extra_args == 0, "what to do?");
assert(!is_top_frame || (!callee_locals && !callee_param_count),
"top frame should have no caller")
// This code must exactly match what InterpreterFrame::build
// does (the full InterpreterFrame::build, that is, not the
// one that creates empty frames for the deoptimizer).
//
// If interpreter_frame is not NULL then it will be filled in.
// It's size is determined by a previous call to this method,
// so it should be correct.
//
// Note that tempcount is the current size of the expression
// stack. For top most frames we will allocate a full sized
// expression stack and not the trimmed version that non-top
// frames have.
int header_words = InterpreterFrame::header_words;
int monitor_words = moncount * frame::interpreter_frame_monitor_size();
int stack_words = is_top_frame ? method->max_stack() : tempcount;
int callee_extra_locals = callee_locals - callee_param_count;
if (interpreter_frame) {
intptr_t *locals = interpreter_frame->sp() + method->max_locals();
interpreterState istate = interpreter_frame->get_interpreterState();
intptr_t *monitor_base = (intptr_t*) istate;
intptr_t *stack_base = monitor_base - monitor_words;
intptr_t *stack = stack_base - tempcount - 1;
BytecodeInterpreter::layout_interpreterState(istate,
caller,
NULL,
method,
locals,
stack,
stack_base,
monitor_base,
NULL,
is_top_frame);
}
return header_words + monitor_words + stack_words + callee_extra_locals;
}
void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
frame* caller,
frame* current,
methodOop method,
intptr_t* locals,
intptr_t* stack,
intptr_t* stack_base,
intptr_t* monitor_base,
intptr_t* frame_bottom,
bool is_top_frame) {
istate->set_locals(locals);
istate->set_method(method);
istate->set_self_link(istate);
istate->set_prev_link(NULL);
// thread will be set by a hacky repurposing of frame::patch_pc()
// bcp will be set by vframeArrayElement::unpack_on_stack()
istate->set_constants(method->constants()->cache());
istate->set_msg(BytecodeInterpreter::method_resume);
istate->set_bcp_advance(0);
istate->set_oop_temp(NULL);
istate->set_mdx(NULL);
if (caller->is_interpreted_frame()) {
interpreterState prev = caller->get_interpreterState();
prev->set_callee(method);
if (*prev->bcp() == Bytecodes::_invokeinterface)
prev->set_bcp_advance(5);
else
prev->set_bcp_advance(3);
}
istate->set_callee(NULL);
istate->set_monitor_base((BasicObjectLock *) monitor_base);
istate->set_stack_base(stack_base);
istate->set_stack(stack);
istate->set_stack_limit(stack_base - method->max_stack() - 1);
}
address CppInterpreter::return_entry(TosState state, int length) {
ShouldNotCallThis();
}
address CppInterpreter::deopt_entry(TosState state, int length) {
return NULL;
}
// Helper for (runtime) stack overflow checks
int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
return 0;
}
// Helper for figuring out if frames are interpreter frames
bool CppInterpreter::contains(address pc) {
#ifdef PRODUCT
ShouldNotCallThis();
#else
return false; // make frame::print_value_on work
#endif // !PRODUCT
}
// Result handlers and convertors
address CppInterpreterGenerator::generate_result_handler_for(
BasicType type) {
assembler()->advance(1);
return ShouldNotCallThisStub();
}
address CppInterpreterGenerator::generate_tosca_to_stack_converter(
BasicType type) {
assembler()->advance(1);
return ShouldNotCallThisStub();
}
address CppInterpreterGenerator::generate_stack_to_stack_converter(
BasicType type) {
assembler()->advance(1);
return ShouldNotCallThisStub();
}
address CppInterpreterGenerator::generate_stack_to_native_abi_converter(
BasicType type) {
assembler()->advance(1);
return ShouldNotCallThisStub();
}
#endif // CC_INTERP

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,18 +20,24 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
package com.sun.xml.internal.bind.v2.model.runtime; protected:
// Size of interpreter code
const static int InterpreterCodeSize = 6 * K;
import java.lang.reflect.Type; public:
// Method entries
static void normal_entry(methodOop method, intptr_t UNUSED, TRAPS);
static void native_entry(methodOop method, intptr_t UNUSED, TRAPS);
static void accessor_entry(methodOop method, intptr_t UNUSED, TRAPS);
static void empty_entry(methodOop method, intptr_t UNUSED, TRAPS);
import com.sun.xml.internal.bind.v2.model.core.AttributePropertyInfo; public:
// Main loop of normal_entry
static void main_loop(int recurse, TRAPS);
/** private:
* @author Kohsuke Kawaguchi // Stack overflow checks
*/ static bool stack_overflow_imminent(JavaThread *thread);
public interface RuntimeAttributePropertyInfo extends AttributePropertyInfo<Type,Class>, RuntimePropertyInfo, RuntimeNonElementRef {
// refinement
RuntimeNonElement getTarget();
}

View file

@ -1,5 +1,6 @@
/* /*
* Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -19,9 +20,12 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
// package-info.java - test package annotations for custom types #include "incls/_precompiled.incl"
#include "incls/_debug_zero.cpp.incl"
@javax.management.openmbean.MXBeanMappingFactoryClass(IntegerIsStringFactory.class) void pd_ps(frame f) {
package customtypes; ShouldNotCallThis();
}

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file is intentionally empty

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file is intentionally empty

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file is intentionally empty

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,7 +20,16 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
package com.sun.xml.internal.rngom.ast.om;
public interface ParsedNameClass { } // The disassembler prints out zero code annotated
// with Java specific information.
static int pd_instruction_alignment() {
ShouldNotCallThis();
}
static const char* pd_cpu_opts() {
ShouldNotCallThis();
}

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,19 +20,17 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/
package com.sun.tools.internal.ws.api.wsdl;
/**
* A WSDL extension
* *
* @author Vivek Pandey
* @deprecated This interface is deprecated, will be removed in JAX-WS 2.2 RI.
*/ */
public interface TWSDLExtension {
/** #include "incls/_precompiled.incl"
* Gives Parent {@link TWSDLExtensible} element #include "incls/_dump_zero.cpp.incl"
*/
TWSDLExtensible getParent(); void CompactingPermGenGen::generate_vtable_methods(void** vtbl_list,
void** vtable,
char** md_top,
char* md_end,
char** mc_top,
char* mc_end) {
ShouldNotCallThis();
} }

View file

@ -0,0 +1,65 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// | ... |
// +--------------------+ ------------------
// | parameter n-1 | low addresses
// | ... |
// | parameter 0 |
// | call_wrapper |
// | frame_type |
// | next_frame | high addresses
// +--------------------+ ------------------
// | ... |
class EntryFrame : public ZeroFrame {
private:
EntryFrame() : ZeroFrame() {
ShouldNotCallThis();
}
protected:
enum Layout {
call_wrapper_off = jf_header_words,
header_words
};
public:
static EntryFrame *build(ZeroStack* stack,
const intptr_t* parameters,
int parameter_words,
JavaCallWrapper* call_wrapper);
public:
JavaCallWrapper *call_wrapper() const {
return (JavaCallWrapper *) value_of_word(call_wrapper_off);
}
public:
void identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const;
};

View file

@ -0,0 +1,64 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
class ZeroEntry {
public:
ZeroEntry() {
ShouldNotCallThis();
}
private:
address _entry_point;
public:
address entry_point() const {
return _entry_point;
}
void set_entry_point(address entry_point) {
_entry_point = entry_point;
}
private:
typedef void (*NormalEntryFunc)(methodOop method,
intptr_t base_pc,
TRAPS);
typedef void (*OSREntryFunc)(methodOop method,
address osr_buf,
intptr_t base_pc,
TRAPS);
public:
void invoke(methodOop method, TRAPS) const {
((NormalEntryFunc) entry_point())(method, (intptr_t) this, THREAD);
}
void invoke_osr(methodOop method, address osr_buf, TRAPS) const {
((OSREntryFunc) entry_point())(method, osr_buf, (intptr_t) this, THREAD);
}
public:
static ByteSize entry_point_offset() {
return byte_offset_of(ZeroEntry, _entry_point);
}
};

View file

@ -0,0 +1,53 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// | ... |
// +--------------------+ ------------------
// | frame_type | low addresses
// | next_frame | high addresses
// +--------------------+ ------------------
// | ... |
class FakeStubFrame : public ZeroFrame {
private:
FakeStubFrame() : ZeroFrame() {
ShouldNotCallThis();
}
protected:
enum Layout {
header_words = jf_header_words
};
public:
static FakeStubFrame *build(ZeroStack* stack);
public:
void identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const {}
};

View file

@ -0,0 +1,414 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_frame_zero.cpp.incl"
#ifdef ASSERT
void RegisterMap::check_location_valid() {
ShouldNotCallThis();
}
#endif
bool frame::is_interpreted_frame() const {
return zeroframe()->is_interpreter_frame();
}
bool frame::is_fake_stub_frame() const {
return zeroframe()->is_fake_stub_frame();
}
frame frame::sender_for_entry_frame(RegisterMap *map) const {
assert(map != NULL, "map must be set");
assert(!entry_frame_is_first(), "next Java fp must be non zero");
assert(entry_frame_call_wrapper()->anchor()->last_Java_sp() == sender_sp(),
"sender should be next Java frame");
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
return frame(sender_sp(), sp() + 1);
}
frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
return frame(sender_sp(), sp() + 1);
}
frame frame::sender_for_compiled_frame(RegisterMap *map) const {
return frame(sender_sp(), sp() + 1);
}
frame frame::sender_for_fake_stub_frame(RegisterMap *map) const {
return frame(sender_sp(), sp() + 1);
}
frame frame::sender(RegisterMap* map) const {
// Default is not to follow arguments; the various
// sender_for_xxx methods update this accordingly.
map->set_include_argument_oops(false);
if (is_entry_frame())
return sender_for_entry_frame(map);
if (is_interpreted_frame())
return sender_for_interpreter_frame(map);
if (is_compiled_frame())
return sender_for_compiled_frame(map);
if (is_fake_stub_frame())
return sender_for_fake_stub_frame(map);
ShouldNotReachHere();
}
#ifdef CC_INTERP
BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
return get_interpreterState()->monitor_base();
}
BasicObjectLock* frame::interpreter_frame_monitor_end() const {
return (BasicObjectLock*) get_interpreterState()->stack_base();
}
#endif // CC_INTERP
void frame::patch_pc(Thread* thread, address pc) {
// We borrow this call to set the thread pointer in the interpreter
// state; the hook to set up deoptimized frames isn't supplied it.
assert(pc == NULL, "should be");
get_interpreterState()->set_thread((JavaThread *) thread);
}
bool frame::safe_for_sender(JavaThread *thread) {
ShouldNotCallThis();
}
void frame::pd_gc_epilog() {
}
bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
ShouldNotCallThis();
}
BasicType frame::interpreter_frame_result(oop* oop_result,
jvalue* value_result) {
assert(is_interpreted_frame(), "interpreted frame expected");
methodOop method = interpreter_frame_method();
BasicType type = method->result_type();
intptr_t* tos_addr = (intptr_t *) interpreter_frame_tos_address();
oop obj;
switch (type) {
case T_VOID:
break;
case T_BOOLEAN:
value_result->z = *(jboolean *) tos_addr;
break;
case T_BYTE:
value_result->b = *(jbyte *) tos_addr;
break;
case T_CHAR:
value_result->c = *(jchar *) tos_addr;
break;
case T_SHORT:
value_result->s = *(jshort *) tos_addr;
break;
case T_INT:
value_result->i = *(jint *) tos_addr;
break;
case T_LONG:
value_result->j = *(jlong *) tos_addr;
break;
case T_FLOAT:
value_result->f = *(jfloat *) tos_addr;
break;
case T_DOUBLE:
value_result->d = *(jdouble *) tos_addr;
break;
case T_OBJECT:
case T_ARRAY:
if (method->is_native()) {
obj = get_interpreterState()->oop_temp();
}
else {
oop* obj_p = (oop *) tos_addr;
obj = (obj_p == NULL) ? (oop) NULL : *obj_p;
}
assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check");
*oop_result = obj;
break;
default:
ShouldNotReachHere();
}
return type;
}
int frame::frame_size(RegisterMap* map) const {
#ifdef PRODUCT
ShouldNotCallThis();
#else
return 0; // make javaVFrame::print_value work
#endif // PRODUCT
}
intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
int index = (Interpreter::expr_offset_in_bytes(offset) / wordSize);
return &interpreter_frame_tos_address()[index];
}
void frame::zero_print_on_error(int frame_index,
outputStream* st,
char* buf,
int buflen) const {
// Divide the buffer between the field and the value
buflen >>= 1;
char *fieldbuf = buf;
char *valuebuf = buf + buflen;
// Print each word of the frame
for (intptr_t *addr = fp(); addr <= sp(); addr++) {
int offset = sp() - addr;
// Fill in default values, then try and improve them
snprintf(fieldbuf, buflen, "word[%d]", offset);
snprintf(valuebuf, buflen, PTR_FORMAT, *addr);
zeroframe()->identify_word(frame_index, offset, fieldbuf, valuebuf, buflen);
fieldbuf[buflen - 1] = '\0';
valuebuf[buflen - 1] = '\0';
// Print the result
st->print_cr(" " PTR_FORMAT ": %-21s = %s", addr, fieldbuf, valuebuf);
}
}
void ZeroFrame::identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const {
switch (offset) {
case next_frame_off:
strncpy(fieldbuf, "next_frame", buflen);
break;
case frame_type_off:
strncpy(fieldbuf, "frame_type", buflen);
if (is_entry_frame())
strncpy(valuebuf, "ENTRY_FRAME", buflen);
else if (is_interpreter_frame())
strncpy(valuebuf, "INTERPRETER_FRAME", buflen);
else if (is_shark_frame())
strncpy(valuebuf, "SHARK_FRAME", buflen);
else if (is_fake_stub_frame())
strncpy(valuebuf, "FAKE_STUB_FRAME", buflen);
break;
default:
if (is_entry_frame()) {
as_entry_frame()->identify_word(
frame_index, offset, fieldbuf, valuebuf, buflen);
}
else if (is_interpreter_frame()) {
as_interpreter_frame()->identify_word(
frame_index, offset, fieldbuf, valuebuf, buflen);
}
else if (is_shark_frame()) {
as_shark_frame()->identify_word(
frame_index, offset, fieldbuf, valuebuf, buflen);
}
else if (is_fake_stub_frame()) {
as_fake_stub_frame()->identify_word(
frame_index, offset, fieldbuf, valuebuf, buflen);
}
}
}
void EntryFrame::identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const {
switch (offset) {
case call_wrapper_off:
strncpy(fieldbuf, "call_wrapper", buflen);
break;
default:
snprintf(fieldbuf, buflen, "local[%d]", offset - 3);
}
}
void InterpreterFrame::identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const {
interpreterState istate = interpreter_state();
bool is_valid = istate->self_link() == istate;
intptr_t *addr = addr_of_word(offset);
// Fixed part
if (addr >= (intptr_t *) istate) {
const char *field = istate->name_of_field_at_address((address) addr);
if (field) {
if (is_valid && !strcmp(field, "_method")) {
istate->method()->name_and_sig_as_C_string(valuebuf, buflen);
}
else if (is_valid && !strcmp(field, "_bcp") && istate->bcp()) {
snprintf(valuebuf, buflen, PTR_FORMAT " (bci %d)",
(intptr_t) istate->bcp(),
istate->method()->bci_from(istate->bcp()));
}
snprintf(fieldbuf, buflen, "%sistate->%s",
field[strlen(field) - 1] == ')' ? "(": "", field);
}
else if (addr == (intptr_t *) istate) {
strncpy(fieldbuf, "(vtable for istate)", buflen);
}
return;
}
// Variable part
if (!is_valid)
return;
// JNI stuff
if (istate->method()->is_native() && addr < istate->stack_base()) {
address hA = istate->method()->signature_handler();
if (hA != NULL) {
if (hA != (address) InterpreterRuntime::slow_signature_handler) {
InterpreterRuntime::SignatureHandler *handler =
InterpreterRuntime::SignatureHandler::from_handlerAddr(hA);
intptr_t *params = istate->stack_base() - handler->argument_count();
if (addr >= params) {
int param = addr - params;
const char *desc = "";
if (param == 0)
desc = " (JNIEnv)";
else if (param == 1) {
if (istate->method()->is_static())
desc = " (mirror)";
else
desc = " (this)";
}
snprintf(fieldbuf, buflen, "parameter[%d]%s", param, desc);
return;
}
for (int i = 0; i < handler->argument_count(); i++) {
if (params[i] == (intptr_t) addr) {
snprintf(fieldbuf, buflen, "unboxed parameter[%d]", i);
return;
}
}
}
}
return;
}
// Monitors and stack
identify_vp_word(frame_index, addr,
(intptr_t *) istate->monitor_base(),
istate->stack_base(),
fieldbuf, buflen);
}
void SharkFrame::identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const {
// Fixed part
switch (offset) {
case pc_off:
strncpy(fieldbuf, "pc", buflen);
if (method()->is_oop()) {
nmethod *code = method()->code();
if (code && code->pc_desc_at(pc())) {
SimpleScopeDesc ssd(code, pc());
snprintf(valuebuf, buflen, PTR_FORMAT " (bci %d)",
(intptr_t) pc(), ssd.bci());
}
}
return;
case unextended_sp_off:
strncpy(fieldbuf, "unextended_sp", buflen);
return;
case method_off:
strncpy(fieldbuf, "method", buflen);
if (method()->is_oop()) {
method()->name_and_sig_as_C_string(valuebuf, buflen);
}
return;
case oop_tmp_off:
strncpy(fieldbuf, "oop_tmp", buflen);
return;
}
// Variable part
if (method()->is_oop()) {
identify_vp_word(frame_index, addr_of_word(offset),
addr_of_word(header_words + 1),
unextended_sp() + method()->max_stack(),
fieldbuf, buflen);
}
}
void ZeroFrame::identify_vp_word(int frame_index,
intptr_t* addr,
intptr_t* monitor_base,
intptr_t* stack_base,
char* fieldbuf,
int buflen) const {
// Monitors
if (addr >= stack_base && addr < monitor_base) {
int monitor_size = frame::interpreter_frame_monitor_size();
int last_index = (monitor_base - stack_base) / monitor_size - 1;
int index = last_index - (addr - stack_base) / monitor_size;
intptr_t monitor = (intptr_t) (
(BasicObjectLock *) monitor_base - 1 - index);
intptr_t offset = (intptr_t) addr - monitor;
if (offset == BasicObjectLock::obj_offset_in_bytes())
snprintf(fieldbuf, buflen, "monitor[%d]->_obj", index);
else if (offset == BasicObjectLock::lock_offset_in_bytes())
snprintf(fieldbuf, buflen, "monitor[%d]->_lock", index);
return;
}
// Expression stack
if (addr < stack_base) {
snprintf(fieldbuf, buflen, "%s[%d]",
frame_index == 0 ? "stack_word" : "local",
(int) (stack_base - addr - 1));
return;
}
}

View file

@ -0,0 +1,77 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// A frame represents a physical stack frame on the Zero stack.
public:
enum {
pc_return_offset = 0
};
// Constructor
public:
frame(intptr_t* sp, intptr_t* fp);
// The sp of a Zero frame is the address of the highest word in
// that frame. We keep track of the lowest address too, so the
// boundaries of the frame are available for debug printing.
private:
intptr_t* _fp;
public:
intptr_t* fp() const {
return _fp;
}
#ifdef CC_INTERP
inline interpreterState get_interpreterState() const;
#endif // CC_INTERP
public:
const ZeroFrame *zeroframe() const {
return (ZeroFrame *) sp();
}
const EntryFrame *zero_entryframe() const {
return zeroframe()->as_entry_frame();
}
const InterpreterFrame *zero_interpreterframe() const {
return zeroframe()->as_interpreter_frame();
}
const SharkFrame *zero_sharkframe() const {
return zeroframe()->as_shark_frame();
}
public:
bool is_fake_stub_frame() const;
public:
frame sender_for_fake_stub_frame(RegisterMap* map) const;
public:
void zero_print_on_error(int index,
outputStream* st,
char* buf,
int buflen) const;

View file

@ -0,0 +1,151 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// Constructors
inline frame::frame() {
_sp = NULL;
_fp = NULL;
_pc = NULL;
_cb = NULL;
_deopt_state = unknown;
}
inline frame::frame(intptr_t* sp, intptr_t* fp) {
_sp = sp;
_fp = fp;
switch (zeroframe()->type()) {
case ZeroFrame::ENTRY_FRAME:
_pc = StubRoutines::call_stub_return_pc();
_cb = NULL;
break;
case ZeroFrame::INTERPRETER_FRAME:
_pc = NULL;
_cb = NULL;
break;
case ZeroFrame::SHARK_FRAME:
_pc = zero_sharkframe()->pc();
_cb = CodeCache::find_blob_unsafe(pc());
break;
case ZeroFrame::FAKE_STUB_FRAME:
_pc = NULL;
_cb = NULL;
break;
default:
ShouldNotReachHere();
}
_deopt_state = not_deoptimized;
}
// Accessors
inline intptr_t* frame::sender_sp() const {
return (intptr_t *) zeroframe()->next();
}
inline intptr_t* frame::link() const {
ShouldNotCallThis();
}
#ifdef CC_INTERP
inline interpreterState frame::get_interpreterState() const {
return zero_interpreterframe()->interpreter_state();
}
inline intptr_t** frame::interpreter_frame_locals_addr() const {
return &(get_interpreterState()->_locals);
}
inline intptr_t* frame::interpreter_frame_bcx_addr() const {
return (intptr_t*) &(get_interpreterState()->_bcp);
}
inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
return &(get_interpreterState()->_constants);
}
inline methodOop* frame::interpreter_frame_method_addr() const {
return &(get_interpreterState()->_method);
}
inline intptr_t* frame::interpreter_frame_mdx_addr() const {
return (intptr_t*) &(get_interpreterState()->_mdx);
}
inline intptr_t* frame::interpreter_frame_tos_address() const {
return get_interpreterState()->_stack + 1;
}
#endif // CC_INTERP
inline int frame::interpreter_frame_monitor_size() {
return BasicObjectLock::size();
}
inline intptr_t* frame::interpreter_frame_expression_stack() const {
intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
return monitor_end - 1;
}
inline jint frame::interpreter_frame_expression_stack_direction() {
return -1;
}
// Return a unique id for this frame. The id must have a value where
// we can distinguish identity and younger/older relationship. NULL
// represents an invalid (incomparable) frame.
inline intptr_t* frame::id() const {
return sp();
}
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
return zero_entryframe()->call_wrapper();
}
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
ShouldNotCallThis();
}
inline oop frame::saved_oop_result(RegisterMap* map) const {
ShouldNotCallThis();
}
inline bool frame::is_older(intptr_t* id) const {
ShouldNotCallThis();
}
inline intptr_t* frame::entry_frame_argument_at(int offset) const {
ShouldNotCallThis();
}
inline intptr_t* frame::unextended_sp() const {
if (zeroframe()->is_shark_frame())
return zero_sharkframe()->unextended_sp();
else
return (intptr_t *) -1;
}

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include <ffi.h>

View file

@ -0,0 +1,55 @@
/*
* Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
//
// Set the default values for platform dependent flags used by the
// runtime system. See globals.hpp for details of what they do.
//
define_pd_global(bool, ConvertSleepToYield, true);
define_pd_global(bool, ShareVtableStubs, true);
define_pd_global(bool, CountInterpCalls, true);
define_pd_global(bool, NeedsDeoptSuspend, false);
define_pd_global(bool, ImplicitNullChecks, true);
define_pd_global(bool, UncommonNullCast, true);
define_pd_global(intx, CodeEntryAlignment, 32);
define_pd_global(uintx, TLABSize, 0);
#ifdef _LP64
define_pd_global(uintx, NewSize, ScaleForWordSize(2048 * K));
#else
define_pd_global(uintx, NewSize, ScaleForWordSize(1024 * K));
#endif // _LP64
define_pd_global(intx, InlineFrequencyCount, 100);
define_pd_global(intx, InlineSmallCode, 1000);
define_pd_global(intx, PreInflateSpin, 10);
define_pd_global(intx, StackYellowPages, 2);
define_pd_global(intx, StackRedPages, 1);
define_pd_global(intx, StackShadowPages, 3 LP64_ONLY(+3) DEBUG_ONLY(+3));
define_pd_global(bool, RewriteBytecodes, true);
define_pd_global(bool, RewriteFrequentPairs, true);

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,28 +20,30 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/
package com.sun.codemodel.internal;
/**
* Anonymous class quick hack.
* *
* @author
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/ */
class JAnonymousClass extends JDefinedClass {
/** #include "incls/_precompiled.incl"
* Base interface/class from which this anonymous class is built. #include "incls/_icBuffer_zero.cpp.incl"
*/
private final JClass base;
JAnonymousClass( JClass _base) { int InlineCacheBuffer::ic_stub_code_size() {
super(_base.owner(), 0, null); // NB set this once the functions below are implemented
this.base = _base; return 4;
} }
public String fullName() { void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin,
return base.fullName(); oop cached_oop,
} address entry_point) {
// NB ic_stub_code_size() must return the size of the code we generate
ShouldNotCallThis();
}
address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
// NB ic_stub_code_size() must return the size of the code we generate
ShouldNotCallThis();
}
oop InlineCacheBuffer::ic_buffer_cached_oop(address code_begin) {
// NB ic_stub_code_size() must return the size of the code we generate
ShouldNotCallThis();
} }

View file

@ -1,5 +1,6 @@
/* /*
* Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -19,13 +20,13 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
// CustomLongMXBean.java - see CustomTypeTest #include "incls/_precompiled.incl"
#include "incls/_icache_zero.cpp.incl"
package customtypes; void ICacheStubGenerator::generate_icache_flush(
ICache::flush_icache_stub_t* flush_icache_stub) {
import javax.management.openmbean.MXBeanMappingFactoryClass; ShouldNotCallThis();
}
@MXBeanMappingFactoryClass(IntegerIsLongFactory.class)
public interface CustomLongMXBean extends CustomMXBean {}

View file

@ -0,0 +1,36 @@
/*
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// Interface for updating the instruction cache. Whenever the VM
// modifies code, part of the processor instruction cache potentially
// has to be flushed. This implementation is empty: Zero never deals
// with code, and LLVM handles cache flushing for Shark.
class ICache : public AbstractICache {
public:
static void initialize() {}
static void invalidate_word(address addr) {}
static void invalidate_range(address start, int nbytes) {}
};

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file is intentionally empty

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,20 +20,19 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
/**
* A SOAP "style" enumeration.
* *
* @author WS Development Team
*/ */
public final class SOAPStyle {
public static final SOAPStyle RPC = new SOAPStyle(); // This file specializes the assember with interpreter-specific macros
public static final SOAPStyle DOCUMENT = new SOAPStyle();
private SOAPStyle() { class InterpreterMacroAssembler : public MacroAssembler {
public:
InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
public:
RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
Register tmp,
int offset) {
ShouldNotCallThis();
} }
} };

View file

@ -0,0 +1,75 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#ifdef CC_INTERP
// | ... |
// +--------------------+ ------------------
// | stack slot n-1 | low addresses
// | ... |
// | stack slot 0 |
// | monitor 0 (maybe) |
// | ... |
// | interpreter state |
// | ... |
// | frame_type |
// | next_frame | high addresses
// +--------------------+ ------------------
// | ... |
class InterpreterFrame : public ZeroFrame {
friend class AbstractInterpreter;
private:
InterpreterFrame() : ZeroFrame() {
ShouldNotCallThis();
}
protected:
enum Layout {
istate_off = jf_header_words +
(align_size_up_(sizeof(BytecodeInterpreter),
wordSize) >> LogBytesPerWord) - 1,
header_words
};
public:
static InterpreterFrame *build(ZeroStack* stack,
const methodOop method,
JavaThread* thread);
static InterpreterFrame *build(ZeroStack* stack, int size);
public:
interpreterState interpreter_state() const {
return (interpreterState) addr_of_word(istate_off);
}
public:
void identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const;
};
#endif // CC_INTERP

View file

@ -1,12 +1,11 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,17 +20,18 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/
package com.sun.tools.internal.ws.wsdl.framework;
import javax.xml.namespace.QName;
/**
* An action operating on an entity reference composed of a kind and a QName.
* *
* @author WS Development Team
*/ */
public interface EntityReferenceAction {
public void perform(Kind kind, QName name); // Generation of Interpreter
} //
friend class AbstractInterpreterGenerator;
private:
address generate_normal_entry(bool synchronized);
address generate_native_entry(bool synchronized);
address generate_abstract_entry();
address generate_math_entry(AbstractInterpreter::MethodKind kind);
address generate_empty_entry();
address generate_accessor_entry();
address generate_method_handle_entry();

View file

@ -0,0 +1,162 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_interpreterRT_zero.cpp.incl"
void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_int() {
push(T_INT);
_cif->nargs++;
}
void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_long() {
push(T_LONG);
_cif->nargs++;
}
void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_float() {
push(T_FLOAT);
_cif->nargs++;
}
void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_double() {
push(T_DOUBLE);
_cif->nargs++;
}
void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_object() {
push(T_OBJECT);
_cif->nargs++;
}
void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) {
ffi_type *ftype;
switch (type) {
case T_VOID:
ftype = &ffi_type_void;
break;
case T_BOOLEAN:
ftype = &ffi_type_uint8;
break;
case T_CHAR:
ftype = &ffi_type_uint16;
break;
case T_BYTE:
ftype = &ffi_type_sint8;
break;
case T_SHORT:
ftype = &ffi_type_sint16;
break;
case T_INT:
ftype = &ffi_type_sint32;
break;
case T_LONG:
ftype = &ffi_type_sint64;
break;
case T_FLOAT:
ftype = &ffi_type_float;
break;
case T_DOUBLE:
ftype = &ffi_type_double;
break;
case T_OBJECT:
case T_ARRAY:
ftype = &ffi_type_pointer;
break;
default:
ShouldNotReachHere();
}
push((intptr_t) ftype);
}
// For fast signature handlers the "signature handler" is generated
// into a temporary buffer. It is then copied to its final location,
// and pd_set_handler is called on it. We have this two stage thing
// to accomodate this.
void InterpreterRuntime::SignatureHandlerGeneratorBase::generate(
uint64_t fingerprint) {
// Build the argument types list
pass_object();
if (method()->is_static())
pass_object();
iterate(fingerprint);
// Tack on the result type
push(method()->result_type());
}
void InterpreterRuntime::SignatureHandler::finalize() {
ffi_status status =
ffi_prep_cif(cif(),
FFI_DEFAULT_ABI,
argument_count(),
result_type(),
argument_types());
assert(status == FFI_OK, "should be");
}
IRT_ENTRY(address,
InterpreterRuntime::slow_signature_handler(JavaThread* thread,
methodOop method,
intptr_t* unused1,
intptr_t* unused2))
ZeroStack *stack = thread->zero_stack();
int required_words =
(align_size_up(sizeof(ffi_cif), wordSize) >> LogBytesPerWord) +
(method->is_static() ? 2 : 1) + method->size_of_parameters() + 1;
if (required_words > stack->available_words()) {
Unimplemented();
}
intptr_t *buf = (intptr_t *) stack->alloc(required_words * wordSize);
SlowSignatureHandlerGenerator sshg(methodHandle(thread, method), buf);
sshg.generate(UCONST64(-1));
SignatureHandler *handler = sshg.handler();
handler->finalize();
return (address) handler;
IRT_END
void SignatureHandlerLibrary::pd_set_handler(address handlerAddr) {
InterpreterRuntime::SignatureHandler *handler =
InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
handler->finalize();
}

View file

@ -0,0 +1,127 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
class SignatureHandler {
public:
static SignatureHandler *from_handlerAddr(address handlerAddr) {
return (SignatureHandler *) handlerAddr;
}
public:
ffi_cif* cif() const {
return (ffi_cif *) this;
}
int argument_count() const {
return cif()->nargs;
}
ffi_type** argument_types() const {
return (ffi_type**) (cif() + 1);
}
ffi_type* argument_type(int i) const {
return argument_types()[i];
}
ffi_type* result_type() const {
return *(argument_types() + argument_count());
}
protected:
friend class InterpreterRuntime;
friend class SignatureHandlerLibrary;
void finalize();
};
class SignatureHandlerGeneratorBase : public NativeSignatureIterator {
private:
ffi_cif* _cif;
protected:
SignatureHandlerGeneratorBase(methodHandle method, ffi_cif *cif)
: NativeSignatureIterator(method), _cif(cif) {
_cif->nargs = 0;
}
ffi_cif *cif() const {
return _cif;
}
public:
void generate(uint64_t fingerprint);
private:
void pass_int();
void pass_long();
void pass_float();
void pass_double();
void pass_object();
private:
void push(BasicType type);
virtual void push(intptr_t value) = 0;
};
class SignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
private:
CodeBuffer* _cb;
public:
SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer)
: SignatureHandlerGeneratorBase(method, (ffi_cif *) buffer->code_end()),
_cb(buffer) {
_cb->set_code_end((address) (cif() + 1));
}
private:
void push(intptr_t value) {
intptr_t *dst = (intptr_t *) _cb->code_end();
_cb->set_code_end((address) (dst + 1));
*dst = value;
}
};
class SlowSignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
private:
intptr_t *_dst;
public:
SlowSignatureHandlerGenerator(methodHandle method, intptr_t* buf)
: SignatureHandlerGeneratorBase(method, (ffi_cif *) buf) {
_dst = (intptr_t *) (cif() + 1);
}
private:
void push(intptr_t value) {
*(_dst++) = value;
}
public:
SignatureHandler *handler() const {
return (SignatureHandler *) cif();
}
};

View file

@ -0,0 +1,70 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_interpreter_zero.cpp.incl"
address AbstractInterpreterGenerator::generate_slow_signature_handler() {
_masm->advance(1);
return (address) InterpreterRuntime::slow_signature_handler;
}
address InterpreterGenerator::generate_math_entry(
AbstractInterpreter::MethodKind kind) {
if (!InlineIntrinsics)
return NULL;
Unimplemented();
}
address InterpreterGenerator::generate_abstract_entry() {
return ShouldNotCallThisEntry();
}
address InterpreterGenerator::generate_method_handle_entry() {
return ShouldNotCallThisEntry();
}
int AbstractInterpreter::size_activation(methodOop method,
int tempcount,
int popframe_extra_args,
int moncount,
int callee_param_count,
int callee_locals,
bool is_top_frame) {
return layout_activation(method,
tempcount,
popframe_extra_args,
moncount,
callee_param_count,
callee_locals,
(frame*) NULL,
(frame*) NULL,
is_top_frame);
}
void Deoptimization::unwind_callee_save_values(frame* f,
vframeArray* vframe_array) {
}

View file

@ -0,0 +1,61 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
public:
static void invoke_method(methodOop method, address entry_point, TRAPS) {
((ZeroEntry *) entry_point)->invoke(method, THREAD);
}
static void invoke_osr(methodOop method,
address entry_point,
address osr_buf,
TRAPS) {
((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD);
}
public:
static int expr_index_at(int i) {
return stackElementWords() * i;
}
static int expr_tag_index_at(int i) {
assert(TaggedStackInterpreter, "should not call this");
Unimplemented();
}
static int expr_offset_in_bytes(int i) {
return stackElementSize() * i;
}
static int expr_tag_offset_in_bytes(int i) {
assert(TaggedStackInterpreter, "should not call this");
Unimplemented();
}
static int local_index_at(int i) {
assert(i <= 0, "local direction already negated");
return stackElementWords() * i + (value_offset_in_bytes() / wordSize);
}
static int local_tag_index_at(int i) {
assert(TaggedStackInterpreter, "should not call this");
Unimplemented();
}

View file

@ -0,0 +1,72 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
public:
// Each arch must define reset, save, restore
// These are used by objects that only care about:
// 1 - initializing a new state (thread creation, javaCalls)
// 2 - saving a current state (javaCalls)
// 3 - restoring an old state (javaCalls)
void clear() {
// clearing _last_Java_sp must be first
_last_Java_sp = NULL;
// fence?
_last_Java_pc = NULL;
}
void copy(JavaFrameAnchor* src) {
// In order to make sure the transition state is valid for "this"
// We must clear _last_Java_sp before copying the rest of the new
// data
//
// Hack Alert: Temporary bugfix for 4717480/4721647 To act like
// previous version (pd_cache_state) don't NULL _last_Java_sp
// unless the value is changing
//
if (_last_Java_sp != src->_last_Java_sp)
_last_Java_sp = NULL;
_last_Java_pc = src->_last_Java_pc;
// Must be last so profiler will always see valid frame if
// has_last_frame() is true
_last_Java_sp = src->_last_Java_sp;
}
bool walkable() {
return true;
}
void make_walkable(JavaThread* thread) {
// nothing to do
}
intptr_t* last_Java_sp() const {
return _last_Java_sp;
}
void set_last_Java_sp(intptr_t* sp) {
_last_Java_sp = sp;
}

View file

@ -0,0 +1,59 @@
/*
* Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_jniFastGetField_zero.cpp.incl"
address JNI_FastGetField::generate_fast_get_boolean_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_byte_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_char_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_short_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_int_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_long_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_float_field() {
return (address) -1;
}
address JNI_FastGetField::generate_fast_get_double_field() {
return (address) -1;
}

View file

@ -0,0 +1,108 @@
/*
* Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file holds platform-dependent routines used to write primitive jni
// types to the array of arguments passed into JavaCalls::call
class JNITypes : AllStatic {
// These functions write a java primitive type (in native format)
// to a java stack slot array to be passed as an argument to JavaCalls:calls.
// I.e., they are functionally 'push' operations if they have a 'pos'
// formal parameter. Note that jlong's and jdouble's are written
// _in reverse_ of the order in which they appear in the interpreter
// stack. This is because call stubs (see stubGenerator_zero.cpp)
// reverse the argument list constructed by JavaCallArguments (see
// javaCalls.hpp).
private:
// Helper routines.
static inline void put_int2 (jint *from, jint *to) { to[0] = from[0]; to[1] = from[1]; }
static inline void put_int2 (jint *from, jint *to, int& pos) { put_int2 (from, (jint *)((intptr_t *)to + pos)); pos += 2; }
static inline void put_int2r(jint *from, jint *to) { to[0] = from[1]; to[1] = from[0]; }
static inline void put_int2r(jint *from, jint *to, int& pos) { put_int2r(from, (jint *)((intptr_t *)to + pos)); pos += 2; }
public:
// Ints are stored in native format in one JavaCallArgument slot at *to.
static inline void put_int(jint from, intptr_t *to) { *(jint *)(to + 0 ) = from; }
static inline void put_int(jint from, intptr_t *to, int& pos) { *(jint *)(to + pos++) = from; }
static inline void put_int(jint *from, intptr_t *to, int& pos) { *(jint *)(to + pos++) = *from; }
#ifdef _LP64
// Longs are stored in native format in one JavaCallArgument slot at *(to+1).
static inline void put_long(jlong from, intptr_t *to) { *(jlong *)(to + 1 + 0) = from; }
static inline void put_long(jlong from, intptr_t *to, int& pos) { *(jlong *)(to + 1 + pos) = from; pos += 2; }
static inline void put_long(jlong *from, intptr_t *to, int& pos) { *(jlong *)(to + 1 + pos) = *from; pos += 2; }
#else
// Longs are stored in reversed native word format in two JavaCallArgument slots at *to.
// The high half is in *(to+1) and the low half in *to.
static inline void put_long(jlong from, intptr_t *to) { put_int2r((jint *)&from, (jint *)to); }
static inline void put_long(jlong from, intptr_t *to, int& pos) { put_int2r((jint *)&from, (jint *)to, pos); }
static inline void put_long(jlong *from, intptr_t *to, int& pos) { put_int2r((jint *) from, (jint *)to, pos); }
#endif
// Oops are stored in native format in one JavaCallArgument slot at *to.
static inline void put_obj(oop from, intptr_t *to) { *(oop *)(to + 0 ) = from; }
static inline void put_obj(oop from, intptr_t *to, int& pos) { *(oop *)(to + pos++) = from; }
static inline void put_obj(oop *from, intptr_t *to, int& pos) { *(oop *)(to + pos++) = *from; }
// Floats are stored in native format in one JavaCallArgument slot at *to.
static inline void put_float(jfloat from, intptr_t *to) { *(jfloat *)(to + 0 ) = from; }
static inline void put_float(jfloat from, intptr_t *to, int& pos) { *(jfloat *)(to + pos++) = from; }
static inline void put_float(jfloat *from, intptr_t *to, int& pos) { *(jfloat *)(to + pos++) = *from; }
#ifdef _LP64
// Doubles are stored in native word format in one JavaCallArgument slot at *(to+1).
static inline void put_double(jdouble from, intptr_t *to) { *(jdouble *)(to + 1 + 0) = from; }
static inline void put_double(jdouble from, intptr_t *to, int& pos) { *(jdouble *)(to + 1 + pos) = from; pos += 2; }
static inline void put_double(jdouble *from, intptr_t *to, int& pos) { *(jdouble *)(to + 1 + pos) = *from; pos += 2; }
#else
// Doubles are stored in reversed native word format in two JavaCallArgument slots at *to.
static inline void put_double(jdouble from, intptr_t *to) { put_int2r((jint *)&from, (jint *)to); }
static inline void put_double(jdouble from, intptr_t *to, int& pos) { put_int2r((jint *)&from, (jint *)to, pos); }
static inline void put_double(jdouble *from, intptr_t *to, int& pos) { put_int2r((jint *) from, (jint *)to, pos); }
#endif
// The get_xxx routines, on the other hand, actually _do_ fetch
// java primitive types from the interpreter stack.
static inline jint get_int(intptr_t *from) { return *(jint *)from; }
#ifdef _LP64
static inline jlong get_long(intptr_t *from) { return *(jlong *)from; }
#else
static inline jlong get_long(intptr_t *from) { return ((jlong)(*( signed int *)((jint *)from )) << 32) |
((jlong)(*(unsigned int *)((jint *)from + 1)) << 0); }
#endif
static inline oop get_obj(intptr_t *from) { return *(oop *)from; }
static inline jfloat get_float(intptr_t *from) { return *(jfloat *)from; }
#ifdef _LP64
static inline jdouble get_double(intptr_t *from) { return *(jdouble *)from; }
#else
static inline jdouble get_double(intptr_t *from) { jlong jl = ((jlong)(*( signed int *)((jint *)from )) << 32) |
((jlong)(*(unsigned int *)((jint *)from + 1)) << 0);
return *(jdouble *)&jl; }
#endif
};

View file

@ -1,5 +1,6 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,13 +24,15 @@
* have any questions. * have any questions.
*/ */
package com.sun.xml.internal.bind.v2.runtime; #define JNIEXPORT
#define JNIIMPORT
#define JNICALL
/** typedef int jint;
* typedef signed char jbyte;
* @author snajper
*/
public interface AttributeAccessor<BeanT> {
public boolean isNilIncluded(); #ifdef _LP64
} typedef long jlong;
#else
typedef long long jlong;
#endif

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file is intentionally empty

View file

@ -0,0 +1,50 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_nativeInst_zero.cpp.incl"
// This method is called by nmethod::make_not_entrant_or_zombie to
// insert a jump to SharedRuntime::get_handle_wrong_method_stub()
// (dest) at the start of a compiled method (verified_entry) to avoid
// a race where a method is invoked while being made non-entrant.
//
// In Shark, verified_entry is a pointer to a SharkEntry. We can
// handle this simply by changing it's entry point to point at the
// interpreter. This only works because the interpreter and Shark
// calling conventions are the same.
void NativeJump::patch_verified_entry(address entry,
address verified_entry,
address dest) {
assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be");
#ifdef CC_INTERP
((ZeroEntry*) verified_entry)->set_entry_point(
(address) CppInterpreter::normal_entry);
#else
Unimplemented();
#endif // CC_INTERP
}

View file

@ -0,0 +1,185 @@
/*
* Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// We have interfaces for the following instructions:
// - NativeInstruction
// - - NativeCall
// - - NativeMovConstReg
// - - NativeMovConstRegPatching
// - - NativeJump
// - - NativeIllegalOpCode
// - - NativeReturn
// - - NativeReturnX (return with argument)
// - - NativePushConst
// - - NativeTstRegMem
// The base class for different kinds of native instruction abstractions.
// Provides the primitive operations to manipulate code relative to this.
class NativeInstruction VALUE_OBJ_CLASS_SPEC {
public:
bool is_jump() {
ShouldNotCallThis();
}
bool is_safepoint_poll() {
ShouldNotCallThis();
}
};
inline NativeInstruction* nativeInstruction_at(address address) {
ShouldNotCallThis();
}
class NativeCall : public NativeInstruction {
public:
enum zero_specific_constants {
instruction_size = 0 // not used within the interpreter
};
address instruction_address() const {
ShouldNotCallThis();
}
address next_instruction_address() const {
ShouldNotCallThis();
}
address return_address() const {
ShouldNotCallThis();
}
address destination() const {
ShouldNotCallThis();
}
void set_destination_mt_safe(address dest) {
ShouldNotCallThis();
}
void verify_alignment() {
ShouldNotCallThis();
}
void verify() {
ShouldNotCallThis();
}
static bool is_call_before(address return_address) {
ShouldNotCallThis();
}
};
inline NativeCall* nativeCall_before(address return_address) {
ShouldNotCallThis();
}
inline NativeCall* nativeCall_at(address address) {
ShouldNotCallThis();
}
class NativeMovConstReg : public NativeInstruction {
public:
address next_instruction_address() const {
ShouldNotCallThis();
}
intptr_t data() const {
ShouldNotCallThis();
}
void set_data(intptr_t x) {
ShouldNotCallThis();
}
};
inline NativeMovConstReg* nativeMovConstReg_at(address address) {
ShouldNotCallThis();
}
class NativeMovRegMem : public NativeInstruction {
public:
int offset() const {
ShouldNotCallThis();
}
void set_offset(intptr_t x) {
ShouldNotCallThis();
}
void add_offset_in_bytes(int add_offset) {
ShouldNotCallThis();
}
};
inline NativeMovRegMem* nativeMovRegMem_at(address address) {
ShouldNotCallThis();
}
class NativeJump : public NativeInstruction {
public:
enum zero_specific_constants {
instruction_size = 0 // not used within the interpreter
};
address jump_destination() const {
ShouldNotCallThis();
}
void set_jump_destination(address dest) {
ShouldNotCallThis();
}
static void check_verified_entry_alignment(address entry,
address verified_entry) {
}
static void patch_verified_entry(address entry,
address verified_entry,
address dest);
};
inline NativeJump* nativeJump_at(address address) {
ShouldNotCallThis();
}
class NativeGeneralJump : public NativeInstruction {
public:
address jump_destination() const {
ShouldNotCallThis();
}
static void insert_unconditional(address code_pos, address entry) {
ShouldNotCallThis();
}
static void replace_mt_safe(address instr_addr, address code_buffer) {
ShouldNotCallThis();
}
};
inline NativeGeneralJump* nativeGeneralJump_at(address address) {
ShouldNotCallThis();
}

View file

@ -1,12 +1,10 @@
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as * under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this * published by the Free Software Foundation.
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
* *
* This code is distributed in the hope that it will be useful, but WITHOUT * This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@ -21,25 +19,21 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/
package com.sun.tools.internal.xjc.generator.util;
import com.sun.codemodel.internal.JBlock;
/**
* *
* @author
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/ */
public class ExistingBlockReference implements BlockReference {
private final JBlock block;
public ExistingBlockReference( JBlock _block ) { // machine-dependent implemention for register maps
this.block = _block; friend class frame;
}
public JBlock get(boolean create) { private:
return block; // This is the hook for finding a register in an "well-known" location,
} // such as a register block of a predetermined format.
// Since there is none, we just return NULL.
// See registerMap_sparc.hpp for an example of grabbing registers
// from register save areas of a standard layout.
address pd_location(VMReg reg) const { return NULL; }
} // no PD state to clear or copy:
void pd_clear() {}
void pd_initialize() {}
void pd_initialize_from(const RegisterMap* map) {}

View file

@ -0,0 +1,26 @@
/*
* Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// This file is intentionally empty

View file

@ -0,0 +1,39 @@
/*
* Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_register_zero.cpp.incl"
const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers;
const int ConcreteRegisterImpl::max_fpr =
ConcreteRegisterImpl::max_gpr + FloatRegisterImpl::number_of_registers;
const char* RegisterImpl::name() const {
ShouldNotCallThis();
}
const char* FloatRegisterImpl::name() const {
ShouldNotCallThis();
}

View file

@ -0,0 +1,110 @@
/*
* Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
class VMRegImpl;
typedef VMRegImpl* VMReg;
// Use Register as shortcut
class RegisterImpl;
typedef RegisterImpl* Register;
inline Register as_Register(int encoding) {
return (Register)(intptr_t) encoding;
}
// The implementation of integer registers for the zero architecture
class RegisterImpl : public AbstractRegisterImpl {
public:
enum {
number_of_registers = 0
};
// construction
inline friend Register as_Register(int encoding);
VMReg as_VMReg();
// derived registers, offsets, and addresses
Register successor() const {
return as_Register(encoding() + 1);
}
// accessors
int encoding() const {
assert(is_valid(), "invalid register");
return (intptr_t)this;
}
bool is_valid() const {
return 0 <= (intptr_t) this && (intptr_t)this < number_of_registers;
}
const char* name() const;
};
// Use FloatRegister as shortcut
class FloatRegisterImpl;
typedef FloatRegisterImpl* FloatRegister;
inline FloatRegister as_FloatRegister(int encoding) {
return (FloatRegister)(intptr_t) encoding;
}
// The implementation of floating point registers for the zero architecture
class FloatRegisterImpl : public AbstractRegisterImpl {
public:
enum {
number_of_registers = 0
};
// construction
inline friend FloatRegister as_FloatRegister(int encoding);
VMReg as_VMReg();
// derived registers, offsets, and addresses
FloatRegister successor() const {
return as_FloatRegister(encoding() + 1);
}
// accessors
int encoding() const {
assert(is_valid(), "invalid register");
return (intptr_t)this;
}
bool is_valid() const {
return 0 <= (intptr_t) this && (intptr_t)this < number_of_registers;
}
const char* name() const;
};
class ConcreteRegisterImpl : public AbstractRegisterImpl {
public:
enum {
number_of_registers = RegisterImpl::number_of_registers +
FloatRegisterImpl::number_of_registers
};
static const int max_gpr;
static const int max_fpr;
};
CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));

View file

@ -0,0 +1,74 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_relocInfo_zero.cpp.incl"
void Relocation::pd_set_data_value(address x, intptr_t o) {
ShouldNotCallThis();
}
address Relocation::pd_call_destination(address orig_addr) {
ShouldNotCallThis();
}
void Relocation::pd_set_call_destination(address x) {
ShouldNotCallThis();
}
address Relocation::pd_get_address_from_code() {
ShouldNotCallThis();
}
address* Relocation::pd_address_in_code() {
// Relocations in Shark are just stored directly
return (address *) addr();
}
int Relocation::pd_breakpoint_size() {
ShouldNotCallThis();
}
void Relocation::pd_swap_in_breakpoint(address x,
short* instrs,
int instrlen) {
ShouldNotCallThis();
}
void Relocation::pd_swap_out_breakpoint(address x,
short* instrs,
int instrlen) {
ShouldNotCallThis();
}
void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src,
CodeBuffer* dst) {
ShouldNotCallThis();
}
void poll_return_Relocation::fix_relocation_after_move(const CodeBuffer* src,
CodeBuffer* dst) {
ShouldNotCallThis();
}

View file

@ -0,0 +1,32 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// machine-dependent parts of class relocInfo
private:
enum {
// these constants mean nothing without an assembler
offset_unit = 1,
format_width = 1
};

View file

@ -0,0 +1,108 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_sharedRuntime_zero.cpp.incl"
DeoptimizationBlob *SharedRuntime::_deopt_blob;
SafepointBlob *SharedRuntime::_polling_page_safepoint_handler_blob;
SafepointBlob *SharedRuntime::_polling_page_return_handler_blob;
RuntimeStub *SharedRuntime::_wrong_method_blob;
RuntimeStub *SharedRuntime::_ic_miss_blob;
RuntimeStub *SharedRuntime::_resolve_opt_virtual_call_blob;
RuntimeStub *SharedRuntime::_resolve_virtual_call_blob;
RuntimeStub *SharedRuntime::_resolve_static_call_blob;
int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
VMRegPair *regs,
int total_args_passed,
int is_outgoing) {
return 0;
}
AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(
MacroAssembler *masm,
int total_args_passed,
int comp_args_on_stack,
const BasicType *sig_bt,
const VMRegPair *regs) {
return new AdapterHandlerEntry(
ShouldNotCallThisStub(),
ShouldNotCallThisStub(),
ShouldNotCallThisStub());
}
nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
methodHandle method,
int total_in_args,
int comp_args_on_stack,
BasicType *in_sig_bt,
VMRegPair *in_regs,
BasicType ret_type) {
ShouldNotCallThis();
}
int Deoptimization::last_frame_adjust(int callee_parameters,
int callee_locals) {
return 0;
}
uint SharedRuntime::out_preserve_stack_slots() {
ShouldNotCallThis();
}
static RuntimeStub* generate_empty_runtime_stub(const char* name) {
CodeBuffer buffer(name, 0, 0);
return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false);
}
static SafepointBlob* generate_empty_safepoint_blob() {
CodeBuffer buffer("handler_blob", 0, 0);
return SafepointBlob::create(&buffer, NULL, 0);
}
void SharedRuntime::generate_stubs() {
_wrong_method_blob =
generate_empty_runtime_stub("wrong_method_stub");
_ic_miss_blob =
generate_empty_runtime_stub("ic_miss_stub");
_resolve_opt_virtual_call_blob =
generate_empty_runtime_stub("resolve_opt_virtual_call");
_resolve_virtual_call_blob =
generate_empty_runtime_stub("resolve_virtual_call");
_resolve_static_call_blob =
generate_empty_runtime_stub("resolve_static_call");
_polling_page_safepoint_handler_blob =
generate_empty_safepoint_blob();
_polling_page_return_handler_blob =
generate_empty_safepoint_blob();
}
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
VMRegPair *regs,
int total_args_passed) {
ShouldNotCallThis();
}

View file

@ -0,0 +1,79 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// | ... |
// +--------------------+ ------------------
// | stack slot n-1 | low addresses
// | ... |
// | stack slot 0 |
// | monitor m-1 |
// | ... |
// | monitor 0 |
// | oop_tmp |
// | method |
// | unextended_sp |
// | pc |
// | frame_type |
// | next_frame | high addresses
// +--------------------+ ------------------
// | ... |
class SharkFrame : public ZeroFrame {
friend class SharkFunction;
private:
SharkFrame() : ZeroFrame() {
ShouldNotCallThis();
}
protected:
enum Layout {
pc_off = jf_header_words,
unextended_sp_off,
method_off,
oop_tmp_off,
header_words
};
public:
address pc() const {
return (address) value_of_word(pc_off);
}
intptr_t* unextended_sp() const {
return (intptr_t *) value_of_word(unextended_sp_off);
}
methodOop method() const {
return (methodOop) value_of_word(method_off);
}
public:
void identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const;
};

View file

@ -0,0 +1,197 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
class ZeroStack {
private:
intptr_t *_base; // the last available word
intptr_t *_top; // the word past the end of the stack
intptr_t *_sp; // the top word on the stack
public:
ZeroStack()
: _base(NULL), _top(NULL), _sp(NULL) {}
bool needs_setup() const {
return _base == NULL;
}
void setup(void *mem, size_t size) {
assert(needs_setup(), "already set up");
assert(!(size & WordAlignmentMask), "unaligned");
_base = (intptr_t *) mem;
_top = _base + (size >> LogBytesPerWord);
_sp = _top;
}
void teardown() {
assert(!needs_setup(), "not set up");
assert(_sp == _top, "stuff on stack at teardown");
_base = NULL;
_top = NULL;
_sp = NULL;
}
intptr_t *sp() const {
return _sp;
}
void set_sp(intptr_t *new_sp) {
assert(_top >= new_sp && new_sp >= _base, "bad stack pointer");
_sp = new_sp;
}
int available_words() const {
return _sp - _base;
}
void push(intptr_t value) {
assert(_sp > _base, "stack overflow");
*(--_sp) = value;
}
intptr_t pop() {
assert(_sp < _top, "stack underflow");
return *(_sp++);
}
void *alloc(size_t size) {
int count = align_size_up(size, wordSize) >> LogBytesPerWord;
assert(count <= available_words(), "stack overflow");
return _sp -= count;
}
public:
static ByteSize base_offset() {
return byte_offset_of(ZeroStack, _base);
}
static ByteSize top_offset() {
return byte_offset_of(ZeroStack, _top);
}
static ByteSize sp_offset() {
return byte_offset_of(ZeroStack, _sp);
}
};
class EntryFrame;
class InterpreterFrame;
class SharkFrame;
class FakeStubFrame;
//
// | ... |
// +--------------------+ ------------------
// | ... | low addresses
// | frame_type |
// | next_frame | high addresses
// +--------------------+ ------------------
// | ... |
class ZeroFrame {
friend class frame;
friend class ZeroStackPrinter;
protected:
ZeroFrame() {
ShouldNotCallThis();
}
enum Layout {
next_frame_off,
frame_type_off,
jf_header_words
};
enum FrameType {
ENTRY_FRAME = 1,
INTERPRETER_FRAME,
SHARK_FRAME,
FAKE_STUB_FRAME
};
protected:
intptr_t *addr_of_word(int offset) const {
return (intptr_t *) this - offset;
}
intptr_t value_of_word(int offset) const {
return *addr_of_word(offset);
}
public:
ZeroFrame *next() const {
return (ZeroFrame *) value_of_word(next_frame_off);
}
protected:
FrameType type() const {
return (FrameType) value_of_word(frame_type_off);
}
public:
bool is_entry_frame() const {
return type() == ENTRY_FRAME;
}
bool is_interpreter_frame() const {
return type() == INTERPRETER_FRAME;
}
bool is_shark_frame() const {
return type() == SHARK_FRAME;
}
bool is_fake_stub_frame() const {
return type() == FAKE_STUB_FRAME;
}
public:
EntryFrame *as_entry_frame() const {
assert(is_entry_frame(), "should be");
return (EntryFrame *) this;
}
InterpreterFrame *as_interpreter_frame() const {
assert(is_interpreter_frame(), "should be");
return (InterpreterFrame *) this;
}
SharkFrame *as_shark_frame() const {
assert(is_shark_frame(), "should be");
return (SharkFrame *) this;
}
FakeStubFrame *as_fake_stub_frame() const {
assert(is_fake_stub_frame(), "should be");
return (FakeStubFrame *) this;
}
public:
void identify_word(int frame_index,
int offset,
char* fieldbuf,
char* valuebuf,
int buflen) const;
protected:
void identify_vp_word(int frame_index,
intptr_t* addr,
intptr_t* monitor_base,
intptr_t* stack_base,
char* fieldbuf,
int buflen) const;
};

View file

@ -0,0 +1,251 @@
/*
* Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_stubGenerator_zero.cpp.incl"
// Declaration and definition of StubGenerator (no .hpp file).
// For a more detailed description of the stub routine structure
// see the comment in stubRoutines.hpp
class StubGenerator: public StubCodeGenerator {
private:
// The call stub is used to call Java from C
static void call_stub(
JavaCallWrapper *call_wrapper,
intptr_t* result,
BasicType result_type,
methodOop method,
address entry_point,
intptr_t* parameters,
int parameter_words,
TRAPS) {
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
// Make sure we have no pending exceptions
assert(!HAS_PENDING_EXCEPTION, "call_stub called with pending exception");
// Set up the stack if necessary
bool stack_needs_teardown = false;
if (stack->needs_setup()) {
size_t stack_used = thread->stack_base() - (address) &stack_used;
size_t stack_free = thread->stack_size() - stack_used;
size_t zero_stack_size = align_size_down(stack_free / 2, wordSize);
stack->setup(alloca(zero_stack_size), zero_stack_size);
stack_needs_teardown = true;
}
// Allocate and initialize our frame
thread->push_zero_frame(
EntryFrame::build(stack, parameters, parameter_words, call_wrapper));
// Make the call
Interpreter::invoke_method(method, entry_point, THREAD);
// Store result depending on type
if (!HAS_PENDING_EXCEPTION) {
switch (result_type) {
case T_INT:
*(jint *) result = *(jint *) stack->sp();
break;
case T_LONG:
*(jlong *) result = *(jlong *) stack->sp();
break;
case T_FLOAT:
*(jfloat *) result = *(jfloat *) stack->sp();
break;
case T_DOUBLE:
*(jdouble *) result = *(jdouble *) stack->sp();
break;
case T_OBJECT:
*(oop *) result = *(oop *) stack->sp();
break;
default:
ShouldNotReachHere();
}
}
// Unwind our frame
thread->pop_zero_frame();
// Tear down the stack if necessary
if (stack_needs_teardown)
stack->teardown();
}
// These stubs get called from some dumb test routine.
// I'll write them properly when they're called from
// something that's actually doing something.
static void fake_arraycopy_stub(address src, address dst, int count) {
assert(count == 0, "huh?");
}
void generate_arraycopy_stubs() {
// Call the conjoint generation methods immediately after
// the disjoint ones so that short branches from the former
// to the latter can be generated.
StubRoutines::_jbyte_disjoint_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jbyte_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jshort_disjoint_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jshort_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jint_disjoint_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jint_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jlong_disjoint_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_jlong_arraycopy = (address) fake_arraycopy_stub;
StubRoutines::_oop_disjoint_arraycopy = ShouldNotCallThisStub();
StubRoutines::_oop_arraycopy = ShouldNotCallThisStub();
StubRoutines::_checkcast_arraycopy = ShouldNotCallThisStub();
StubRoutines::_unsafe_arraycopy = ShouldNotCallThisStub();
StubRoutines::_generic_arraycopy = ShouldNotCallThisStub();
// We don't generate specialized code for HeapWord-aligned source
// arrays, so just use the code we've already generated
StubRoutines::_arrayof_jbyte_disjoint_arraycopy =
StubRoutines::_jbyte_disjoint_arraycopy;
StubRoutines::_arrayof_jbyte_arraycopy =
StubRoutines::_jbyte_arraycopy;
StubRoutines::_arrayof_jshort_disjoint_arraycopy =
StubRoutines::_jshort_disjoint_arraycopy;
StubRoutines::_arrayof_jshort_arraycopy =
StubRoutines::_jshort_arraycopy;
StubRoutines::_arrayof_jint_disjoint_arraycopy =
StubRoutines::_jint_disjoint_arraycopy;
StubRoutines::_arrayof_jint_arraycopy =
StubRoutines::_jint_arraycopy;
StubRoutines::_arrayof_jlong_disjoint_arraycopy =
StubRoutines::_jlong_disjoint_arraycopy;
StubRoutines::_arrayof_jlong_arraycopy =
StubRoutines::_jlong_arraycopy;
StubRoutines::_arrayof_oop_disjoint_arraycopy =
StubRoutines::_oop_disjoint_arraycopy;
StubRoutines::_arrayof_oop_arraycopy =
StubRoutines::_oop_arraycopy;
}
void generate_initial() {
// Generates all stubs and initializes the entry points
// entry points that exist in all platforms Note: This is code
// that could be shared among different platforms - however the
// benefit seems to be smaller than the disadvantage of having a
// much more complicated generator structure. See also comment in
// stubRoutines.hpp.
StubRoutines::_forward_exception_entry = ShouldNotCallThisStub();
StubRoutines::_call_stub_entry = (address) call_stub;
StubRoutines::_catch_exception_entry = ShouldNotCallThisStub();
// atomic calls
StubRoutines::_atomic_xchg_entry = ShouldNotCallThisStub();
StubRoutines::_atomic_xchg_ptr_entry = ShouldNotCallThisStub();
StubRoutines::_atomic_cmpxchg_entry = ShouldNotCallThisStub();
StubRoutines::_atomic_cmpxchg_ptr_entry = ShouldNotCallThisStub();
StubRoutines::_atomic_cmpxchg_long_entry = ShouldNotCallThisStub();
StubRoutines::_atomic_add_entry = ShouldNotCallThisStub();
StubRoutines::_atomic_add_ptr_entry = ShouldNotCallThisStub();
StubRoutines::_fence_entry = ShouldNotCallThisStub();
// amd64 does this here, sparc does it in generate_all()
StubRoutines::_handler_for_unsafe_access_entry =
ShouldNotCallThisStub();
}
void generate_all() {
// Generates all stubs and initializes the entry points
// These entry points require SharedInfo::stack0 to be set up in
// non-core builds and need to be relocatable, so they each
// fabricate a RuntimeStub internally.
StubRoutines::_throw_AbstractMethodError_entry =
ShouldNotCallThisStub();
StubRoutines::_throw_ArithmeticException_entry =
ShouldNotCallThisStub();
StubRoutines::_throw_NullPointerException_entry =
ShouldNotCallThisStub();
StubRoutines::_throw_NullPointerException_at_call_entry =
ShouldNotCallThisStub();
StubRoutines::_throw_StackOverflowError_entry =
ShouldNotCallThisStub();
// support for verify_oop (must happen after universe_init)
StubRoutines::_verify_oop_subroutine_entry =
ShouldNotCallThisStub();
// arraycopy stubs used by compilers
generate_arraycopy_stubs();
}
public:
StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) {
if (all) {
generate_all();
} else {
generate_initial();
}
}
};
void StubGenerator_generate(CodeBuffer* code, bool all) {
StubGenerator g(code, all);
}
EntryFrame *EntryFrame::build(ZeroStack* stack,
const intptr_t* parameters,
int parameter_words,
JavaCallWrapper* call_wrapper) {
if (header_words + parameter_words > stack->available_words()) {
Unimplemented();
}
stack->push(0); // next_frame, filled in later
intptr_t *fp = stack->sp();
assert(fp - stack->sp() == next_frame_off, "should be");
stack->push(ENTRY_FRAME);
assert(fp - stack->sp() == frame_type_off, "should be");
stack->push((intptr_t) call_wrapper);
assert(fp - stack->sp() == call_wrapper_off, "should be");
for (int i = 0; i < parameter_words; i++)
stack->push(parameters[i]);
return (EntryFrame *) fp;
}

View file

@ -0,0 +1,31 @@
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008, 2009 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_stubRoutines_zero.cpp.incl"
#ifdef IA32
address StubRoutines::x86::_call_stub_compiled_return = NULL;
#endif // IA32

View file

@ -1,5 +1,6 @@
/* /*
* Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2007, 2008, 2009 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -19,24 +20,32 @@
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*
*/ */
package localizable; // This file holds the platform specific parts of the StubRoutines
// definition. See stubRoutines.hpp for a description on how to
// extend it.
import java.util.ListResourceBundle; public:
import static localizable.WhatsitMBean.*; static address call_stub_return_pc() {
return (address) -1;
public class MBeanDescriptions_fr extends ListResourceBundle {
@Override
protected Object[][] getContents() {
String constrProp = "WhatsitMBean.constructor." + Whatsit.class.getName();
return new Object[][] {
{"WhatsitMBean.mbean", frenchMBeanDescription},
{"WhatsitMBean.attribute.Whatsit", frenchAttrDescription},
{"WhatsitMBean.operation.frob", frenchOperDescription},
{"WhatsitMBean.operation.frob.p1", frenchParamDescription},
{constrProp, frenchConstrDescription},
{constrProp + ".p1", frenchConstrParamDescription},
};
} }
}
static bool returns_to_call_stub(address return_pc) {
return return_pc == call_stub_return_pc();
}
enum platform_dependent_constants {
code_size1 = 0, // The assembler will fail with a guarantee
code_size2 = 0 // if these are too small. Simply increase
}; // them if that happens.
#ifdef IA32
class x86 {
friend class VMStructs;
private:
static address _call_stub_compiled_return;
};
#endif // IA32

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