This commit is contained in:
Lana Steuck 2011-02-11 12:14:38 -08:00
commit 3eb4164d84
803 changed files with 18719 additions and 26344 deletions

View File

@ -100,3 +100,6 @@ a4e6aa1f45ad23a6f083ed98d970b5006ea4d292 jdk7-b116
142129d8599d1f56b29387e7f9a5fad53b6d61df jdk7-b123
aa894c225b1a517b665ac2a58295217ea2245134 jdk7-b124
f658ec2730fa29323c36d23c27e54c7219ef5e16 jdk7-b125
f1df068076986679ea1105532a65529d63a89060 jdk7-b126
f83cd8bd35c678f94e526990e03dc838d0ec2717 jdk7-b127
7da3f5f30855dec6bf3a86529e87dee883b90c72 jdk7-b128

View File

@ -100,3 +100,6 @@ f1591eed71f64f6eba79fb7426f5616cc4dfea73 jdk7-b122
ed6950da30cf1e8904b4bdb034d471647942271f jdk7-b123
024a6755895bf91b5a3c98984c89ee018efbf538 jdk7-b124
5c4df7e992775c102f08e9f1c0a124b324641b70 jdk7-b125
b566d490905691787f8931f69947a92c67c6d5e4 jdk7-b126
bd70f76b0309068f157ae759c36eac8f2c6d098e jdk7-b127
57d702105b23fb90e40beaf00f8f8aeae5e249e7 jdk7-b128

View File

@ -29,15 +29,6 @@ ifndef TOPDIR
TOPDIR:=.
endif
# Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
OPENJDK_SOURCETREE=$(TOPDIR)/openjdk
OPENJDK_BUILDDIR:=$(shell \
if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
echo "$(OPENJDK_SOURCETREE)"; \
else \
echo "."; \
fi)
ifndef JDK_TOPDIR
JDK_TOPDIR=$(TOPDIR)/jdk
endif
@ -70,7 +61,7 @@ include ./make/deploy-rules.gmk
all::
@$(START_ECHO)
all:: openjdk_check sanity
all:: sanity
ifeq ($(SKIP_FASTDEBUG_BUILD), false)
all:: fastdebug_build
@ -80,10 +71,6 @@ ifeq ($(SKIP_DEBUG_BUILD), false)
all:: debug_build
endif
ifneq ($(SKIP_OPENJDK_BUILD), true)
all:: openjdk_build
endif
all:: all_product_build
all::
@ -267,81 +254,6 @@ product_build:: build_product_image
debug_build:: build_debug_image
fastdebug_build:: build_fastdebug_image
# Check on whether we really can build the openjdk, need source etc.
openjdk_check: FRC
ifneq ($(SKIP_OPENJDK_BUILD), true)
@$(ECHO) " "
@$(ECHO) "================================================="
@if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
$(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
exit 1; \
else \
$(ECHO) "OpenJDK will be built after JDK is built"; \
$(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
fi
@$(ECHO) "================================================="
@$(ECHO) " "
endif
# If we have bundle rules, we have a chance here to do a complete cycle
# build, of production and open build.
# FIXUP: We should create the openjdk source bundle and build that?
# But how do we reliable create or get at a formal openjdk source tree?
# The one we have needs to be trimmed of built bits and closed dirs.
# The repositories might not be available.
# The openjdk source bundle is probably not available.
ifneq ($(SKIP_OPENJDK_BUILD), true)
ifeq ($(BUILD_JDK), true)
ifeq ($(BUNDLE_RULES_AVAILABLE), true)
OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output
OPENJDK_BUILD_NAME \
= openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
OPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
BUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image
ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
OPENJDK_BOOTDIR=$(BOOTDIR)
OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH)
else
OPENJDK_BOOTDIR=$(BUILT_IMAGE)
OPENJDK_IMPORTJDK=$(BUILT_IMAGE)
endif
openjdk_build:
@$(START_ECHO)
@$(ECHO) " "
@$(ECHO) "================================================="
@$(ECHO) "Starting openjdk build"
@$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
@$(ECHO) "================================================="
@$(ECHO) " "
$(RM) -r $(OPENJDK_OUTPUTDIR)
$(MKDIR) -p $(OPENJDK_OUTPUTDIR)
($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \
OPENJDK=true \
GENERATE_DOCS=false \
ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \
ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \
ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
product_build )
$(RM) $(OPENJDK_BUILD_BINARY_ZIP)
( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
$(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
$(RM) -r $(OPENJDK_OUTPUTDIR)
@$(ECHO) " "
@$(ECHO) "================================================="
@$(ECHO) "Finished openjdk build"
@$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
@$(ECHO) "================================================="
@$(ECHO) " "
@$(FINISH_ECHO)
endif
endif
endif
clobber::
$(RM) -r $(OUTPUTDIR)/*
$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
@ -448,7 +360,6 @@ CACERTS_FILE.desc = Location of certificates file
DEVTOOLS_PATH.desc = Directory containing zip and gnumake
CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
DXSDK_PATH.desc = Root directory of DirectX SDK
MSVCRT_DLL_PATH.desc = Directory containing mscvrt.dll
# Make variables to print out (description and value)
VARIABLE_PRINTVAL_LIST += \
@ -477,12 +388,10 @@ VARIABLE_CHECKFIL_LIST += \
ifeq ($(PLATFORM), windows)
VARIABLE_PRINTVAL_LIST += \
DXSDK_PATH \
MSVCRT_DLL_PATH
DXSDK_PATH
VARIABLE_CHECKDIR_LIST += \
DXSDK_PATH \
MSVCRT_DLL_PATH
DXSDK_PATH
endif

View File

@ -921,7 +921,7 @@
<!-- ------------------------------------------------------ -->
<h4><a name="ant">Ant</a></h4>
<blockquote>
All OpenJDK builds require access to least Ant 1.6.5.
All OpenJDK builds require access to least Ant 1.7.1.
The Ant tool is available from the
<a href="http://ant.apache.org" target="_blank">
Ant download site</a>.
@ -1414,14 +1414,14 @@
but it's normally found via the DirectX environment variable
<tt>DXSDK_DIR</tt>.
</blockquote>
<strong><a name="msvcrt"><tt>MSVCR100.DLL</tt></a></strong>
<strong><a name="msvcrNN"><tt>MSVCR100.DLL</tt></a></strong>
<blockquote>
The OpenJDK build requires access to a redistributable
<tt>MSVCR100.DLL</tt>.
This is usually picked up automatically from the redist
directories of Visual Studio 2010.
If this cannot be found set the
<a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
<a href="#ALT_MSVCRNN_DLL_PATH"><tt>ALT_MSVCRNN_DLL_PATH</tt></a>
variable to the location of this file.
<p>
</blockquote>
@ -1671,15 +1671,10 @@
variable <tt>DXSDK_DIR</tt>,
failing that, look in <tt>C:/DXSDK</tt>.
</dd>
<dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt>
<dd>
The location of the
<a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>.
</dd>
<dt><tt><a name="ALT_MSVCRNN_DLL_PATH">ALT_MSVCRNN_DLL_PATH</a></tt> </dt>
<dd>
The location of the
<a href="#msvcrt"><tt>MSVCR100.DLL</tt></a>.
<a href="#msvcrNN"><tt>MSVCR100.DLL</tt></a>.
</dd>
</dl>
</dd>

View File

@ -100,3 +100,6 @@ cff5a173ec1e89013359e804a3e31736ef6fb462 jdk7-b120
a230c142628cea22475ab9dc5cd544266ddf2466 jdk7-b123
f90b3e014e831eb4f32ef035a1dad2b8ba87949f jdk7-b124
1ce58c72b7892cb813eb920276c7e7f17a1b79fe jdk7-b125
d7532bcd3742f1576dd07ff9fbb535c9c9a276e9 jdk7-b126
64775e83f4df894355f45555f50c410de6727b4e jdk7-b127
9baa8f94a11d6c5cab3f9f0e5a20106326d0932e jdk7-b128

View File

@ -1,5 +1,5 @@
;
; Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
;
; Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
;
; Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
;
; Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
;
; Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,6 +1,6 @@
;
; Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
;
; Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
;
; Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
; Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
;
; This code is free software; you can redistribute it and/or modify it

View File

@ -141,3 +141,8 @@ f5603a6e50422046ebc0d2f1671d55cb8f1bf1e9 jdk7-b120
0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 jdk7-b124
0a8e0d4345b37b71ec49dda08ee03b68c4f1b592 hs20-b05
e24ab3fa6aafad3efabbe7dba9918c5f461a20b1 jdk7-b125
4c851c931d001a882cab809aaf3a55371b919244 jdk7-b126
e24ab3fa6aafad3efabbe7dba9918c5f461a20b1 hs20-b06
d535bf4c12355a2897e918da9f8910c0aceec4fb hs20-b07
102466e70debc4b907afbd7624e34ddb1aafee9f jdk7-b127
9a5762f448595794d449a8e17342abd81a3fadaf jdk7-b128

View File

@ -428,6 +428,36 @@ public class CommandProcessor {
}
}
},
new Command("symbol", "symbol address", false) {
public void doit(Tokens t) {
if (t.countTokens() != 1) {
usage();
} else {
Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
Symbol.create(a).printValueOn(out);
out.println();
}
}
},
new Command("symboltable", "symboltable name", false) {
public void doit(Tokens t) {
if (t.countTokens() != 1) {
usage();
} else {
out.println(SymbolTable.getTheTable().probe(t.nextToken()));
}
}
},
new Command("symboldump", "symboldump", false) {
public void doit(Tokens t) {
SymbolTable.getTheTable().symbolsDo(new SymbolTable.SymbolVisitor() {
public void visit(Symbol sym) {
sym.printValueOn(out);
out.println();
}
});
}
},
new Command("flags", "flags [ flag ]", false) {
public void doit(Tokens t) {
int tokens = t.countTokens();
@ -629,17 +659,6 @@ public class CommandProcessor {
}
}
},
new Command("symbol", "symbol name", false) {
public void doit(Tokens t) {
if (t.countTokens() != 1) {
usage();
} else {
String symbol = t.nextToken();
Address a = lookup(symbol);
out.println(symbol + " = " + a);
}
}
},
new Command("printstatics", "printstatics [ type ]", false) {
public void doit(Tokens t) {
if (t.countTokens() > 1) {
@ -1262,6 +1281,9 @@ public class CommandProcessor {
this.err = err;
for (int i = 0; i < commandList.length; i++) {
Command c = commandList[i];
if (commands.get(c.name) != null) {
throw new InternalError(c.name + " has multiple definitions");
}
commands.put(c.name, c);
}
if (debugger.isAttached()) {

View File

@ -89,6 +89,37 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
readVMLongConstants();
}
public Type lookupType(String cTypeName, boolean throwException) {
Type fieldType = super.lookupType(cTypeName, false);
if (fieldType == null && cTypeName.startsWith("const ")) {
fieldType = (BasicType)lookupType(cTypeName.substring(6), false);
}
if (fieldType == null && cTypeName.endsWith(" const")) {
fieldType = (BasicType)lookupType(cTypeName.substring(0, cTypeName.length() - 6), false);
}
if (fieldType == null) {
if (cTypeName.startsWith("GrowableArray<") && cTypeName.endsWith(">*")) {
String ttype = cTypeName.substring("GrowableArray<".length(),
cTypeName.length() - 2);
Type templateType = lookupType(ttype, false);
if (templateType == null && typeNameIsPointerType(ttype)) {
templateType = recursiveCreateBasicPointerType(ttype);
}
if (templateType == null) {
lookupOrFail(ttype);
}
fieldType = recursiveCreateBasicPointerType(cTypeName);
}
}
if (fieldType == null && typeNameIsPointerType(cTypeName)) {
fieldType = recursiveCreateBasicPointerType(cTypeName);
}
if (fieldType == null && throwException) {
super.lookupType(cTypeName, true);
}
return fieldType;
}
private void readVMTypes() {
// Get the variables we need in order to traverse the VMTypeEntry[]
long typeEntryTypeNameOffset;
@ -250,7 +281,7 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
BasicType containingType = lookupOrFail(typeName);
// The field's Type must already be in the database -- no exceptions
BasicType fieldType = lookupOrFail(typeString);
BasicType fieldType = (BasicType)lookupType(typeString);
// Create field by type
createField(containingType, fieldName, fieldType,
@ -442,10 +473,17 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
workarounds due to incomplete information in the VMStructs
database. */
private BasicPointerType recursiveCreateBasicPointerType(String typeName) {
BasicPointerType result = (BasicPointerType)super.lookupType(typeName, false);
if (result != null) {
return result;
}
String targetTypeName = typeName.substring(0, typeName.lastIndexOf('*')).trim();
Type targetType = null;
if (typeNameIsPointerType(targetTypeName)) {
targetType = recursiveCreateBasicPointerType(targetTypeName);
targetType = lookupType(targetTypeName, false);
if (targetType == null) {
targetType = recursiveCreateBasicPointerType(targetTypeName);
}
} else {
targetType = lookupType(targetTypeName, false);
if (targetType == null) {
@ -466,6 +504,20 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
BasicType basicTargetType = createBasicType(targetTypeName, false, true, true);
basicTargetType.setSize(1);
targetType = basicTargetType;
} else if (targetTypeName.startsWith("GrowableArray<")) {
BasicType basicTargetType = createBasicType(targetTypeName, false, false, false);
// transfer fields from GenericGrowableArray to template instance
BasicType generic = lookupOrFail("GenericGrowableArray");
basicTargetType.setSize(generic.getSize());
Iterator fields = generic.getFields();
while (fields.hasNext()) {
Field f = (Field)fields.next();
basicTargetType.addField(internalCreateField(basicTargetType, f.getName(),
f.getType(), f.isStatic(),
f.getOffset(), null));
}
targetType = basicTargetType;
} else {
if (DEBUG) {
System.err.println("WARNING: missing target type \"" + targetTypeName + "\" for pointer type \"" + typeName + "\"");
@ -474,7 +526,10 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
}
}
}
return new BasicPointerType(this, typeName, targetType);
result = new BasicPointerType(this, typeName, targetType);
result.setSize(UNINITIALIZED_SIZE);
addType(result);
return result;
}
private boolean typeNameIsPointerType(String typeName) {

View File

@ -112,7 +112,7 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
}
// return Symbol (if unresolved) or Klass (if resolved)
public Oop getKlass() {
public Object getKlass() {
if (Assert.ASSERTS_ENABLED) {
Assert.that(isKlassConstant(), "not a klass literal");
}
@ -121,11 +121,11 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
// decide based on the oop type.
ConstantPool cpool = method().getConstants();
int cpIndex = index();
Oop oop = cpool.getObjAt(cpIndex);
if (oop.isKlass()) {
return (Klass) oop;
} else if (oop.isSymbol()) {
return (Symbol) oop;
ConstantPool.CPSlot oop = cpool.getSlotAt(cpIndex);
if (oop.isOop()) {
return (Klass) oop.getOop();
} else if (oop.isMetaData()) {
return oop.getSymbol();
} else {
throw new RuntimeException("should not reach here");
}
@ -165,12 +165,12 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
// tag change from 'unresolved' to 'string' does not happen atomically.
// We just look at the object at the corresponding index and
// decide based on the oop type.
Oop obj = cpool.getObjAt(cpIndex);
if (obj.isSymbol()) {
Symbol sym = (Symbol) obj;
return "<String \"" + sym.asString() + "\">";
} else if (obj.isInstance()) {
return "<String \"" + OopUtilities.stringOopToString(obj) + "\">";
ConstantPool.CPSlot obj = cpool.getSlotAt(cpIndex);
if (obj.isMetaData()) {
Symbol sym = obj.getSymbol();
return "<String \"" + sym.asString() + "\">";
} else if (obj.isOop()) {
return "<String \"" + OopUtilities.stringOopToString(obj.getOop()) + "\">";
} else {
throw new RuntimeException("should not reach here");
}
@ -178,13 +178,13 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
// tag change from 'unresolved' to 'klass' does not happen atomically.
// We just look at the object at the corresponding index and
// decide based on the oop type.
Oop obj = cpool.getObjAt(cpIndex);
if (obj.isKlass()) {
Klass k = (Klass) obj;
return "<Class " + k.getName().asString() + "@" + k.getHandle() + ">";
} else if (obj.isSymbol()) {
Symbol sym = (Symbol) obj;
return "<Class " + sym.asString() + ">";
ConstantPool.CPSlot obj = cpool.getSlotAt(cpIndex);
if (obj.isOop()) {
Klass k = (Klass) obj.getOop();
return "<Class " + k.getName().asString() + "@" + k.getHandle() + ">";
} else if (obj.isMetaData()) {
Symbol sym = obj.getSymbol();
return "<Class " + sym.asString() + ">";
} else {
throw new RuntimeException("should not reach here");
}

View File

@ -37,11 +37,11 @@ public class BytecodeWithKlass extends BytecodeWithCPIndex {
}
public Symbol getClassName() {
Oop obj = method().getConstants().getObjAt(index());
if (obj instanceof Symbol) {
return (Symbol)obj;
ConstantPool.CPSlot obj = method().getConstants().getSlotAt(index());
if (obj.isMetaData()) {
return obj.getSymbol();
} else {
return ((Klass)obj).getName();
return ((Klass)obj.getOop()).getName();
}
}

View File

@ -63,7 +63,7 @@ public class DictionaryEntry extends sun.jvm.hotspot.utilities.HashtableEntry {
}
public Klass klass() {
return (Klass) literal();
return (Klass)VM.getVM().getObjectHeap().newOop(literalValue().addOffsetToAsOopHandle(0));
}
public DictionaryEntry(Address addr) {

View File

@ -42,14 +42,14 @@ public class LoaderConstraintEntry extends sun.jvm.hotspot.utilities.HashtableEn
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("LoaderConstraintEntry");
nameField = type.getOopField("_name");
nameField = type.getAddressField("_name");
numLoadersField = type.getCIntegerField("_num_loaders");
maxLoadersField = type.getCIntegerField("_max_loaders");
loadersField = type.getAddressField("_loaders");
}
// Fields
private static sun.jvm.hotspot.types.OopField nameField;
private static AddressField nameField;
private static CIntegerField numLoadersField;
private static CIntegerField maxLoadersField;
private static AddressField loadersField;
@ -57,7 +57,7 @@ public class LoaderConstraintEntry extends sun.jvm.hotspot.utilities.HashtableEn
// Accessors
public Symbol name() {
return (Symbol) VM.getVM().getObjectHeap().newOop(nameField.getValue(addr));
return Symbol.create(nameField.getValue(addr));
}
public int numLoaders() {

View File

@ -58,7 +58,7 @@ public class PlaceholderEntry extends sun.jvm.hotspot.utilities.HashtableEntry {
}
public Symbol klass() {
return (Symbol) literal();
return Symbol.create(literalValue());
}
/* covariant return type :-(

View File

@ -70,11 +70,13 @@ public class StringTable extends sun.jvm.hotspot.utilities.Hashtable {
}
public void stringsDo(StringVisitor visitor) {
ObjectHeap oh = VM.getVM().getObjectHeap();
int numBuckets = tableSize();
for (int i = 0; i < numBuckets; i++) {
for (HashtableEntry e = (HashtableEntry) bucket(i); e != null;
e = (HashtableEntry) e.next()) {
visitor.visit((Instance) e.literal());
Instance s = (Instance)oh.newOop(e.literalValue().addOffsetToAsOopHandle(0));
visitor.visit(s);
}
}
}

View File

@ -85,7 +85,7 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
long hashValue = hashSymbol(name);
for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) {
if (e.hash() == hashValue) {
Symbol sym = (Symbol) e.literal();
Symbol sym = Symbol.create(e.literalValue());
if (sym.equals(name)) {
return sym;
}
@ -103,7 +103,7 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
for (int i = 0; i < numBuckets; i++) {
for (HashtableEntry e = (HashtableEntry) bucket(i); e != null;
e = (HashtableEntry) e.next()) {
visitor.visit((Symbol) e.literal());
visitor.visit(Symbol.create(e.literalValue()));
}
}
}

View File

@ -35,6 +35,38 @@ import sun.jvm.hotspot.utilities.*;
// as described in the class file
public class ConstantPool extends Oop implements ClassConstants {
public class CPSlot {
private Address ptr;
CPSlot(Address ptr) {
this.ptr = ptr;
}
CPSlot(Symbol sym) {
this.ptr = sym.getAddress().orWithMask(1);
}
public boolean isOop() {
return (ptr.minus(null) & 1) == 0;
}
public boolean isMetaData() {
return (ptr.minus(null) & 1) == 1;
}
public Symbol getSymbol() {
if (isMetaData()) {
return Symbol.create(ptr.xorWithMask(1));
}
throw new InternalError("not a symbol");
}
public Oop getOop() {
if (isOop()) {
return VM.getVM().getObjectHeap().newOop(ptr.addOffsetToAsOopHandle(0));
}
throw new InternalError("not an oop");
}
}
// Used for debugging this code
private static final boolean DEBUG = false;
@ -110,12 +142,17 @@ public class ConstantPool extends Oop implements ClassConstants {
return new ConstantTag(getTags().getByteAt((int) index));
}
public Oop getObjAt(long index){
public CPSlot getSlotAt(long index) {
return new CPSlot(getHandle().getAddressAt(indexOffset(index)));
}
public Oop getObjAtRaw(long index){
return getHeap().newOop(getHandle().getOopHandleAt(indexOffset(index)));
}
public Symbol getSymbolAt(long index) {
return (Symbol) getObjAt(index);
CPSlot slot = getSlotAt(index);
return slot.getSymbol();
}
public int getIntAt(long index){
@ -187,7 +224,7 @@ public class ConstantPool extends Oop implements ClassConstants {
// returns null, if not resolved.
public Klass getKlassRefAt(int which) {
if( ! getTagAt(which).isKlass()) return null;
return (Klass) getObjAt(which);
return (Klass) getObjAtRaw(which);
}
// returns null, if not resolved.
@ -477,7 +514,7 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_Class: {
dos.writeByte(cpConstType);
// Klass already resolved. ConstantPool constains klassOop.
Klass refKls = (Klass) getObjAt(ci);
Klass refKls = (Klass) getObjAtRaw(ci);
String klassName = refKls.getName().asString();
Short s = (Short) utf8ToIndex.get(klassName);
dos.writeShort(s.shortValue());
@ -498,7 +535,7 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_String: {
dos.writeByte(cpConstType);
String str = OopUtilities.stringOopToString(getObjAt(ci));
String str = OopUtilities.stringOopToString(getObjAtRaw(ci));
Short s = (Short) utf8ToIndex.get(str);
dos.writeShort(s.shortValue());
if (DEBUG) debugMessage("CP[" + ci + "] = string " + s);

View File

@ -576,7 +576,7 @@ public class GenerateOopMap {
ConstantPool cp = method().getConstants();
int nameAndTypeIdx = cp.name_and_type_ref_index_at(idx);
int signatureIdx = cp.signature_ref_index_at(nameAndTypeIdx);
symbolOop signature = cp.symbol_at(signatureIdx);
Symbol* signature = cp.symbol_at(signatureIdx);
tty.print("%s", signature.as_C_string());
*/
}
@ -616,7 +616,7 @@ public class GenerateOopMap {
constantPoolOop cp = method().constants();
int nameAndTypeIdx = cp.name_and_type_ref_index_at(idx);
int signatureIdx = cp.signature_ref_index_at(nameAndTypeIdx);
symbolOop signature = cp.symbol_at(signatureIdx);
Symbol* signature = cp.symbol_at(signatureIdx);
tty.print("%s", signature.as_C_string());
*/
}

View File

@ -82,8 +82,8 @@ public class InstanceKlass extends Klass {
classLoader = new OopField(type.getOopField("_class_loader"), Oop.getHeaderSize());
protectionDomain = new OopField(type.getOopField("_protection_domain"), Oop.getHeaderSize());
signers = new OopField(type.getOopField("_signers"), Oop.getHeaderSize());
sourceFileName = new OopField(type.getOopField("_source_file_name"), Oop.getHeaderSize());
sourceDebugExtension = new OopField(type.getOopField("_source_debug_extension"), Oop.getHeaderSize());
sourceFileName = type.getAddressField("_source_file_name");
sourceDebugExtension = type.getAddressField("_source_debug_extension");
innerClasses = new OopField(type.getOopField("_inner_classes"), Oop.getHeaderSize());
nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), Oop.getHeaderSize());
staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), Oop.getHeaderSize());
@ -94,7 +94,7 @@ public class InstanceKlass extends Klass {
vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), Oop.getHeaderSize());
itableLen = new CIntField(type.getCIntegerField("_itable_len"), Oop.getHeaderSize());
breakpoints = type.getAddressField("_breakpoints");
genericSignature = new OopField(type.getOopField("_generic_signature"), Oop.getHeaderSize());
genericSignature = type.getAddressField("_generic_signature");
majorVersion = new CIntField(type.getCIntegerField("_major_version"), Oop.getHeaderSize());
minorVersion = new CIntField(type.getCIntegerField("_minor_version"), Oop.getHeaderSize());
headerSize = alignObjectOffset(Oop.getHeaderSize() + type.getSize());
@ -135,8 +135,8 @@ public class InstanceKlass extends Klass {
private static OopField classLoader;
private static OopField protectionDomain;
private static OopField signers;
private static OopField sourceFileName;
private static OopField sourceDebugExtension;
private static AddressField sourceFileName;
private static AddressField sourceDebugExtension;
private static OopField innerClasses;
private static CIntField nonstaticFieldSize;
private static CIntField staticFieldSize;
@ -147,7 +147,7 @@ public class InstanceKlass extends Klass {
private static CIntField vtableLen;
private static CIntField itableLen;
private static AddressField breakpoints;
private static OopField genericSignature;
private static AddressField genericSignature;
private static CIntField majorVersion;
private static CIntField minorVersion;
@ -257,8 +257,8 @@ public class InstanceKlass extends Klass {
public Oop getClassLoader() { return classLoader.getValue(this); }
public Oop getProtectionDomain() { return protectionDomain.getValue(this); }
public ObjArray getSigners() { return (ObjArray) signers.getValue(this); }
public Symbol getSourceFileName() { return (Symbol) sourceFileName.getValue(this); }
public Symbol getSourceDebugExtension(){ return (Symbol) sourceDebugExtension.getValue(this); }
public Symbol getSourceFileName() { return getSymbol(sourceFileName); }
public Symbol getSourceDebugExtension(){ return getSymbol(sourceDebugExtension); }
public TypeArray getInnerClasses() { return (TypeArray) innerClasses.getValue(this); }
public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
public long getStaticFieldSize() { return staticFieldSize.getValue(this); }
@ -267,7 +267,7 @@ public class InstanceKlass extends Klass {
public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
public long getVtableLen() { return vtableLen.getValue(this); }
public long getItableLen() { return itableLen.getValue(this); }
public Symbol getGenericSignature() { return (Symbol) genericSignature.getValue(this); }
public Symbol getGenericSignature() { return getSymbol(genericSignature); }
public long majorVersion() { return majorVersion.getValue(this); }
public long minorVersion() { return minorVersion.getValue(this); }
@ -308,12 +308,12 @@ public class InstanceKlass extends Klass {
if (ioff != 0) {
// only look at classes that are already loaded
// since we are looking for the flags for our self.
Oop classInfo = getConstants().getObjAt(ioff);
ConstantPool.CPSlot classInfo = getConstants().getSlotAt(ioff);
Symbol name = null;
if (classInfo instanceof Klass) {
name = ((Klass) classInfo).getName();
} else if (classInfo instanceof Symbol) {
name = (Symbol) classInfo;
if (classInfo.isOop()) {
name = ((Klass) classInfo.getOop()).getName();
} else if (classInfo.isMetaData()) {
name = classInfo.getSymbol();
} else {
throw new RuntimeException("should not reach here");
}
@ -358,12 +358,12 @@ public class InstanceKlass extends Klass {
// 'ioff' can be zero.
// refer to JVM spec. section 4.7.5.
if (ioff != 0) {
Oop iclassInfo = getConstants().getObjAt(ioff);
ConstantPool.CPSlot iclassInfo = getConstants().getSlotAt(ioff);
Symbol innerName = null;
if (iclassInfo instanceof Klass) {
innerName = ((Klass) iclassInfo).getName();
} else if (iclassInfo instanceof Symbol) {
innerName = (Symbol) iclassInfo;
if (iclassInfo.isOop()) {
innerName = ((Klass) iclassInfo.getOop()).getName();
} else if (iclassInfo.isMetaData()) {
innerName = iclassInfo.getSymbol();
} else {
throw new RuntimeException("should not reach here");
}
@ -387,12 +387,12 @@ public class InstanceKlass extends Klass {
}
}
} else {
Oop oclassInfo = getConstants().getObjAt(ooff);
ConstantPool.CPSlot oclassInfo = getConstants().getSlotAt(ooff);
Symbol outerName = null;
if (oclassInfo instanceof Klass) {
outerName = ((Klass) oclassInfo).getName();
} else if (oclassInfo instanceof Symbol) {
outerName = (Symbol) oclassInfo;
if (oclassInfo.isOop()) {
outerName = ((Klass) oclassInfo.getOop()).getName();
} else if (oclassInfo.isMetaData()) {
outerName = oclassInfo.getSymbol();
} else {
throw new RuntimeException("should not reach here");
}
@ -450,7 +450,6 @@ public class InstanceKlass extends Klass {
visitor.doOop(classLoader, true);
visitor.doOop(protectionDomain, true);
visitor.doOop(signers, true);
visitor.doOop(sourceFileName, true);
visitor.doOop(innerClasses, true);
visitor.doCInt(nonstaticFieldSize, true);
visitor.doCInt(staticFieldSize, true);
@ -467,7 +466,7 @@ public class InstanceKlass extends Klass {
for (int index = 0; index < length; index += NEXT_OFFSET) {
short accessFlags = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
FieldType type = new FieldType((Symbol) getConstants().getObjAt(signatureIndex));
FieldType type = new FieldType(getConstants().getSymbolAt(signatureIndex));
AccessFlags access = new AccessFlags(accessFlags);
if (access.isStatic()) {
visitField(visitor, type, index);
@ -490,7 +489,7 @@ public class InstanceKlass extends Klass {
short accessFlags = fields.getShortAt(index + ACCESS_FLAGS_OFFSET);
short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
FieldType type = new FieldType((Symbol) getConstants().getObjAt(signatureIndex));
FieldType type = new FieldType(getConstants().getSymbolAt(signatureIndex));
AccessFlags access = new AccessFlags(accessFlags);
if (!access.isStatic()) {
visitField(visitor, type, index);
@ -787,7 +786,7 @@ public class InstanceKlass extends Klass {
private Field newField(int index) {
TypeArray fields = getFields();
short signatureIndex = fields.getShortAt(index + SIGNATURE_INDEX_OFFSET);
FieldType type = new FieldType((Symbol) getConstants().getObjAt(signatureIndex));
FieldType type = new FieldType(getConstants().getSymbolAt(signatureIndex));
if (type.isOop()) {
if (VM.getVM().isCompressedOopsEnabled()) {
return new NarrowOopField(this, index);

View File

@ -53,7 +53,7 @@ public class Klass extends Oop implements ClassConstants {
javaMirror = new OopField(type.getOopField("_java_mirror"), Oop.getHeaderSize());
superField = new OopField(type.getOopField("_super"), Oop.getHeaderSize());
layoutHelper = new IntField(type.getJIntField("_layout_helper"), Oop.getHeaderSize());
name = new OopField(type.getOopField("_name"), Oop.getHeaderSize());
name = type.getAddressField("_name");
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), Oop.getHeaderSize());
subklass = new OopField(type.getOopField("_subklass"), Oop.getHeaderSize());
nextSibling = new OopField(type.getOopField("_next_sibling"), Oop.getHeaderSize());
@ -83,18 +83,26 @@ public class Klass extends Oop implements ClassConstants {
private static OopField javaMirror;
private static OopField superField;
private static IntField layoutHelper;
private static OopField name;
private static AddressField name;
private static CIntField accessFlags;
private static OopField subklass;
private static OopField nextSibling;
private static CIntField allocCount;
private Address getValue(AddressField field) {
return getHandle().getAddressAt(field.getOffset() + Oop.getHeaderSize());
}
protected Symbol getSymbol(AddressField field) {
return Symbol.create(getHandle().getAddressAt(field.getOffset() + Oop.getHeaderSize()));
}
// Accessors for declared fields
public Instance getJavaMirror() { return (Instance) javaMirror.getValue(this); }
public Klass getSuper() { return (Klass) superField.getValue(this); }
public Klass getJavaSuper() { return null; }
public int getLayoutHelper() { return (int) layoutHelper.getValue(this); }
public Symbol getName() { return (Symbol) name.getValue(this); }
public Symbol getName() { return getSymbol(name); }
public long getAccessFlags() { return accessFlags.getValue(this); }
// Convenience routine
public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); }
@ -162,7 +170,7 @@ public class Klass extends Oop implements ClassConstants {
visitor.doOop(javaMirror, true);
visitor.doOop(superField, true);
visitor.doInt(layoutHelper, true);
visitor.doOop(name, true);
// visitor.doOop(name, true);
visitor.doCInt(accessFlags, true);
visitor.doOop(subklass, true);
visitor.doOop(nextSibling, true);

View File

@ -196,11 +196,11 @@ public class Method extends Oop {
public Address getFromCompiledCodeEntryPoint() { return fromCompiledCodeEntryPointField.getValue(this); }
*/
// Accessors
public Symbol getName() { return (Symbol) getConstants().getObjAt(getNameIndex()); }
public Symbol getSignature() { return (Symbol) getConstants().getObjAt(getSignatureIndex()); }
public Symbol getName() { return getConstants().getSymbolAt(getNameIndex()); }
public Symbol getSignature() { return getConstants().getSymbolAt(getSignatureIndex()); }
public Symbol getGenericSignature() {
long index = getGenericSignatureIndex();
return (index != 0L) ? (Symbol) getConstants().getObjAt(index) : null;
return (index != 0L) ? getConstants().getSymbolAt(index) : null;
}
// Method holder (the Klass holding this method)

View File

@ -47,7 +47,6 @@ public class ObjectHeap {
DEBUG = System.getProperty("sun.jvm.hotspot.oops.ObjectHeap.DEBUG") != null;
}
private OopHandle symbolKlassHandle;
private OopHandle methodKlassHandle;
private OopHandle constMethodKlassHandle;
private OopHandle methodDataKlassHandle;
@ -68,7 +67,6 @@ public class ObjectHeap {
private OopHandle arrayKlassKlassHandle;
private OopHandle compiledICHolderKlassHandle;
private SymbolKlass symbolKlassObj;
private MethodKlass methodKlassObj;
private ConstMethodKlass constMethodKlassObj;
private MethodDataKlass methodDataKlassObj;
@ -93,9 +91,6 @@ public class ObjectHeap {
// Lookup the roots in the object hierarchy.
Type universeType = db.lookupType("Universe");
symbolKlassHandle = universeType.getOopField("_symbolKlassObj").getValue();
symbolKlassObj = new SymbolKlass(symbolKlassHandle, this);
methodKlassHandle = universeType.getOopField("_methodKlassObj").getValue();
methodKlassObj = new MethodKlass(methodKlassHandle, this);
@ -199,7 +194,6 @@ public class ObjectHeap {
public long getDoubleSize() { return doubleSize; }
// Accessors for well-known system classes (from Universe)
public SymbolKlass getSymbolKlassObj() { return symbolKlassObj; }
public MethodKlass getMethodKlassObj() { return methodKlassObj; }
public ConstMethodKlass getConstMethodKlassObj() { return constMethodKlassObj; }
public MethodDataKlass getMethodDataKlassObj() { return methodDataKlassObj; }
@ -337,7 +331,6 @@ public class ObjectHeap {
// First check if handle is one of the root objects
if (handle.equals(methodKlassHandle)) return getMethodKlassObj();
if (handle.equals(constMethodKlassHandle)) return getConstMethodKlassObj();
if (handle.equals(symbolKlassHandle)) return getSymbolKlassObj();
if (handle.equals(constantPoolKlassHandle)) return getConstantPoolKlassObj();
if (handle.equals(constantPoolCacheKlassHandle)) return getConstantPoolCacheKlassObj();
if (handle.equals(instanceKlassKlassHandle)) return getInstanceKlassKlassObj();
@ -363,7 +356,6 @@ public class ObjectHeap {
if (klass != null) {
if (klass.equals(methodKlassHandle)) return new Method(handle, this);
if (klass.equals(constMethodKlassHandle)) return new ConstMethod(handle, this);
if (klass.equals(symbolKlassHandle)) return new Symbol(handle, this);
if (klass.equals(constantPoolKlassHandle)) return new ConstantPool(handle, this);
if (klass.equals(constantPoolCacheKlassHandle)) return new ConstantPoolCache(handle, this);
if (!VM.getVM().isCore()) {

View File

@ -34,7 +34,7 @@ import sun.jvm.hotspot.utilities.*;
// A Symbol is a canonicalized string.
// All Symbols reside in global symbolTable.
public class Symbol extends Oop {
public class Symbol extends VMObject {
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@ -44,9 +44,10 @@ public class Symbol extends Oop {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
Type type = db.lookupType("symbolOopDesc");
length = new CIntField(type.getCIntegerField("_length"), 0);
Type type = db.lookupType("Symbol");
length = type.getCIntegerField("_length");
baseOffset = type.getField("_body").getOffset();
idHash = type.getCIntegerField("_identity_hash");
}
// Format:
@ -55,8 +56,15 @@ public class Symbol extends Oop {
// [length] byte size of uft8 string
// ..body..
Symbol(OopHandle handle, ObjectHeap heap) {
super(handle, heap);
public static Symbol create(Address addr) {
if (addr == null) {
return null;
}
return new Symbol(addr);
}
Symbol(Address addr) {
super(addr);
}
public boolean isSymbol() { return true; }
@ -64,15 +72,19 @@ public class Symbol extends Oop {
private static long baseOffset; // tells where the array part starts
// Fields
private static CIntField length;
private static CIntegerField length;
// Accessors for declared fields
public long getLength() { return length.getValue(this); }
public long getLength() { return length.getValue(this.addr); }
public byte getByteAt(long index) {
return getHandle().getJByteAt(baseOffset + index);
return addr.getJByteAt(baseOffset + index);
}
private static CIntegerField idHash;
public int identityHash() { return (int)idHash.getValue(this.addr); }
public boolean equals(byte[] modUTF8Chars) {
int l = (int) getLength();
if (l != modUTF8Chars.length) return false;
@ -98,7 +110,9 @@ public class Symbol extends Oop {
// Decode the byte array and return the string.
try {
return readModifiedUTF8(asByteArray());
} catch(IOException e) {
} catch(Exception e) {
System.err.println(addr);
e.printStackTrace();
return null;
}
}
@ -111,28 +125,13 @@ public class Symbol extends Oop {
tty.print("#" + asString());
}
public long getObjectSize() {
return alignObjectSize(baseOffset + getLength());
}
void iterateFields(OopVisitor visitor, boolean doVMFields) {
super.iterateFields(visitor, doVMFields);
if (doVMFields) {
visitor.doCInt(length, true);
int length = (int) getLength();
for (int index = 0; index < length; index++) {
visitor.doByte(new ByteField(new IndexableFieldIdentifier(index), baseOffset + index, false), true);
}
}
}
/** Note: this comparison is used for vtable sorting only; it
doesn't matter what order it defines, as long as it is a total,
time-invariant order Since symbolOops are in permSpace, their
time-invariant order Since Symbol* are in C_HEAP, their
relative order in memory never changes, so use address
comparison for speed. */
public int fastCompare(Symbol other) {
return (int) getHandle().minus(other.getHandle());
return (int) addr.minus(other.addr);
}
private static String readModifiedUTF8(byte[] buf) throws IOException {

View File

@ -229,7 +229,7 @@ public class ClassWriter implements /* imports */ ClassConstants
case JVM_CONSTANT_Class: {
dos.writeByte(cpConstType);
// Klass already resolved. ConstantPool constains klassOop.
Klass refKls = (Klass) cpool.getObjAt(ci);
Klass refKls = (Klass) cpool.getObjAtRaw(ci);
String klassName = refKls.getName().asString();
Short s = (Short) utf8ToIndex.get(klassName);
@ -255,7 +255,7 @@ public class ClassWriter implements /* imports */ ClassConstants
case JVM_CONSTANT_String: {
dos.writeByte(cpConstType);
String str = OopUtilities.stringOopToString(cpool.getObjAt(ci));
String str = OopUtilities.stringOopToString(cpool.getObjAtRaw(ci));
Short s = (Short) utf8ToIndex.get(str);
dos.writeShort(s.shortValue());
if (DEBUG) debugMessage("CP[" + ci + "] = string " + s);

View File

@ -56,7 +56,7 @@ import sun.jvm.hotspot.debugger.*;
</PRE>
FIXME: among other things, this interface is not sufficient to
describe fields which are themselves arrays (like symbolOop's
describe fields which are themselves arrays (like Symbol's
jbyte _body[1]). */
public interface Field {
/** Get the name of this field */

View File

@ -530,7 +530,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
case JVM_CONSTANT_Class:
buf.cell("JVM_CONSTANT_Class");
Klass klass = (Klass) cpool.getObjAt(index);
Klass klass = (Klass) cpool.getObjAtRaw(index);
if (klass instanceof InstanceKlass) {
buf.cell(genKlassLink((InstanceKlass) klass));
} else {
@ -555,7 +555,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
case JVM_CONSTANT_String:
buf.cell("JVM_CONSTANT_String");
buf.cell("\"" +
escapeHTMLSpecialChars(OopUtilities.stringOopToString(cpool.getObjAt(index))) + "\"");
escapeHTMLSpecialChars(OopUtilities.stringOopToString(cpool.getObjAtRaw(index))) + "\"");
break;
case JVM_CONSTANT_Fieldref:
@ -672,11 +672,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.beginTag("ul");
for (int exp = 0; exp < exceptions.length; exp++) {
short cpIndex = (short) exceptions[exp].getClassCPIndex();
Oop obj = cpool.getObjAt(cpIndex);
if (obj instanceof Symbol) {
buf.li(((Symbol)obj).asString().replace('/', '.'));
ConstantPool.CPSlot obj = cpool.getSlotAt(cpIndex);
if (obj.isMetaData()) {
buf.li((obj.getSymbol()).asString().replace('/', '.'));
} else {
buf.li(genKlassLink((InstanceKlass)obj));
buf.li(genKlassLink((InstanceKlass)obj.getOop()));
}
}
buf.endTag("ul");
@ -756,7 +756,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
} else if (instr instanceof BytecodeLoadConstant) {
BytecodeLoadConstant ldc = (BytecodeLoadConstant) instr;
if (ldc.isKlassConstant()) {
Oop oop = ldc.getKlass();
Object oop = ldc.getKlass();
if (oop instanceof Klass) {
buf.append("<a href='");
buf.append(genKlassHref((InstanceKlass) oop));
@ -803,13 +803,13 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.cell(Integer.toString(exceptionTable.getIntAt(e + 1)));
buf.cell(Integer.toString(exceptionTable.getIntAt(e + 2)));
short cpIndex = (short) exceptionTable.getIntAt(e + 3);
Oop obj = cpIndex == 0? null : cpool.getObjAt(cpIndex);
ConstantPool.CPSlot obj = cpIndex == 0? null : cpool.getSlotAt(cpIndex);
if (obj == null) {
buf.cell("Any");
} else if (obj instanceof Symbol) {
buf.cell(((Symbol)obj).asString().replace('/', '.'));
} else if (obj.isMetaData()) {
buf.cell(obj.getSymbol().asString().replace('/', '.'));
} else {
buf.cell(genKlassLink((InstanceKlass)obj));
buf.cell(genKlassLink((InstanceKlass)obj.getOop()));
}
buf.endTag("tr");
}

View File

@ -40,7 +40,7 @@ public class Hashtable extends BasicHashtable {
private static synchronized void initialize(TypeDataBase db) {
// just to confirm that type exists
Type type = db.lookupType("Hashtable");
Type type = db.lookupType("Hashtable<intptr_t>");
}
// derived class may return Class<? extends HashtableEntry>

View File

@ -41,16 +41,16 @@ public class HashtableEntry extends BasicHashtableEntry {
}
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("HashtableEntry");
literalField = type.getOopField("_literal");
Type type = db.lookupType("HashtableEntry<intptr_t>");
literalField = type.getAddressField("_literal");
}
// Fields
private static OopField literalField;
private static AddressField literalField;
// Accessors
public Oop literal() {
return VM.getVM().getObjectHeap().newOop(literalField.getValue(addr));
public Address literalValue() {
return literalField.getValue(addr);
}
public HashtableEntry(Address addr) {

View File

@ -740,7 +740,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
for (Iterator itr = fields.iterator(); itr.hasNext();) {
Field field = (Field) itr.next();
Symbol name = symTbl.probe(field.getID().getName());
writeObjectID(name);
writeSymbolID(name);
char typeCode = (char) field.getSignature().getByteAt(0);
int kind = signatureToHprofKind(typeCode);
out.writeByte((byte)kind);
@ -852,7 +852,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
private void writeSymbol(Symbol sym) throws IOException {
byte[] buf = sym.asString().getBytes("UTF-8");
writeHeader(HPROF_UTF8, buf.length + OBJ_ID_SIZE);
writeObjectID(sym);
writeSymbolID(sym);
out.write(buf);
}
@ -869,7 +869,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
out.writeInt(serialNum);
writeObjectID(clazz);
out.writeInt(DUMMY_STACK_TRACE_ID);
writeObjectID(k.getName());
writeSymbolID(k.getName());
serialNum++;
} catch (IOException exp) {
throw new RuntimeException(exp);
@ -901,6 +901,10 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
writeObjectID(address);
}
private void writeSymbolID(Symbol sym) throws IOException {
writeObjectID(getAddressValue(sym.getAddress()));
}
private void writeObjectID(long address) throws IOException {
if (OBJ_ID_SIZE == 4) {
out.writeInt((int) address);

View File

@ -33,9 +33,9 @@
# Don't put quotes (fail windows build).
HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=20
HS_MAJOR_VER=21
HS_MINOR_VER=0
HS_BUILD_NUMBER=06
HS_BUILD_NUMBER=01
JDK_MAJOR_VER=1
JDK_MINOR_VER=7

View File

@ -4104,7 +4104,7 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case
ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1);
sub(top, t1, t1); // size of tlab's allocated portion
incr_allocated_bytes(t1, 0, t2);
incr_allocated_bytes(t1, t2, t3);
// refill the tlab with an eden allocation
bind(do_refill);
@ -4138,19 +4138,14 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case
delayed()->nop();
}
void MacroAssembler::incr_allocated_bytes(Register var_size_in_bytes,
int con_size_in_bytes,
Register t1) {
void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes,
Register t1, Register t2) {
// Bump total bytes allocated by this thread
assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch
assert_different_registers(var_size_in_bytes, t1);
assert_different_registers(size_in_bytes.register_or_noreg(), t1, t2);
// v8 support has gone the way of the dodo
ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1);
if (var_size_in_bytes->is_valid()) {
add(t1, var_size_in_bytes, t1);
} else {
add(t1, con_size_in_bytes, t1);
}
add(t1, ensure_simm13_or_reg(size_in_bytes, t2), t1);
stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset()));
}

View File

@ -823,15 +823,23 @@ class Assembler : public AbstractAssembler {
};
// test if x is within signed immediate range for nbits
static bool is_simm(int x, int nbits) { return -( 1 << nbits-1 ) <= x && x < ( 1 << nbits-1 ); }
static bool is_simm(intptr_t x, int nbits) { return -( intptr_t(1) << nbits-1 ) <= x && x < ( intptr_t(1) << nbits-1 ); }
// test if -4096 <= x <= 4095
static bool is_simm13(int x) { return is_simm(x, 13); }
static bool is_simm13(intptr_t x) { return is_simm(x, 13); }
static bool is_in_wdisp_range(address a, address b, int nbits) {
intptr_t d = intptr_t(b) - intptr_t(a);
return is_simm(d, nbits + 2);
}
// test if label is in simm16 range in words (wdisp16).
bool is_in_wdisp16_range(Label& L) {
intptr_t d = intptr_t(pc()) - intptr_t(target(L));
return is_simm(d, 18);
return is_in_wdisp_range(target(L), pc(), 16);
}
// test if the distance between two addresses fits in simm30 range in words
static bool is_in_wdisp30_range(address a, address b) {
return is_in_wdisp_range(a, b, 30);
}
enum ASIs { // page 72, v9
@ -1843,6 +1851,8 @@ class MacroAssembler: public Assembler {
inline void jmp( Register s1, Register s2 );
inline void jmp( Register s1, int simm13a, RelocationHolder const& rspec = RelocationHolder() );
// Check if the call target is out of wdisp30 range (relative to the code cache)
static inline bool is_far_target(address d);
inline void call( address d, relocInfo::relocType rt = relocInfo::runtime_call_type );
inline void call( Label& L, relocInfo::relocType rt = relocInfo::runtime_call_type );
inline void callr( Register s1, Register s2 );
@ -2389,7 +2399,8 @@ public:
Label& slow_case // continuation point if fast allocation fails
);
void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case);
void incr_allocated_bytes(Register var_size_in_bytes, int con_size_in_bytes, Register t1);
void incr_allocated_bytes(RegisterOrConstant size_in_bytes,
Register t1, Register t2);
// interface method calling
void lookup_interface_method(Register recv_klass,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -588,10 +588,13 @@ inline void MacroAssembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L
inline void MacroAssembler::jmp( Register s1, Register s2 ) { jmpl( s1, s2, G0 ); }
inline void MacroAssembler::jmp( Register s1, int simm13a, RelocationHolder const& rspec ) { jmpl( s1, simm13a, G0, rspec); }
inline bool MacroAssembler::is_far_target(address d) {
return !is_in_wdisp30_range(d, CodeCache::low_bound()) || !is_in_wdisp30_range(d, CodeCache::high_bound());
}
// Call with a check to see if we need to deal with the added
// expense of relocation and if we overflow the displacement
// of the quick call instruction./
// Check to see if we have to deal with relocations
// of the quick call instruction.
inline void MacroAssembler::call( address d, relocInfo::relocType rt ) {
#ifdef _LP64
intptr_t disp;
@ -603,14 +606,12 @@ inline void MacroAssembler::call( address d, relocInfo::relocType rt ) {
// Is this address within range of the call instruction?
// If not, use the expensive instruction sequence
disp = (intptr_t)d - (intptr_t)pc();
if ( disp != (intptr_t)(int32_t)disp ) {
if (is_far_target(d)) {
relocate(rt);
AddressLiteral dest(d);
jumpl_to(dest, O7, O7);
}
else {
Assembler::call( d, rt );
} else {
Assembler::call(d, rt);
}
#else
Assembler::call( d, rt );

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -129,27 +129,6 @@ void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
}
// Implementation of ArrayStoreExceptionStub
ArrayStoreExceptionStub::ArrayStoreExceptionStub(CodeEmitInfo* info):
_info(info) {
}
void ArrayStoreExceptionStub::emit_code(LIR_Assembler* ce) {
__ bind(_entry);
__ call(Runtime1::entry_for(Runtime1::throw_array_store_exception_id), relocInfo::runtime_call_type);
__ delayed()->nop();
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
#ifdef ASSERT
__ should_not_reach_here();
#endif
}
// Implementation of NewInstanceStub
NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -2358,6 +2358,8 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
op->tmp3()->as_register() == G4 &&
op->tmp4()->as_register() == O1 &&
op->klass()->as_register() == G5, "must be");
LP64_ONLY( __ signx(op->len()->as_register()); )
if (UseSlowPath ||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {

View File

@ -170,11 +170,13 @@ void C1_MacroAssembler::try_allocate(
Register t2, // temp register
Label& slow_case // continuation point if fast allocation fails
) {
RegisterOrConstant size_in_bytes = var_size_in_bytes->is_valid()
? RegisterOrConstant(var_size_in_bytes) : RegisterOrConstant(con_size_in_bytes);
if (UseTLAB) {
tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case);
} else {
eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case);
incr_allocated_bytes(var_size_in_bytes, con_size_in_bytes, t1);
incr_allocated_bytes(size_in_bytes, t1, t2);
}
}

View File

@ -343,9 +343,10 @@ OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
// returned.
restore_live_registers(sasm);
__ restore();
__ br(Assembler::always, false, Assembler::pt, deopt_blob->unpack_with_reexecution(), relocInfo::runtime_call_type);
__ delayed()->nop();
AddressLiteral dest(deopt_blob->unpack_with_reexecution());
__ jump_to(dest, O0);
__ delayed()->restore();
__ bind(no_deopt);
restore_live_registers(sasm);
@ -461,7 +462,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
// get the instance size
__ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size);
__ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path);
__ incr_allocated_bytes(G1_obj_size, 0, G3_t1);
__ incr_allocated_bytes(G1_obj_size, G3_t1, G4_t2);
__ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2);
__ verify_oop(O0_obj);
@ -577,7 +578,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ and3(G1_arr_size, ~MinObjAlignmentInBytesMask, G1_arr_size);
__ eden_allocate(O0_obj, G1_arr_size, 0, G3_t1, O1_t2, slow_path); // preserves G1_arr_size
__ incr_allocated_bytes(G1_arr_size, 0, G3_t1);
__ incr_allocated_bytes(G1_arr_size, G3_t1, O1_t2);
__ initialize_header(O0_obj, G5_klass, G4_length, G3_t1, O1_t2);
__ ldub(klass_lh, G3_t1, klass_lh_header_size_offset);
@ -709,7 +710,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
case throw_array_store_exception_id:
{
__ set_info("throw_array_store_exception", dont_gc_arguments);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), false);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true);
}
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1295,16 +1295,13 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) {
// Get the method data pointer from the methodOop and set the
// specified register to its value.
void InterpreterMacroAssembler::set_method_data_pointer_offset(Register Roff) {
void InterpreterMacroAssembler::set_method_data_pointer() {
assert(ProfileInterpreter, "must be profiling interpreter");
Label get_continue;
ld_ptr(Lmethod, in_bytes(methodOopDesc::method_data_offset()), ImethodDataPtr);
test_method_data_pointer(get_continue);
add(ImethodDataPtr, in_bytes(methodDataOopDesc::data_offset()), ImethodDataPtr);
if (Roff != noreg)
// Roff contains a method data index ("mdi"). It defaults to zero.
add(ImethodDataPtr, Roff, ImethodDataPtr);
bind(get_continue);
}
@ -1315,10 +1312,11 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
Label zero_continue;
// Test MDO to avoid the call if it is NULL.
ld_ptr(Lmethod, methodOopDesc::method_data_offset(), ImethodDataPtr);
ld_ptr(Lmethod, in_bytes(methodOopDesc::method_data_offset()), ImethodDataPtr);
test_method_data_pointer(zero_continue);
call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), Lmethod, Lbcp);
set_method_data_pointer_offset(O0);
add(ImethodDataPtr, in_bytes(methodDataOopDesc::data_offset()), ImethodDataPtr);
add(ImethodDataPtr, O0, ImethodDataPtr);
bind(zero_continue);
}
@ -1369,7 +1367,6 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
}
void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocation_count,
Register cur_bcp,
Register Rtmp,
Label &profile_continue) {
assert(ProfileInterpreter, "must be profiling interpreter");
@ -1400,8 +1397,8 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat
delayed()->nop();
// Build it now.
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), cur_bcp);
set_method_data_pointer_offset(O0);
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
set_method_data_pointer_for_bcp();
ba(false, profile_continue);
delayed()->nop();
bind(done);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -269,12 +269,11 @@ class InterpreterMacroAssembler: public MacroAssembler {
#ifndef CC_INTERP
// Interpreter profiling operations
void set_method_data_pointer() { set_method_data_pointer_offset(noreg); }
void set_method_data_pointer();
void set_method_data_pointer_for_bcp();
void set_method_data_pointer_offset(Register mdi_reg);
void test_method_data_pointer(Label& zero_continue);
void verify_method_data_pointer();
void test_invocation_counter_for_mdp(Register invocation_count, Register cur_bcp, Register Rtmp, Label &profile_continue);
void test_invocation_counter_for_mdp(Register invocation_count, Register Rtmp, Label &profile_continue);
void set_mdp_data_at(int constant, Register value);
void increment_mdp_data_at(Address counter, Register bumped_count,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -395,7 +395,7 @@ int MethodHandles::adapter_conversion_ops_supported_mask() {
//
// Generate an "entry" field for a method handle.
// This determines how the method handle will respond to calls.
void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) {
void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) {
// Here is the register state during an interpreted call,
// as set up by generate_method_handle_interpreter_entry():
// - G5: garbage temp (was MethodHandle.invoke methodOop, unused)
@ -447,8 +447,9 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
// exception. Since we use a C2I adapter to set up the
// interpreter state, arguments are expected in compiler
// argument registers.
methodHandle mh(raise_exception_method());
address c2i_entry = methodOopDesc::make_adapters(mh, CATCH);
assert(raise_exception_method(), "must be set");
address c2i_entry = raise_exception_method()->get_c2i_entry();
assert(c2i_entry, "method must be linked");
__ mov(O5_savedSP, SP); // Cut the stack back to where the caller started.

View File

@ -2541,7 +2541,7 @@ nmethod *SharedRuntime::generate_dtrace_nmethod(
in_sig_bt[i++] = bt; // Collect remaining bits of signature
out_sig_bt[total_c_args++] = bt;
if( bt == T_OBJECT) {
symbolOop s = ss.as_symbol_or_null();
Symbol* s = ss.as_symbol_or_null();
if (s == vmSymbols::java_lang_String()) {
total_strings++;
out_sig_bt[total_c_args-1] = T_ADDRESS;

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@ -575,7 +575,11 @@ int MachCallDynamicJavaNode::ret_addr_offset() {
int MachCallRuntimeNode::ret_addr_offset() {
#ifdef _LP64
return NativeFarCall::instruction_size; // farcall; delay slot
if (MacroAssembler::is_far_target(entry_point())) {
return NativeFarCall::instruction_size;
} else {
return NativeCall::instruction_size;
}
#else
return NativeCall::instruction_size; // call; delay slot
#endif
@ -941,7 +945,7 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, const MachNode* n, int primary, int te
#endif
}
void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false, bool force_far_call = false) {
void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false) {
// The method which records debug information at every safepoint
// expects the call to be the first instruction in the snippet as
// it creates a PcDesc structure which tracks the offset of a call
@ -963,20 +967,7 @@ void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocTyp
int startpos = __ offset();
#endif /* ASSERT */
#ifdef _LP64
// Calls to the runtime or native may not be reachable from compiled code,
// so we generate the far call sequence on 64 bit sparc.
// This code sequence is relocatable to any address, even on LP64.
if ( force_far_call ) {
__ relocate(rtype);
AddressLiteral dest(entry_point);
__ jumpl_to(dest, O7, O7);
}
else
#endif
{
__ call((address)entry_point, rtype);
}
__ call((address)entry_point, rtype);
if (preserve_g2) __ delayed()->mov(G2, L7);
else __ delayed()->nop();
@ -2507,7 +2498,7 @@ encode %{
// CALL directly to the runtime
// The user of this is responsible for ensuring that R_L7 is empty (killed).
emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type,
/*preserve_g2=*/true, /*force far call*/true);
/*preserve_g2=*/true);
%}
enc_class preserve_SP %{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1364,15 +1364,8 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
// We have decided to profile this method in the interpreter
__ bind(profile_method);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), Lbcp, true);
#ifdef ASSERT
__ tst(O0);
__ breakpoint_trap(Assembler::notEqual);
#endif
__ set_method_data_pointer();
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
__ set_method_data_pointer_for_bcp();
__ ba(false, profile_method_continue);
__ delayed()->nop();
}

View File

@ -1689,7 +1689,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
const Register G4_invoke_ctr = G4;
__ increment_backedge_counter(G4_invoke_ctr, G1_scratch);
if (ProfileInterpreter) {
__ test_invocation_counter_for_mdp(G4_invoke_ctr, Lbcp, G3_scratch, Lforward);
__ test_invocation_counter_for_mdp(G4_invoke_ctr, G3_scratch, Lforward);
if (UseOnStackReplacement) {
__ test_backedge_count_for_osr(O2_bumped_count, O0_cur_bcp, G3_scratch);
}
@ -3447,7 +3447,8 @@ void TemplateTable::_new() {
__ delayed()->nop();
// bump total bytes allocated by this thread
__ incr_allocated_bytes(Roffset, 0, G1_scratch);
// RoldTopValue and RtopAddr are dead, so can use G1 and G3
__ incr_allocated_bytes(Roffset, G1_scratch, G3_scratch);
}
if (UseTLAB || Universe::heap()->supports_inline_contig_alloc()) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -411,20 +411,6 @@ void SimpleExceptionStub::emit_code(LIR_Assembler* ce) {
}
ArrayStoreExceptionStub::ArrayStoreExceptionStub(CodeEmitInfo* info):
_info(info) {
}
void ArrayStoreExceptionStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
__ bind(_entry);
__ call(RuntimeAddress(Runtime1::entry_for(Runtime1::throw_array_store_exception_id)));
ce->add_call_info_here(_info);
debug_only(__ should_not_reach_here());
}
void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
//---------------slow case: call to native-----------------
__ bind(_entry);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1641,12 +1641,14 @@ void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) {
}
void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
Register len = op->len()->as_register();
LP64_ONLY( __ movslq(len, len); )
if (UseSlowPath ||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
__ jmp(*op->stub()->entry());
} else {
Register len = op->len()->as_register();
Register tmp1 = op->tmp1()->as_register();
Register tmp2 = op->tmp2()->as_register();
Register tmp3 = op->tmp3()->as_register();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -733,8 +733,8 @@ void LIRGenerator::do_AttemptUpdate(Intrinsic* x) {
// generate compare-and-swap; produces zero condition if swap occurs
int value_offset = sun_misc_AtomicLongCSImpl::value_offset();
LIR_Opr addr = obj.result();
__ add(addr, LIR_OprFact::intConst(value_offset), addr);
LIR_Opr addr = new_pointer_register();
__ leal(LIR_OprFact::address(new LIR_Address(obj.result(), value_offset, T_LONG)), addr);
LIR_Opr t1 = LIR_OprFact::illegalOpr; // no temp needed
LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed
__ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2);

View File

@ -1337,7 +1337,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
{ StubFrame f(sasm, "throw_array_store_exception", dont_gc_arguments);
// tos + 0: link
// + 1: return address
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), false);
oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true);
}
break;

View File

@ -62,7 +62,7 @@ define_pd_global(intx, StackRedPages, 1);
// due to lack of optimization caused by C++ compiler bugs
define_pd_global(intx, StackShadowPages, SOLARIS_ONLY(20) NOT_SOLARIS(6) DEBUG_ONLY(+2));
#else
define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+1));
define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+5));
#endif // AMD64
define_pd_global(intx, PreInflateSpin, 10);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -819,7 +819,7 @@ void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& ze
// Set the method data pointer for the current bcp.
void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
assert(ProfileInterpreter, "must be profiling interpreter");
Label zero_continue;
Label set_mdp;
push(rax);
push(rbx);
@ -827,21 +827,17 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
// Test MDO to avoid the call if it is NULL.
movptr(rax, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
testptr(rax, rax);
jcc(Assembler::zero, zero_continue);
jcc(Assembler::zero, set_mdp);
// rbx,: method
// rsi: bcp
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), rbx, rsi);
// rax,: mdi
// mdo is guaranteed to be non-zero here, we checked for it before the call.
movptr(rbx, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
testptr(rbx, rbx);
jcc(Assembler::zero, zero_continue);
addptr(rbx, in_bytes(methodDataOopDesc::data_offset()));
addptr(rbx, rax);
movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rbx);
bind(zero_continue);
addptr(rax, rbx);
bind(set_mdp);
movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
pop(rbx);
pop(rax);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -855,7 +855,7 @@ void InterpreterMacroAssembler::test_method_data_pointer(Register mdp,
// Set the method data pointer for the current bcp.
void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
assert(ProfileInterpreter, "must be profiling interpreter");
Label zero_continue;
Label set_mdp;
push(rax);
push(rbx);
@ -863,21 +863,17 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() {
// Test MDO to avoid the call if it is NULL.
movptr(rax, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
testptr(rax, rax);
jcc(Assembler::zero, zero_continue);
jcc(Assembler::zero, set_mdp);
// rbx: method
// r13: bcp
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), rbx, r13);
// rax: mdi
// mdo is guaranteed to be non-zero here, we checked for it before the call.
movptr(rbx, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
testptr(rbx, rbx);
jcc(Assembler::zero, zero_continue);
addptr(rbx, in_bytes(methodDataOopDesc::data_offset()));
addptr(rbx, rax);
movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rbx);
bind(zero_continue);
addptr(rax, rbx);
bind(set_mdp);
movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
pop(rbx);
pop(rax);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -390,7 +390,7 @@ int MethodHandles::adapter_conversion_ops_supported_mask() {
//
// Generate an "entry" field for a method handle.
// This determines how the method handle will respond to calls.
void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek, TRAPS) {
void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) {
// Here is the register state during an interpreted call,
// as set up by generate_method_handle_interpreter_entry():
// - rbx: garbage temp (was MethodHandle.invoke methodOop, unused)
@ -451,8 +451,9 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan
// exception. Since we use a C2I adapter to set up the
// interpreter state, arguments are expected in compiler
// argument registers.
methodHandle mh(raise_exception_method());
address c2i_entry = methodOopDesc::make_adapters(mh, CHECK);
assert(raise_exception_method(), "must be set");
address c2i_entry = raise_exception_method()->get_c2i_entry();
assert(c2i_entry, "method must be linked");
const Register rdi_pc = rax;
__ pop(rdi_pc); // caller PC

View File

@ -1974,7 +1974,7 @@ nmethod *SharedRuntime::generate_dtrace_nmethod(
in_sig_bt[i++] = bt; // Collect remaining bits of signature
out_sig_bt[total_c_args++] = bt;
if( bt == T_OBJECT) {
symbolOop s = ss.as_symbol_or_null();
Symbol* s = ss.as_symbol_or_null(); // symbol is created
if (s == vmSymbols::java_lang_String()) {
total_strings++;
out_sig_bt[total_c_args-1] = T_ADDRESS;

View File

@ -1980,7 +1980,7 @@ nmethod *SharedRuntime::generate_dtrace_nmethod(MacroAssembler *masm,
in_sig_bt[i++] = bt; // Collect remaining bits of signature
out_sig_bt[total_c_args++] = bt;
if( bt == T_OBJECT) {
symbolOop s = ss.as_symbol_or_null();
Symbol* s = ss.as_symbol_or_null(); // symbol is created
if (s == vmSymbols::java_lang_String()) {
total_strings++;
out_sig_bt[total_c_args-1] = T_ADDRESS;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1367,15 +1367,9 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
if (ProfileInterpreter) {
// We have decided to profile this method in the interpreter
__ bind(profile_method);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), rsi, true);
__ movptr(rbx, Address(rbp, method_offset)); // restore methodOop
__ movptr(rax, Address(rbx, in_bytes(methodOopDesc::method_data_offset())));
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
__ test_method_data_pointer(rax, profile_method_continue);
__ addptr(rax, in_bytes(methodDataOopDesc::data_offset()));
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
__ set_method_data_pointer_for_bcp();
__ get_method(rbx);
__ jmp(profile_method_continue);
}
// Handle overflow of counter and compile method

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1383,20 +1383,9 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
if (ProfileInterpreter) {
// We have decided to profile this method in the interpreter
__ bind(profile_method);
__ call_VM(noreg,
CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method),
r13, true);
__ movptr(rbx, Address(rbp, method_offset)); // restore methodOop
__ movptr(rax, Address(rbx,
in_bytes(methodOopDesc::method_data_offset())));
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize),
rax);
__ test_method_data_pointer(rax, profile_method_continue);
__ addptr(rax, in_bytes(methodDataOopDesc::data_offset()));
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize),
rax);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
__ set_method_data_pointer_for_bcp();
__ get_method(rbx);
__ jmp(profile_method_continue);
}
// Handle overflow of counter and compile method

View File

@ -1665,16 +1665,9 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
if (ProfileInterpreter) {
// Out-of-line code to allocate method data oop.
__ bind(profile_method);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), rsi);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
__ load_unsigned_byte(rbx, Address(rsi, 0)); // restore target bytecode
__ movptr(rcx, Address(rbp, method_offset));
__ movptr(rcx, Address(rcx, in_bytes(methodOopDesc::method_data_offset())));
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rcx);
__ test_method_data_pointer(rcx, dispatch);
// offset non-null mdp by MDO::data_offset() + IR::profile_method()
__ addptr(rcx, in_bytes(methodDataOopDesc::data_offset()));
__ addptr(rcx, rax);
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rcx);
__ set_method_data_pointer_for_bcp();
__ jmp(dispatch);
}

View File

@ -1695,21 +1695,9 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
if (ProfileInterpreter) {
// Out-of-line code to allocate method data oop.
__ bind(profile_method);
__ call_VM(noreg,
CAST_FROM_FN_PTR(address,
InterpreterRuntime::profile_method), r13);
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
__ load_unsigned_byte(rbx, Address(r13, 0)); // restore target bytecode
__ movptr(rcx, Address(rbp, method_offset));
__ movptr(rcx, Address(rcx,
in_bytes(methodOopDesc::method_data_offset())));
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize),
rcx);
__ test_method_data_pointer(rcx, dispatch);
// offset non-null mdp by MDO::data_offset() + IR::profile_method()
__ addptr(rcx, in_bytes(methodDataOopDesc::data_offset()));
__ addptr(rcx, rax);
__ movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize),
rcx);
__ set_method_data_pointer_for_bcp();
__ jmp(dispatch);
}

View File

@ -1610,10 +1610,9 @@ int os::current_process_id() {
const char* os::dll_file_extension() { return ".so"; }
const char* os::get_temp_directory() {
const char *prop = Arguments::get_property("java.io.tmpdir");
return prop == NULL ? "/tmp" : prop;
}
// This must be hard coded because it's the system's temporary
// directory not the java application's temp directory, ala java.io.tmpdir.
const char* os::get_temp_directory() { return "/tmp"; }
static bool file_exists(const char* filename) {
struct stat statbuf;

View File

@ -49,7 +49,7 @@
#include "oops/klass.hpp"
#include "oops/methodOop.hpp"
#include "oops/oop.hpp"
#include "oops/symbolOop.hpp"
#include "oops/symbol.hpp"
#include "runtime/virtualspace.hpp"
#include "runtime/vmStructs.hpp"
#include "utilities/accessFlags.hpp"
@ -215,8 +215,8 @@ int generateJvmOffsets(GEN_variant gen_variant) {
GEN_VALUE(AccessFlags_NATIVE, JVM_ACC_NATIVE);
GEN_VALUE(constMethodOopDesc_has_linenumber_table, constMethodOopDesc::_has_linenumber_table);
GEN_OFFS(AccessFlags, _flags);
GEN_OFFS(symbolOopDesc, _length);
GEN_OFFS(symbolOopDesc, _body);
GEN_OFFS(Symbol, _length);
GEN_OFFS(Symbol, _body);
printf("\n");
GEN_OFFS(methodOopDesc, _constMethod);

View File

@ -114,8 +114,8 @@ dtrace:helper:ustack:
copyin_offset(OFFSET_HeapBlockHeader_used);
copyin_offset(OFFSET_oopDesc_metadata);
copyin_offset(OFFSET_symbolOopDesc_length);
copyin_offset(OFFSET_symbolOopDesc_body);
copyin_offset(OFFSET_Symbol_length);
copyin_offset(OFFSET_Symbol_body);
copyin_offset(OFFSET_methodOopDesc_constMethod);
copyin_offset(OFFSET_methodOopDesc_constants);
@ -366,13 +366,13 @@ dtrace:helper:ustack:
this->nameIndex * sizeof (pointer) + SIZE_constantPoolOopDesc);
this->nameSymbolLength = copyin_uint16(this->nameSymbol +
OFFSET_symbolOopDesc_length);
OFFSET_Symbol_length);
this->signatureSymbol = copyin_ptr(this->constantPool +
this->signatureIndex * sizeof (pointer) + SIZE_constantPoolOopDesc);
this->signatureSymbolLength = copyin_uint16(this->signatureSymbol +
OFFSET_symbolOopDesc_length);
OFFSET_Symbol_length);
this->klassPtr = copyin_ptr(this->constantPool +
OFFSET_constantPoolOopDesc_pool_holder);
@ -381,7 +381,7 @@ dtrace:helper:ustack:
OFFSET_Klass_name + SIZE_oopDesc);
this->klassSymbolLength = copyin_uint16(this->klassSymbol +
OFFSET_symbolOopDesc_length);
OFFSET_Symbol_length);
/*
* Enough for three strings, plus the '.', plus the trailing '\0'.
@ -390,7 +390,7 @@ dtrace:helper:ustack:
this->nameSymbolLength +
this->signatureSymbolLength + 2 + 1);
copyinto(this->klassSymbol + OFFSET_symbolOopDesc_body,
copyinto(this->klassSymbol + OFFSET_Symbol_body,
this->klassSymbolLength, this->result);
/*
@ -398,11 +398,11 @@ dtrace:helper:ustack:
*/
this->result[this->klassSymbolLength] = '.';
copyinto(this->nameSymbol + OFFSET_symbolOopDesc_body,
copyinto(this->nameSymbol + OFFSET_Symbol_body,
this->nameSymbolLength,
this->result + this->klassSymbolLength + 1);
copyinto(this->signatureSymbol + OFFSET_symbolOopDesc_body,
copyinto(this->signatureSymbol + OFFSET_Symbol_body,
this->signatureSymbolLength,
this->result + this->klassSymbolLength +
this->nameSymbolLength + 1);

View File

@ -524,10 +524,10 @@ name_for_methodOop(jvm_agent_t* J, uint64_t methodOopPtr, char * result, size_t
CHECK_FAIL(err);
err = read_pointer(J, constantPool + nameIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &nameSymbol);
CHECK_FAIL(err);
err = ps_pread(J->P, nameSymbol + OFFSET_symbolOopDesc_length, &nameSymbolLength, 2);
err = ps_pread(J->P, nameSymbol + OFFSET_Symbol_length, &nameSymbolLength, 2);
CHECK_FAIL(err);
nameString = (char*)calloc(nameSymbolLength + 1, 1);
err = ps_pread(J->P, nameSymbol + OFFSET_symbolOopDesc_body, nameString, nameSymbolLength);
err = ps_pread(J->P, nameSymbol + OFFSET_Symbol_body, nameString, nameSymbolLength);
CHECK_FAIL(err);
/* To get signature string */
@ -535,10 +535,10 @@ name_for_methodOop(jvm_agent_t* J, uint64_t methodOopPtr, char * result, size_t
CHECK_FAIL(err);
err = read_pointer(J, constantPool + signatureIndex * POINTER_SIZE + SIZE_constantPoolOopDesc, &signatureSymbol);
CHECK_FAIL(err);
err = ps_pread(J->P, signatureSymbol + OFFSET_symbolOopDesc_length, &signatureSymbolLength, 2);
err = ps_pread(J->P, signatureSymbol + OFFSET_Symbol_length, &signatureSymbolLength, 2);
CHECK_FAIL(err);
signatureString = (char*)calloc(signatureSymbolLength + 1, 1);
err = ps_pread(J->P, signatureSymbol + OFFSET_symbolOopDesc_body, signatureString, signatureSymbolLength);
err = ps_pread(J->P, signatureSymbol + OFFSET_Symbol_body, signatureString, signatureSymbolLength);
CHECK_FAIL(err);
/* To get klass string */
@ -546,10 +546,10 @@ name_for_methodOop(jvm_agent_t* J, uint64_t methodOopPtr, char * result, size_t
CHECK_FAIL(err);
err = read_pointer(J, klassPtr + OFFSET_Klass_name + SIZE_oopDesc, &klassSymbol);
CHECK_FAIL(err);
err = ps_pread(J->P, klassSymbol + OFFSET_symbolOopDesc_length, &klassSymbolLength, 2);
err = ps_pread(J->P, klassSymbol + OFFSET_Symbol_length, &klassSymbolLength, 2);
CHECK_FAIL(err);
klassString = (char*)calloc(klassSymbolLength + 1, 1);
err = ps_pread(J->P, klassSymbol + OFFSET_symbolOopDesc_body, klassString, klassSymbolLength);
err = ps_pread(J->P, klassSymbol + OFFSET_Symbol_body, klassString, klassSymbolLength);
CHECK_FAIL(err);
result[0] = '\0';

View File

@ -142,7 +142,7 @@ int DTraceJSDT::pd_activate(
++strcount;
for(int prbc = 0; prbc < provider->probe_count; ++prbc) {
JVM_DTraceProbe* p = &(provider->probes[prbc]);
symbolOop sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
Symbol* sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
// function + name + one per argument
strcount += 2 + ArgumentCount(sig).size();
}
@ -178,7 +178,7 @@ int DTraceJSDT::pd_activate(
stroffs[curstr++] = string_index;
string_index += strlen(name) + 1;
symbolOop sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
Symbol* sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
SignatureStream ss(sig);
for ( ; !ss.at_return_type(); ss.next()) {
BasicType bt = ss.type();
@ -227,7 +227,7 @@ int DTraceJSDT::pd_activate(
uint32_t argscount = 0;
for(int prbc = 0; prbc < provider->probe_count; ++prbc) {
JVM_DTraceProbe* p = &(provider->probes[prbc]);
symbolOop sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
Symbol* sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
argscount += ArgumentCount(sig).size();
}
secoffs[argoffs_sec] = align_size_up(offset, alignment_for[ARG_OFFSETS]);
@ -298,7 +298,7 @@ int DTraceJSDT::pd_activate(
strcpy(str, name);
str += strlen(name) + 1;
symbolOop sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
Symbol* sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
SignatureStream ss(sig);
for ( ; !ss.at_return_type(); ss.next()) {
BasicType bt = ss.type();
@ -433,7 +433,7 @@ int DTraceJSDT::pd_activate(
uint8_t* par = (uint8_t*)(dof + sec->dofs_offset);
for (int prbc = 0; prbc < provider->probe_count; ++prbc) {
JVM_DTraceProbe* p = &(provider->probes[prbc]);
symbolOop sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
Symbol* sig = JNIHandles::resolve_jmethod_id(p->method)->signature();
uint8_t count = (uint8_t)ArgumentCount(sig).size();
for (uint8_t i = 0; i < count; ++i) {
*par++ = i;

View File

@ -1884,10 +1884,9 @@ void os::set_error_file(const char *logfile) {}
const char* os::dll_file_extension() { return ".so"; }
const char* os::get_temp_directory() {
const char *prop = Arguments::get_property("java.io.tmpdir");
return prop == NULL ? "/tmp" : prop;
}
// This must be hard coded because it's the system's temporary
// directory not the java application's temp directory, ala java.io.tmpdir.
const char* os::get_temp_directory() { return "/tmp"; }
static bool file_exists(const char* filename) {
struct stat statbuf;

View File

@ -1044,9 +1044,9 @@ os::closedir(DIR *dirp)
return 0;
}
// This must be hard coded because it's the system's temporary
// directory not the java application's temp directory, ala java.io.tmpdir.
const char* os::get_temp_directory() {
const char *prop = Arguments::get_property("java.io.tmpdir");
if (prop != 0) return prop;
static char path_buf[MAX_PATH];
if (GetTempPath(MAX_PATH, path_buf)>0)
return path_buf;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -54,6 +54,8 @@ inline void Atomic::dec (volatile jint* dest) { (void)add (-1, dest);
inline void Atomic::dec_ptr(volatile intptr_t* dest) { (void)add_ptr(-1, dest); }
inline void Atomic::dec_ptr(volatile void* dest) { (void)add_ptr(-1, dest); }
inline jlong Atomic::load(volatile jlong* src) { return *src; }
inline jint Atomic::add (jint add_value, volatile jint* dest) {
intptr_t rv;
__asm__ volatile(

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -100,11 +100,6 @@ inline jint Atomic::cmpxchg (jint exchange_value, volatile jint*
return exchange_value;
}
extern "C" {
// defined in linux_x86.s
jlong _Atomic_cmpxchg_long(jlong, volatile jlong*, jlong, bool);
}
#ifdef AMD64
inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
@ -164,9 +159,9 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void*
return (void*)cmpxchg((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value);
}
#else
//inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
//inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
inline jlong Atomic::load(volatile jlong* src) { return *src; }
#else // !AMD64
inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
return (intptr_t)Atomic::add((jint)add_value, (volatile jint*)dest);
@ -189,6 +184,12 @@ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* des
return (intptr_t)xchg((jint)exchange_value, (volatile jint*)dest);
}
extern "C" {
// defined in linux_x86.s
jlong _Atomic_cmpxchg_long(jlong, volatile jlong*, jlong, bool);
void _Atomic_move_long(volatile jlong* src, volatile jlong* dst);
}
inline jlong Atomic::cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value) {
return _Atomic_cmpxchg_long(exchange_value, dest, compare_value, os::is_MP());
}
@ -200,6 +201,21 @@ inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t*
inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) {
return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value);
}
inline jlong Atomic::load(volatile jlong* src) {
volatile jlong dest;
_Atomic_move_long(src, &dest);
return dest;
}
inline void Atomic::store(jlong store_value, jlong* dest) {
_Atomic_move_long((volatile jlong*)&store_value, (volatile jlong*)dest);
}
inline void Atomic::store(jlong store_value, volatile jlong* dest) {
_Atomic_move_long((volatile jlong*)&store_value, dest);
}
#endif // AMD64
#endif // OS_CPU_LINUX_X86_VM_ATOMIC_LINUX_X86_INLINE_HPP

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -38,6 +38,7 @@
.globl _mmx_Copy_arrayof_conjoint_jshorts
.globl _Atomic_cmpxchg_long
.globl _Atomic_move_long
.text
@ -653,3 +654,15 @@ _Atomic_cmpxchg_long:
popl %ebx
ret
# Support for jlong Atomic::load and Atomic::store.
# void _Atomic_move_long(volatile jlong* src, volatile jlong* dst)
.p2align 4,,15
.type _Atomic_move_long,@function
_Atomic_move_long:
movl 4(%esp), %eax # src
fildll (%eax)
movl 8(%esp), %eax # dest
fistpll (%eax)
ret

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#ifndef OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
#define OS_CPU_LINUX_X86_VM_ORDERACCESS_LINUX_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.hpp"
#include "vm_version_x86.hpp"
@ -64,11 +65,11 @@ inline void OrderAccess::fence() {
inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { return *p; }
inline jshort OrderAccess::load_acquire(volatile jshort* p) { return *p; }
inline jint OrderAccess::load_acquire(volatile jint* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return Atomic::load(p); }
inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { return *p; }
inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return Atomic::load((volatile jlong*)p); }
inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
@ -79,11 +80,11 @@ inline void* OrderAccess::load_ptr_acquire(const volatile void* p) { return *
inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jshort* p, jshort v) { *p = v; }
inline void OrderAccess::release_store(volatile jint* p, jint v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { Atomic::store(v, p); }
inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p = v; }
inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { Atomic::store((jlong)v, (volatile jlong*)p); }
inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
@ -178,7 +179,7 @@ inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v)
: "0" (v), "r" (p)
: "memory");
#else
*p = v; fence();
release_store(p, v); fence();
#endif // AMD64
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,14 +35,12 @@
inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; }
inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; }
inline void Atomic::store (jint store_value, jint* dest) { *dest = store_value; }
inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; }
inline void Atomic::store_ptr(void* store_value, void* dest) { *(void**)dest = store_value; }
inline void Atomic::store (jbyte store_value, volatile jbyte* dest) { *dest = store_value; }
inline void Atomic::store (jshort store_value, volatile jshort* dest) { *dest = store_value; }
inline void Atomic::store (jint store_value, volatile jint* dest) { *dest = store_value; }
inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
inline void Atomic::store_ptr(void* store_value, volatile void* dest) { *(void* volatile *)dest = store_value; }
@ -54,8 +52,49 @@ inline void Atomic::dec (volatile jint* dest) { (void)add (-1, dest);
inline void Atomic::dec_ptr(volatile intptr_t* dest) { (void)add_ptr(-1, dest); }
inline void Atomic::dec_ptr(volatile void* dest) { (void)add_ptr(-1, dest); }
#ifdef _LP64
inline void Atomic::store(jlong store_value, jlong* dest) { *dest = store_value; }
inline void Atomic::store(jlong store_value, volatile jlong* dest) { *dest = store_value; }
inline jlong Atomic::load(volatile jlong* src) { return *src; }
#else
extern "C" void _Atomic_move_long_v8(volatile jlong* src, volatile jlong* dst);
extern "C" void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst);
inline void Atomic_move_long(volatile jlong* src, volatile jlong* dst) {
#ifdef COMPILER2
// Compiler2 does not support v8, it is used only for v9.
assert (VM_Version::v9_instructions_work(), "only supported on v9");
_Atomic_move_long_v9(src, dst);
#else
// The branch is cheaper then emulated LDD.
if (VM_Version::v9_instructions_work()) {
_Atomic_move_long_v9(src, dst);
} else {
_Atomic_move_long_v8(src, dst);
}
#endif
}
inline jlong Atomic::load(volatile jlong* src) {
volatile jlong dest;
Atomic_move_long(src, &dest);
return dest;
}
inline void Atomic::store(jlong store_value, jlong* dest) {
Atomic_move_long((volatile jlong*)&store_value, (volatile jlong*)dest);
}
inline void Atomic::store(jlong store_value, volatile jlong* dest) {
Atomic_move_long((volatile jlong*)&store_value, dest);
}
#endif
#ifdef _GNU_SOURCE
inline jint Atomic::add (jint add_value, volatile jint* dest) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -77,11 +77,11 @@ inline void OrderAccess::fence() {
inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { return *p; }
inline jshort OrderAccess::load_acquire(volatile jshort* p) { return *p; }
inline jint OrderAccess::load_acquire(volatile jint* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return Atomic::load(p); }
inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { return *p; }
inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return Atomic::load((volatile jlong*)p); }
inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
@ -92,11 +92,11 @@ inline void* OrderAccess::load_ptr_acquire(const volatile void* p) { return *
inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jshort* p, jshort v) { *p = v; }
inline void OrderAccess::release_store(volatile jint* p, jint v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { Atomic::store(v, p); }
inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p = v; }
inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { Atomic::store((jlong)v, (volatile jlong*)p); }
inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
@ -120,11 +120,11 @@ inline void OrderAccess::store_ptr_fence(void** p, void* v) { *p = v;
inline void OrderAccess::release_store_fence(volatile jbyte* p, jbyte v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jshort* p, jshort v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jint* p, jint v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { release_store(p, v); fence(); }
inline void OrderAccess::release_store_fence(volatile jubyte* p, jubyte v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jushort* p, jushort v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile juint* p, juint v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { release_store(p, v); fence(); }
inline void OrderAccess::release_store_fence(volatile jfloat* p, jfloat v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@ -152,6 +152,39 @@
.nonvolatile
.end
// Support for jlong Atomic::load and Atomic::store on v8.
//
// void _Atomic_move_long_v8(volatile jlong* src, volatile jlong* dst)
//
// Arguments:
// src: O0
// dest: O1
//
// Overwrites O2 and O3
.inline _Atomic_move_long_v8,2
.volatile
ldd [%o0], %o2
std %o2, [%o1]
.nonvolatile
.end
// Support for jlong Atomic::load and Atomic::store on v9.
//
// void _Atomic_move_long_v9(volatile jlong* src, volatile jlong* dst)
//
// Arguments:
// src: O0
// dest: O1
//
// Overwrites O2
.inline _Atomic_move_long_v9,2
.volatile
ldx [%o0], %o2
stx %o2, [%o1]
.nonvolatile
.end
// Support for jint Atomic::add(jint add_value, volatile jint* dest).
//

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -151,14 +151,22 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void*
return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value);
}
extern "C" void _Atomic_load_long(volatile jlong* src, volatile jlong* dst);
extern "C" void _Atomic_move_long(volatile jlong* src, volatile jlong* dst);
inline jlong Atomic::load(volatile jlong* src) {
volatile jlong dest;
_Atomic_load_long(src, &dest);
_Atomic_move_long(src, &dest);
return dest;
}
inline void Atomic::store(jlong store_value, jlong* dest) {
_Atomic_move_long((volatile jlong*)&store_value, (volatile jlong*)dest);
}
inline void Atomic::store(jlong store_value, volatile jlong* dest) {
_Atomic_move_long((volatile jlong*)&store_value, dest);
}
#endif // AMD64
#ifdef _GNU_SOURCE

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#ifndef OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
#define OS_CPU_SOLARIS_X86_VM_ORDERACCESS_SOLARIS_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.hpp"
#include "vm_version_x86.hpp"
@ -80,11 +81,11 @@ extern "C" {
inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { return *p; }
inline jshort OrderAccess::load_acquire(volatile jshort* p) { return *p; }
inline jint OrderAccess::load_acquire(volatile jint* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return Atomic::load(p); }
inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { return *p; }
inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return Atomic::load((volatile jlong*)p); }
inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
@ -95,11 +96,11 @@ inline void* OrderAccess::load_ptr_acquire(const volatile void* p) { return *
inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jshort* p, jshort v) { *p = v; }
inline void OrderAccess::release_store(volatile jint* p, jint v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { Atomic::store(v, p); }
inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p = v; }
inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { Atomic::store((jlong)v, (volatile jlong*)p); }
inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
@ -123,11 +124,11 @@ inline void OrderAccess::store_ptr_fence(void** p, void* v) { *p = v;
inline void OrderAccess::release_store_fence(volatile jbyte* p, jbyte v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jshort* p, jshort v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jint* p, jint v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { release_store(p, v); fence(); }
inline void OrderAccess::release_store_fence(volatile jubyte* p, jubyte v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jushort* p, jushort v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile juint* p, juint v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile julong* p, julong v) { release_store(p, v); fence(); }
inline void OrderAccess::release_store_fence(volatile jfloat* p, jfloat v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jdouble* p, jdouble v) { *p = v; fence(); }

View File

@ -1,5 +1,5 @@
//
// Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This code is free software; you can redistribute it and/or modify it
@ -104,8 +104,9 @@
popl %ebx
.end
// Support for void Atomic::load(volatile jlong* src, volatile jlong* dest).
.inline _Atomic_load_long,2
// Support for jlong Atomic::load and Atomic::store.
// void _Atomic_move_long(volatile jlong* src, volatile jlong* dst)
.inline _Atomic_move_long,2
movl 0(%esp), %eax // src
fildll (%eax)
movl 4(%esp), %eax // dest

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -137,10 +137,10 @@ inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void*
return (void*)cmpxchg((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value);
}
inline jlong Atomic::load(volatile jlong* src) { return *src; }
#else // !AMD64
//inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
//inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
inline jint Atomic::add (jint add_value, volatile jint* dest) {
int mp = os::is_MP();
__asm {
@ -254,6 +254,33 @@ inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t*
inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) {
return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value);
}
inline jlong Atomic::load(volatile jlong* src) {
volatile jlong dest;
volatile jlong* pdest = &dest;
__asm {
mov eax, src
fild qword ptr [eax]
mov eax, pdest
fistp qword ptr [eax]
}
return dest;
}
inline void Atomic::store(jlong store_value, volatile jlong* dest) {
volatile jlong* src = &store_value;
__asm {
mov eax, src
fild qword ptr [eax]
mov eax, dest
fistp qword ptr [eax]
}
}
inline void Atomic::store(jlong store_value, jlong* dest) {
Atomic::store(store_value, (volatile jlong*)dest);
}
#endif // AMD64
#pragma warning(default: 4035) // Enables warnings reporting missing return statement

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
#ifndef OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
#define OS_CPU_WINDOWS_X86_VM_ORDERACCESS_WINDOWS_X86_INLINE_HPP
#include "runtime/atomic.hpp"
#include "runtime/orderAccess.hpp"
#include "vm_version_x86.hpp"
@ -65,11 +66,11 @@ inline void OrderAccess::fence() {
inline jbyte OrderAccess::load_acquire(volatile jbyte* p) { return *p; }
inline jshort OrderAccess::load_acquire(volatile jshort* p) { return *p; }
inline jint OrderAccess::load_acquire(volatile jint* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return *p; }
inline jlong OrderAccess::load_acquire(volatile jlong* p) { return Atomic::load(p); }
inline jubyte OrderAccess::load_acquire(volatile jubyte* p) { return *p; }
inline jushort OrderAccess::load_acquire(volatile jushort* p) { return *p; }
inline juint OrderAccess::load_acquire(volatile juint* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return *p; }
inline julong OrderAccess::load_acquire(volatile julong* p) { return Atomic::load((volatile jlong*)p); }
inline jfloat OrderAccess::load_acquire(volatile jfloat* p) { return *p; }
inline jdouble OrderAccess::load_acquire(volatile jdouble* p) { return *p; }
@ -80,11 +81,11 @@ inline void* OrderAccess::load_ptr_acquire(const volatile void* p) { return *
inline void OrderAccess::release_store(volatile jbyte* p, jbyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jshort* p, jshort v) { *p = v; }
inline void OrderAccess::release_store(volatile jint* p, jint v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { *p = v; }
inline void OrderAccess::release_store(volatile jlong* p, jlong v) { Atomic::store(v, p); }
inline void OrderAccess::release_store(volatile jubyte* p, jubyte v) { *p = v; }
inline void OrderAccess::release_store(volatile jushort* p, jushort v) { *p = v; }
inline void OrderAccess::release_store(volatile juint* p, juint v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { *p = v; }
inline void OrderAccess::release_store(volatile julong* p, julong v) { Atomic::store((jlong)v, (volatile jlong*)p); }
inline void OrderAccess::release_store(volatile jfloat* p, jfloat v) { *p = v; }
inline void OrderAccess::release_store(volatile jdouble* p, jdouble v) { *p = v; }
@ -188,7 +189,7 @@ inline void OrderAccess::release_store_fence(volatile jint* p, jint v) {
#endif // AMD64
}
inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { *p = v; fence(); }
inline void OrderAccess::release_store_fence(volatile jlong* p, jlong v) { release_store(p, v); fence(); }
inline void OrderAccess::release_store_fence(volatile jubyte* p, jubyte v) { release_store_fence((volatile jbyte*)p, (jbyte)v); }
inline void OrderAccess::release_store_fence(volatile jushort* p, jushort v) { release_store_fence((volatile jshort*)p, (jshort)v); }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -898,4 +898,4 @@ void Canonicalizer::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {}
void Canonicalizer::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
void Canonicalizer::do_ProfileCall(ProfileCall* x) {}
void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {}
void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -102,6 +102,7 @@ class Canonicalizer: InstructionVisitor {
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
};
#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -476,18 +476,12 @@ class SimpleExceptionStub: public CodeStub {
class ArrayStoreExceptionStub: public CodeStub {
class ArrayStoreExceptionStub: public SimpleExceptionStub {
private:
CodeEmitInfo* _info;
public:
ArrayStoreExceptionStub(CodeEmitInfo* info);
virtual void emit_code(LIR_Assembler* emit);
virtual CodeEmitInfo* info() const { return _info; }
virtual bool is_exception_throw_stub() const { return true; }
virtual void visit(LIR_OpVisitState* visitor) {
visitor->do_slow_case(_info);
}
ArrayStoreExceptionStub(LIR_Opr obj, CodeEmitInfo* info): SimpleExceptionStub(Runtime1::throw_array_store_exception_id, obj, info) {}
#ifndef PRODUCT
virtual void print_name(outputStream* out) const { out->print("ArrayStoreExceptionStub"); }
#endif // PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -319,24 +319,24 @@ void BlockListBuilder::set_leaders() {
case Bytecodes::_tableswitch: {
// set block for each case
Bytecode_tableswitch *switch_ = Bytecode_tableswitch_at(s.cur_bcp());
int l = switch_->length();
Bytecode_tableswitch sw(&s);
int l = sw.length();
for (int i = 0; i < l; i++) {
make_block_at(cur_bci + switch_->dest_offset_at(i), current);
make_block_at(cur_bci + sw.dest_offset_at(i), current);
}
make_block_at(cur_bci + switch_->default_offset(), current);
make_block_at(cur_bci + sw.default_offset(), current);
current = NULL;
break;
}
case Bytecodes::_lookupswitch: {
// set block for each case
Bytecode_lookupswitch *switch_ = Bytecode_lookupswitch_at(s.cur_bcp());
int l = switch_->number_of_pairs();
Bytecode_lookupswitch sw(&s);
int l = sw.number_of_pairs();
for (int i = 0; i < l; i++) {
make_block_at(cur_bci + switch_->pair_at(i)->offset(), current);
make_block_at(cur_bci + sw.pair_at(i).offset(), current);
}
make_block_at(cur_bci + switch_->default_offset(), current);
make_block_at(cur_bci + sw.default_offset(), current);
current = NULL;
break;
}
@ -1275,15 +1275,15 @@ void GraphBuilder::ret(int local_index) {
void GraphBuilder::table_switch() {
Bytecode_tableswitch* switch_ = Bytecode_tableswitch_at(method()->code() + bci());
const int l = switch_->length();
Bytecode_tableswitch sw(stream());
const int l = sw.length();
if (CanonicalizeNodes && l == 1) {
// total of 2 successors => use If instead of switch
// Note: This code should go into the canonicalizer as soon as it can
// can handle canonicalized forms that contain more than one node.
Value key = append(new Constant(new IntConstant(switch_->low_key())));
BlockBegin* tsux = block_at(bci() + switch_->dest_offset_at(0));
BlockBegin* fsux = block_at(bci() + switch_->default_offset());
Value key = append(new Constant(new IntConstant(sw.low_key())));
BlockBegin* tsux = block_at(bci() + sw.dest_offset_at(0));
BlockBegin* fsux = block_at(bci() + sw.default_offset());
bool is_bb = tsux->bci() < bci() || fsux->bci() < bci();
ValueStack* state_before = is_bb ? copy_state_before() : NULL;
append(new If(ipop(), If::eql, true, key, tsux, fsux, state_before, is_bb));
@ -1293,29 +1293,29 @@ void GraphBuilder::table_switch() {
int i;
bool has_bb = false;
for (i = 0; i < l; i++) {
sux->at_put(i, block_at(bci() + switch_->dest_offset_at(i)));
if (switch_->dest_offset_at(i) < 0) has_bb = true;
sux->at_put(i, block_at(bci() + sw.dest_offset_at(i)));
if (sw.dest_offset_at(i) < 0) has_bb = true;
}
// add default successor
sux->at_put(i, block_at(bci() + switch_->default_offset()));
sux->at_put(i, block_at(bci() + sw.default_offset()));
ValueStack* state_before = has_bb ? copy_state_before() : NULL;
append(new TableSwitch(ipop(), sux, switch_->low_key(), state_before, has_bb));
append(new TableSwitch(ipop(), sux, sw.low_key(), state_before, has_bb));
}
}
void GraphBuilder::lookup_switch() {
Bytecode_lookupswitch* switch_ = Bytecode_lookupswitch_at(method()->code() + bci());
const int l = switch_->number_of_pairs();
Bytecode_lookupswitch sw(stream());
const int l = sw.number_of_pairs();
if (CanonicalizeNodes && l == 1) {
// total of 2 successors => use If instead of switch
// Note: This code should go into the canonicalizer as soon as it can
// can handle canonicalized forms that contain more than one node.
// simplify to If
LookupswitchPair* pair = switch_->pair_at(0);
Value key = append(new Constant(new IntConstant(pair->match())));
BlockBegin* tsux = block_at(bci() + pair->offset());
BlockBegin* fsux = block_at(bci() + switch_->default_offset());
LookupswitchPair pair = sw.pair_at(0);
Value key = append(new Constant(new IntConstant(pair.match())));
BlockBegin* tsux = block_at(bci() + pair.offset());
BlockBegin* fsux = block_at(bci() + sw.default_offset());
bool is_bb = tsux->bci() < bci() || fsux->bci() < bci();
ValueStack* state_before = is_bb ? copy_state_before() : NULL;
append(new If(ipop(), If::eql, true, key, tsux, fsux, state_before, is_bb));
@ -1326,13 +1326,13 @@ void GraphBuilder::lookup_switch() {
int i;
bool has_bb = false;
for (i = 0; i < l; i++) {
LookupswitchPair* pair = switch_->pair_at(i);
if (pair->offset() < 0) has_bb = true;
sux->at_put(i, block_at(bci() + pair->offset()));
keys->at_put(i, pair->match());
LookupswitchPair pair = sw.pair_at(i);
if (pair.offset() < 0) has_bb = true;
sux->at_put(i, block_at(bci() + pair.offset()));
keys->at_put(i, pair.match());
}
// add default successor
sux->at_put(i, block_at(bci() + switch_->default_offset()));
sux->at_put(i, block_at(bci() + sw.default_offset()));
ValueStack* state_before = has_bb ? copy_state_before() : NULL;
append(new LookupSwitch(ipop(), sux, keys, state_before, has_bb));
}
@ -1396,6 +1396,13 @@ void GraphBuilder::method_return(Value x) {
if (continuation() != NULL) {
assert(!method()->is_synchronized() || InlineSynchronizedMethods, "can not inline synchronized methods yet");
if (compilation()->env()->dtrace_method_probes()) {
// Report exit from inline methods
Values* args = new Values(1);
args->push(append(new Constant(new ObjectConstant(method()))));
append(new RuntimeCall(voidType, "dtrace_method_exit", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), args));
}
// If the inlined method is synchronized, the monitor must be
// released before we jump to the continuation block.
if (method()->is_synchronized()) {
@ -3301,6 +3308,13 @@ void GraphBuilder::fill_sync_handler(Value lock, BlockBegin* sync_handler, bool
Value exception = append_with_bci(new ExceptionObject(), SynchronizationEntryBCI);
assert(exception->is_pinned(), "must be");
if (compilation()->env()->dtrace_method_probes()) {
// Report exit from inline methods
Values* args = new Values(1);
args->push(append(new Constant(new ObjectConstant(method()))));
append(new RuntimeCall(voidType, "dtrace_method_exit", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), args));
}
int bci = SynchronizationEntryBCI;
if (lock) {
assert(state()->locks_size() > 0 && state()->lock_at(state()->locks_size() - 1) == lock, "lock is missing");
@ -3486,6 +3500,11 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known) {
inline_sync_entry(lock, sync_handler);
}
if (compilation()->env()->dtrace_method_probes()) {
Values* args = new Values(1);
args->push(append(new Constant(new ObjectConstant(method()))));
append(new RuntimeCall(voidType, "dtrace_method_entry", CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), args));
}
BlockBegin* callee_start_block = block_at(0);
if (callee_start_block != NULL) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -106,6 +106,7 @@ class UnsafePrefetchRead;
class UnsafePrefetchWrite;
class ProfileCall;
class ProfileInvoke;
class RuntimeCall;
// A Value is a reference to the instruction creating the value
typedef Instruction* Value;
@ -202,6 +203,7 @@ class InstructionVisitor: public StackObj {
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0;
virtual void do_ProfileCall (ProfileCall* x) = 0;
virtual void do_ProfileInvoke (ProfileInvoke* x) = 0;
virtual void do_RuntimeCall (RuntimeCall* x) = 0;
};
@ -2267,6 +2269,38 @@ LEAF(ProfileCall, Instruction)
virtual void input_values_do(ValueVisitor* f) { if (_recv != NULL) f->visit(&_recv); }
};
// Call some C runtime function that doesn't safepoint,
// optionally passing the current thread as the first argument.
LEAF(RuntimeCall, Instruction)
private:
const char* _entry_name;
address _entry;
Values* _args;
bool _pass_thread; // Pass the JavaThread* as an implicit first argument
public:
RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
: Instruction(type)
, _entry(entry)
, _args(args)
, _entry_name(entry_name)
, _pass_thread(pass_thread) {
ASSERT_VALUES
pin();
}
const char* entry_name() const { return _entry_name; }
address entry() const { return _entry; }
int number_of_arguments() const { return _args->length(); }
Value argument_at(int i) const { return _args->at(i); }
bool pass_thread() const { return _pass_thread; }
virtual void input_values_do(ValueVisitor* f) {
for (int i = 0; i < _args->length(); i++) f->visit(_args->adr_at(i));
}
};
// Use to trip invocation counter of an inlined method
LEAF(ProfileInvoke, Instruction)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -841,4 +841,13 @@ void InstructionPrinter::do_ProfileInvoke(ProfileInvoke* x) {
}
void InstructionPrinter::do_RuntimeCall(RuntimeCall* x) {
output()->print("call_rt %s(", x->entry_name());
for (int i = 0; i < x->number_of_arguments(); i++) {
if (i > 0) output()->print(", ");
print_value(x->argument_at(i));
}
output()->put(')');
}
#endif // PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -131,6 +131,7 @@ class InstructionPrinter: public InstructionVisitor {
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
};
#endif // PRODUCT

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -396,7 +396,7 @@ LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr object, LIR_Opr array, L
, _should_profile(false)
{
if (code == lir_store_check) {
_stub = new ArrayStoreExceptionStub(info_for_exception);
_stub = new ArrayStoreExceptionStub(object, info_for_exception);
assert(info_for_exception != NULL, "store_check throws exceptions");
} else {
ShouldNotReachHere();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1990,9 +1990,8 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) {
LIR_Opr reg = reg = rlock_result(x, x->basic_type());
if (x->is_volatile() && os::is_MP()) __ membar_acquire();
get_Object_unsafe(reg, src.result(), off.result(), type, x->is_volatile());
if (x->is_volatile() && os::is_MP()) __ membar();
if (x->is_volatile() && os::is_MP()) __ membar_acquire();
}
@ -2014,6 +2013,7 @@ void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) {
if (x->is_volatile() && os::is_MP()) __ membar_release();
put_Object_unsafe(src.result(), off.result(), data.result(), type, x->is_volatile());
if (x->is_volatile() && os::is_MP()) __ membar();
}
@ -2741,6 +2741,31 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
}
}
void LIRGenerator::do_RuntimeCall(RuntimeCall* x) {
LIR_OprList* args = new LIR_OprList(x->number_of_arguments());
BasicTypeList* signature = new BasicTypeList(x->number_of_arguments());
if (x->pass_thread()) {
signature->append(T_ADDRESS);
args->append(getThreadPointer());
}
for (int i = 0; i < x->number_of_arguments(); i++) {
Value a = x->argument_at(i);
LIRItem* item = new LIRItem(a, this);
item->load_item();
args->append(item->result());
signature->append(as_BasicType(a->type()));
}
LIR_Opr result = call_runtime(signature, args, x->entry(), x->type(), NULL);
if (x->type() == voidType) {
set_no_result(x);
} else {
__ move(result, rlock_result(x));
}
}
LIR_Opr LIRGenerator::call_runtime(Value arg1, address entry, ValueType* result_type, CodeEmitInfo* info) {
LIRItemList args(1);
LIRItem value(arg1, this);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -522,6 +522,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
virtual void do_ProfileCall (ProfileCall* x);
virtual void do_ProfileInvoke (ProfileInvoke* x);
virtual void do_RuntimeCall (RuntimeCall* x);
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -496,6 +496,7 @@ public:
void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
void do_ProfileCall (ProfileCall* x);
void do_ProfileInvoke (ProfileInvoke* x);
void do_RuntimeCall (RuntimeCall* x);
};
@ -664,6 +665,7 @@ void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead* x) {}
void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
void NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); }
void NullCheckVisitor::do_ProfileInvoke (ProfileInvoke* x) {}
void NullCheckVisitor::do_RuntimeCall (RuntimeCall* x) {}
void NullCheckEliminator::visit(Value* p) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -339,8 +339,10 @@ JRT_ENTRY(void, Runtime1::unimplemented_entry(JavaThread* thread, StubID id))
JRT_END
JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread))
THROW(vmSymbolHandles::java_lang_ArrayStoreException());
JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread, oopDesc* obj))
ResourceMark rm(thread);
const char* klass_name = Klass::cast(obj->klass())->external_name();
SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name);
JRT_END
@ -369,7 +371,7 @@ static nmethod* counter_overflow_helper(JavaThread* THREAD, int branch_bci, meth
if (branch_bci != InvocationEntryBci) {
// Compute desination bci
address pc = method()->code_base() + branch_bci;
Bytecodes::Code branch = Bytecodes::code_at(pc, method());
Bytecodes::Code branch = Bytecodes::code_at(method(), pc);
int offset = 0;
switch (branch) {
case Bytecodes::_if_icmplt: case Bytecodes::_iflt:
@ -659,14 +661,14 @@ JRT_END
static klassOop resolve_field_return_klass(methodHandle caller, int bci, TRAPS) {
Bytecode_field* field_access = Bytecode_field_at(caller, bci);
Bytecode_field field_access(caller, bci);
// This can be static or non-static field access
Bytecodes::Code code = field_access->code();
Bytecodes::Code code = field_access.code();
// We must load class, initialize class and resolvethe field
FieldAccessInfo result; // initialize class if needed
constantPoolHandle constants(THREAD, caller->constants());
LinkResolver::resolve_field(result, constants, field_access->index(), Bytecodes::java_code(code), false, CHECK_NULL);
LinkResolver::resolve_field(result, constants, field_access.index(), Bytecodes::java_code(code), false, CHECK_NULL);
return result.klass()();
}
@ -767,7 +769,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
Events::log("patch_code @ " INTPTR_FORMAT , caller_frame.pc());
Bytecodes::Code code = Bytecode_at(caller_method->bcp_from(bci))->java_code();
Bytecodes::Code code = caller_method()->java_code_at(bci);
#ifndef PRODUCT
// this is used by assertions in the access_field_patching_id
@ -779,11 +781,11 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
Handle load_klass(THREAD, NULL); // oop needed by load_klass_patching code
if (stub_id == Runtime1::access_field_patching_id) {
Bytecode_field* field_access = Bytecode_field_at(caller_method, bci);
Bytecode_field field_access(caller_method, bci);
FieldAccessInfo result; // initialize class if needed
Bytecodes::Code code = field_access->code();
Bytecodes::Code code = field_access.code();
constantPoolHandle constants(THREAD, caller_method->constants());
LinkResolver::resolve_field(result, constants, field_access->index(), Bytecodes::java_code(code), false, CHECK);
LinkResolver::resolve_field(result, constants, field_access.index(), Bytecodes::java_code(code), false, CHECK);
patch_field_offset = result.field_offset();
// If we're patching a field which is volatile then at compile it
@ -811,36 +813,36 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i
}
break;
case Bytecodes::_new:
{ Bytecode_new* bnew = Bytecode_new_at(caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(bnew->index(), CHECK);
{ Bytecode_new bnew(caller_method(), caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(bnew.index(), CHECK);
}
break;
case Bytecodes::_multianewarray:
{ Bytecode_multianewarray* mna = Bytecode_multianewarray_at(caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(mna->index(), CHECK);
{ Bytecode_multianewarray mna(caller_method(), caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(mna.index(), CHECK);
}
break;
case Bytecodes::_instanceof:
{ Bytecode_instanceof* io = Bytecode_instanceof_at(caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(io->index(), CHECK);
{ Bytecode_instanceof io(caller_method(), caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(io.index(), CHECK);
}
break;
case Bytecodes::_checkcast:
{ Bytecode_checkcast* cc = Bytecode_checkcast_at(caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(cc->index(), CHECK);
{ Bytecode_checkcast cc(caller_method(), caller_method->bcp_from(bci));
k = caller_method->constants()->klass_at(cc.index(), CHECK);
}
break;
case Bytecodes::_anewarray:
{ Bytecode_anewarray* anew = Bytecode_anewarray_at(caller_method->bcp_from(bci));
klassOop ek = caller_method->constants()->klass_at(anew->index(), CHECK);
{ Bytecode_anewarray anew(caller_method(), caller_method->bcp_from(bci));
klassOop ek = caller_method->constants()->klass_at(anew.index(), CHECK);
k = Klass::cast(ek)->array_klass(CHECK);
}
break;
case Bytecodes::_ldc:
case Bytecodes::_ldc_w:
{
Bytecode_loadconstant* cc = Bytecode_loadconstant_at(caller_method, bci);
k = cc->resolve_constant(CHECK);
Bytecode_loadconstant cc(caller_method, bci);
k = cc.resolve_constant(CHECK);
assert(k != NULL && !k->is_klass(), "must be class mirror or other Java constant");
}
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -143,9 +143,9 @@ class Runtime1: public AllStatic {
static void throw_index_exception(JavaThread* thread, int index);
static void throw_div0_exception(JavaThread* thread);
static void throw_null_pointer_exception(JavaThread* thread);
static void throw_class_cast_exception(JavaThread* thread, oopDesc* obect);
static void throw_class_cast_exception(JavaThread* thread, oopDesc* object);
static void throw_incompatible_class_change_error(JavaThread* thread);
static void throw_array_store_exception(JavaThread* thread);
static void throw_array_store_exception(JavaThread* thread, oopDesc* object);
static void monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock);
static void monitorexit (JavaThread* thread, BasicObjectLock* lock);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -192,11 +192,12 @@ class ValueNumberingVisitor: public InstructionVisitor {
void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
void do_RoundFP (RoundFP* x) { /* nothing to do */ }
void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ }
void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ };
void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ }
void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }
void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }
void do_ProfileInvoke (ProfileInvoke* x) { /* nothing to do */ };
void do_RuntimeCall (RuntimeCall* x) { /* nothing to do */ };
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -233,6 +233,10 @@ void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod*
// compute size of arguments
int arg_size = target->arg_size();
if (code == Bytecodes::_invokedynamic) {
assert(!target->is_static(), "receiver explicit in method");
arg_size--; // implicit, not really on stack
}
if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
arg_size--;
}
@ -250,6 +254,10 @@ void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod*
ArgumentMap arg = state._stack[i];
skip_callee = !is_argument(arg) || !is_arg_stack(arg) || (directly_recursive && arg.is_singleton(i - arg_base));
}
// For now we conservatively skip invokedynamic.
if (code == Bytecodes::_invokedynamic) {
skip_callee = true;
}
if (skip_callee) {
TRACE_BCEA(3, tty->print_cr("[EA] skipping method %s::%s", holder->name()->as_utf8(), target->name()->as_utf8()));
for (i = 0; i < arg_size; i++) {
@ -761,15 +769,15 @@ void BCEscapeAnalyzer::iterate_one_block(ciBlock *blk, StateInfo &state, Growabl
case Bytecodes::_tableswitch:
{
state.spop();
Bytecode_tableswitch* switch_ = Bytecode_tableswitch_at(s.cur_bcp());
int len = switch_->length();
Bytecode_tableswitch sw(&s);
int len = sw.length();
int dest_bci;
for (int i = 0; i < len; i++) {
dest_bci = s.cur_bci() + switch_->dest_offset_at(i);
dest_bci = s.cur_bci() + sw.dest_offset_at(i);
assert(_methodBlocks->is_block_start(dest_bci), "branch destination must start a block");
successors.push(_methodBlocks->block_containing(dest_bci));
}
dest_bci = s.cur_bci() + switch_->default_offset();
dest_bci = s.cur_bci() + sw.default_offset();
assert(_methodBlocks->is_block_start(dest_bci), "branch destination must start a block");
successors.push(_methodBlocks->block_containing(dest_bci));
assert(s.next_bci() == limit_bci, "branch must end block");
@ -779,15 +787,15 @@ void BCEscapeAnalyzer::iterate_one_block(ciBlock *blk, StateInfo &state, Growabl
case Bytecodes::_lookupswitch:
{
state.spop();
Bytecode_lookupswitch* switch_ = Bytecode_lookupswitch_at(s.cur_bcp());
int len = switch_->number_of_pairs();
Bytecode_lookupswitch sw(&s);
int len = sw.number_of_pairs();
int dest_bci;
for (int i = 0; i < len; i++) {
dest_bci = s.cur_bci() + switch_->pair_at(i)->offset();
dest_bci = s.cur_bci() + sw.pair_at(i).offset();
assert(_methodBlocks->is_block_start(dest_bci), "branch destination must start a block");
successors.push(_methodBlocks->block_containing(dest_bci));
}
dest_bci = s.cur_bci() + switch_->default_offset();
dest_bci = s.cur_bci() + sw.default_offset();
assert(_methodBlocks->is_block_start(dest_bci), "branch destination must start a block");
successors.push(_methodBlocks->block_containing(dest_bci));
fall_through = false;

View File

@ -60,7 +60,6 @@ class ciReturnAddress;
class ciKlass;
class ciInstanceKlass;
class ciMethodKlass;
class ciSymbolKlass;
class ciArrayKlass;
class ciObjArrayKlass;
class ciTypeArrayKlass;
@ -112,7 +111,6 @@ friend class ciReturnAddress; \
friend class ciKlass; \
friend class ciInstanceKlass; \
friend class ciMethodKlass; \
friend class ciSymbolKlass; \
friend class ciArrayKlass; \
friend class ciObjArrayKlass; \
friend class ciTypeArrayKlass; \

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