From 7b9d6a79ac6d6edf7a713f4db6266a2ecde1db76 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Tue, 9 Jun 2009 16:19:10 -0700 Subject: [PATCH 01/91] 6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14 Disable escape analysis when jvmti/debugger is used. Add support for EA ibto SA. Reviewed-by: never --- .../jvm/hotspot/code/DebugInfoReadStream.java | 41 ++++++++ .../sun/jvm/hotspot/code/MonitorValue.java | 6 ++ .../sun/jvm/hotspot/code/ObjectValue.java | 93 +++++++++++++++++++ .../sun/jvm/hotspot/code/ScopeDesc.java | 48 +++++++++- .../sun/jvm/hotspot/code/ScopeValue.java | 7 ++ .../jvm/hotspot/jdi/ObjectReferenceImpl.java | 1 + .../jvm/hotspot/jdi/ThreadReferenceImpl.java | 3 + .../jvm/hotspot/runtime/CompiledVFrame.java | 25 +++-- .../hotspot/runtime/InterpretedVFrame.java | 6 +- .../sun/jvm/hotspot/runtime/MonitorInfo.java | 31 ++++++- .../sun/jvm/hotspot/runtime/StackValue.java | 11 ++- .../hotspot/utilities/soql/JSJavaThread.java | 4 + hotspot/src/share/vm/opto/c2compiler.cpp | 4 +- hotspot/src/share/vm/prims/jvmtiEnvBase.cpp | 3 + .../src/share/vm/runtime/biasedLocking.cpp | 2 + .../src/share/vm/runtime/deoptimization.cpp | 2 +- hotspot/src/share/vm/runtime/stackValue.cpp | 5 +- hotspot/src/share/vm/runtime/stackValue.hpp | 9 +- hotspot/src/share/vm/runtime/vframe.cpp | 37 ++++++-- hotspot/src/share/vm/runtime/vframe.hpp | 24 ++++- hotspot/src/share/vm/runtime/vframeArray.cpp | 3 + hotspot/src/share/vm/runtime/vframe_hp.cpp | 18 +++- 22 files changed, 350 insertions(+), 33 deletions(-) create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java index 2fc3155fa91..fa60c49839b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java @@ -24,23 +24,64 @@ package sun.jvm.hotspot.code; +import java.util.*; + import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.runtime.VM; +import sun.jvm.hotspot.utilities.*; public class DebugInfoReadStream extends CompressedReadStream { private NMethod code; private int InvocationEntryBCI; + private List objectPool; // ArrayList public DebugInfoReadStream(NMethod code, int offset) { super(code.scopesDataBegin(), offset); InvocationEntryBCI = VM.getVM().getInvocationEntryBCI(); this.code = code; + this.objectPool = null; + } + + public DebugInfoReadStream(NMethod code, int offset, List objectPool) { + super(code.scopesDataBegin(), offset); + InvocationEntryBCI = VM.getVM().getInvocationEntryBCI(); + this.code = code; + this.objectPool = objectPool; } public OopHandle readOopHandle() { return code.getOopAt(readInt()); } + ScopeValue readObjectValue() { + int id = readInt(); + if (Assert.ASSERTS_ENABLED) { + Assert.that(objectPool != null, "object pool does not exist"); + for (Iterator itr = objectPool.iterator(); itr.hasNext();) { + ObjectValue ov = (ObjectValue) itr.next(); + Assert.that(ov.id() != id, "should not be read twice"); + } + } + ObjectValue result = new ObjectValue(id); + // Cache the object since an object field could reference it. + objectPool.add(result); + result.readObject(this); + return result; + } + + ScopeValue getCachedObject() { + int id = readInt(); + Assert.that(objectPool != null, "object pool does not exist"); + for (Iterator itr = objectPool.iterator(); itr.hasNext();) { + ObjectValue ov = (ObjectValue) itr.next(); + if (ov.id() == id) { + return ov; + } + } + Assert.that(false, "should not reach here"); + return null; + } + public int readBCI() { return readInt() + InvocationEntryBCI; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java index cf539d311c8..43937fc690a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java @@ -29,6 +29,7 @@ import java.io.*; public class MonitorValue { private ScopeValue owner; private Location basicLock; + private boolean eliminated; // FIXME: not useful yet // MonitorValue(ScopeValue* owner, Location basic_lock); @@ -36,10 +37,12 @@ public class MonitorValue { public MonitorValue(DebugInfoReadStream stream) { basicLock = new Location(stream); owner = ScopeValue.readFrom(stream); + eliminated= stream.readBoolean(); } public ScopeValue owner() { return owner; } public Location basicLock() { return basicLock; } + public boolean eliminated() { return eliminated; } // FIXME: not yet implementable // void write_on(DebugInfoWriteStream* stream); @@ -50,5 +53,8 @@ public class MonitorValue { tty.print(","); basicLock().printOn(tty); tty.print("}"); + if (eliminated) { + tty.print(" (eliminated)"); + } } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java new file mode 100644 index 00000000000..1c38103faf3 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java @@ -0,0 +1,93 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +package sun.jvm.hotspot.code; + +import java.io.*; +import java.util.*; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.utilities.*; + +/** An ObjectValue describes an object eliminated by escape analysis. */ + +public class ObjectValue extends ScopeValue { + private int id; + private ScopeValue klass; + private List fieldsValue; // ArrayList + + // Field "boolean visited" is not implemented here since + // it is used only a during debug info creation. + + public ObjectValue(int id) { + this.id = id; + klass = null; + fieldsValue = new ArrayList(); + } + + public boolean isObject() { return true; } + public int id() { return id; } + public ScopeValue getKlass() { return klass; } + public List getFieldsValue() { return fieldsValue; } + public ScopeValue getFieldAt(int i) { return (ScopeValue)fieldsValue.get(i); } + public int fieldsSize() { return fieldsValue.size(); } + + // Field "value" is always NULL here since it is used + // only during deoptimization of a compiled frame + // pointing to reallocated object. + public OopHandle getValue() { return null; } + + /** Serialization of debugging information */ + + void readObject(DebugInfoReadStream stream) { + klass = readFrom(stream); + Assert.that(klass.isConstantOop(), "should be constant klass oop"); + int length = stream.readInt(); + for (int i = 0; i < length; i++) { + ScopeValue val = readFrom(stream); + fieldsValue.add(val); + } + } + + // Printing + + public void print() { + printOn(System.out); + } + + public void printOn(PrintStream tty) { + tty.print("scalarObj[" + id + "]"); + } + + void printFieldsOn(PrintStream tty) { + if (fieldsValue.size() > 0) { + ((ScopeValue)fieldsValue.get(0)).printOn(tty); + } + for (int i = 1; i < fieldsValue.size(); i++) { + tty.print(", "); + ((ScopeValue)fieldsValue.get(i)).printOn(tty); + } + } + +}; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java index b4d2d592d58..e75365ae226 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java @@ -27,8 +27,10 @@ package sun.jvm.hotspot.code; import java.io.*; import java.util.*; +import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.oops.*; import sun.jvm.hotspot.runtime.*; +import sun.jvm.hotspot.utilities.*; /** ScopeDescs contain the information that makes source-level debugging of nmethods possible; each scopeDesc describes a method @@ -45,10 +47,31 @@ public class ScopeDesc { private int localsDecodeOffset; private int expressionsDecodeOffset; private int monitorsDecodeOffset; + /** Scalar replaced bjects pool */ + private List objects; // ArrayList + public ScopeDesc(NMethod code, int decodeOffset) { this.code = code; this.decodeOffset = decodeOffset; + this.objects = decodeObjectValues(DebugInformationRecorder.SERIALIZED_NULL); + + // Decode header + DebugInfoReadStream stream = streamAt(decodeOffset); + + senderDecodeOffset = stream.readInt(); + method = (Method) VM.getVM().getObjectHeap().newOop(stream.readOopHandle()); + bci = stream.readBCI(); + // Decode offsets for body and sender + localsDecodeOffset = stream.readInt(); + expressionsDecodeOffset = stream.readInt(); + monitorsDecodeOffset = stream.readInt(); + } + + public ScopeDesc(NMethod code, int decodeOffset, int objectDecodeOffset) { + this.code = code; + this.decodeOffset = decodeOffset; + this.objects = decodeObjectValues(objectDecodeOffset); // Decode header DebugInfoReadStream stream = streamAt(decodeOffset); @@ -81,6 +104,11 @@ public class ScopeDesc { return decodeMonitorValues(monitorsDecodeOffset); } + /** Returns a List<MonitorValue> */ + public List getObjects() { + return objects; + } + /** Stack walking. Returns null if this is the outermost scope. */ public ScopeDesc sender() { if (isTop()) { @@ -131,7 +159,7 @@ public class ScopeDesc { // private DebugInfoReadStream streamAt(int decodeOffset) { - return new DebugInfoReadStream(code, decodeOffset); + return new DebugInfoReadStream(code, decodeOffset, objects); } /** Returns a List<ScopeValue> or null if no values were present */ @@ -161,4 +189,22 @@ public class ScopeDesc { } return res; } + + /** Returns a List<ObjectValue> or null if no values were present */ + private List decodeObjectValues(int decodeOffset) { + if (decodeOffset == DebugInformationRecorder.SERIALIZED_NULL) { + return null; + } + List res = new ArrayList(); + DebugInfoReadStream stream = new DebugInfoReadStream(code, decodeOffset, res); + int length = stream.readInt(); + for (int i = 0; i < length; i++) { + // Objects values are pushed to 'res' array during read so that + // object's fields could reference it (OBJECT_ID_CODE). + ScopeValue.readFrom(stream); + // res.add(ScopeValue.readFrom(stream)); + } + Assert.that(res.size() == length, "inconsistent debug information"); + return res; + } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java index f9c99d3d4ce..71166a706b1 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java @@ -49,12 +49,15 @@ public abstract class ScopeValue { static final int CONSTANT_OOP_CODE = 2; static final int CONSTANT_LONG_CODE = 3; static final int CONSTANT_DOUBLE_CODE = 4; + static final int CONSTANT_OBJECT_CODE = 5; + static final int CONSTANT_OBJECT_ID_CODE = 6; public boolean isLocation() { return false; } public boolean isConstantInt() { return false; } public boolean isConstantDouble() { return false; } public boolean isConstantLong() { return false; } public boolean isConstantOop() { return false; } + public boolean isObject() { return false; } public static ScopeValue readFrom(DebugInfoReadStream stream) { switch (stream.readInt()) { @@ -68,6 +71,10 @@ public abstract class ScopeValue { return new ConstantLongValue(stream); case CONSTANT_DOUBLE_CODE: return new ConstantDoubleValue(stream); + case CONSTANT_OBJECT_CODE: + return stream.readObjectValue(); + case CONSTANT_OBJECT_ID_CODE: + return stream.getCachedObject(); default: Assert.that(false, "should not reach here"); return null; diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java index 4911915c7f0..b469bde96b6 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java @@ -249,6 +249,7 @@ public class ObjectReferenceImpl extends ValueImpl implements ObjectReference { OopHandle givenHandle = obj.getHandle(); for (Iterator itr = monitors.iterator(); itr.hasNext();) { MonitorInfo mi = (MonitorInfo) itr.next(); + if (mi.eliminated() && frame.isCompiledFrame()) continue; // skip eliminated monitor if (givenHandle.equals(mi.owner())) { res++; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java index 87dfc191f11..7ae8675f48a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java @@ -301,6 +301,9 @@ public class ThreadReferenceImpl extends ObjectReferenceImpl List frameMonitors = frame.getMonitors(); // List for (Iterator miItr = frameMonitors.iterator(); miItr.hasNext(); ) { sun.jvm.hotspot.runtime.MonitorInfo mi = (sun.jvm.hotspot.runtime.MonitorInfo) miItr.next(); + if (mi.eliminated() && frame.isCompiledFrame()) { + continue; // skip eliminated monitor + } OopHandle obj = mi.owner(); if (obj == null) { // this monitor doesn't have an owning object so skip it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java index 1642fefe2cb..6588da2e8bd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java @@ -131,8 +131,18 @@ public class CompiledVFrame extends JavaVFrame { List result = new ArrayList(monitors.size()); for (int i = 0; i < monitors.size(); i++) { MonitorValue mv = (MonitorValue) monitors.get(i); - StackValue ownerSV = createStackValue(mv.owner()); // it is an oop - result.add(new MonitorInfo(ownerSV.getObject(), resolveMonitorLock(mv.basicLock()))); + ScopeValue ov = mv.owner(); + StackValue ownerSV = createStackValue(ov); // it is an oop + if (ov.isObject()) { // The owner object was scalar replaced + Assert.that(mv.eliminated() && ownerSV.objIsScalarReplaced(), "monitor should be eliminated for scalar replaced object"); + // Put klass for scalar replaced object. + ScopeValue kv = ((ObjectValue)ov).getKlass(); + Assert.that(kv.isConstantOop(), "klass should be oop constant for scalar replaced object"); + OopHandle k = ((ConstantOopReadValue)kv).getValue(); + result.add(new MonitorInfo(k, resolveMonitorLock(mv.basicLock()), mv.eliminated(), true)); + } else { + result.add(new MonitorInfo(ownerSV.getObject(), resolveMonitorLock(mv.basicLock()), mv.eliminated(), false)); + } } return result; } @@ -212,12 +222,12 @@ public class CompiledVFrame extends JavaVFrame { // long or is unused. He always saves a long. Here we know // a long was saved, but we only want an narrow oop back. Narrow the // saved long to the narrow oop that the JVM wants. - return new StackValue(valueAddr.getCompOopHandleAt(VM.getVM().getIntSize())); + return new StackValue(valueAddr.getCompOopHandleAt(VM.getVM().getIntSize()), 0); } else { - return new StackValue(valueAddr.getCompOopHandleAt(0)); + return new StackValue(valueAddr.getCompOopHandleAt(0), 0); } } else if( loc.holdsOop() ) { // Holds an oop? - return new StackValue(valueAddr.getOopHandleAt(0)); + return new StackValue(valueAddr.getOopHandleAt(0), 0); } else if( loc.holdsDouble() ) { // Double value in a single stack slot return new StackValue(valueAddr.getJIntAt(0) & 0xFFFFFFFF); @@ -277,7 +287,7 @@ public class CompiledVFrame extends JavaVFrame { return new StackValue(((ConstantIntValue) sv).getValue() & 0xFFFFFFFF); } else if (sv.isConstantOop()) { // constant oop - return new StackValue(((ConstantOopReadValue) sv).getValue()); + return new StackValue(((ConstantOopReadValue) sv).getValue(), 0); } else if (sv.isConstantDouble()) { // Constant double in a single stack slot double d = ((ConstantDoubleValue) sv).getValue(); @@ -285,6 +295,9 @@ public class CompiledVFrame extends JavaVFrame { } else if (VM.getVM().isLP64() && sv.isConstantLong()) { // Constant long in a single stack slot return new StackValue(((ConstantLongValue) sv).getValue() & 0xFFFFFFFF); + } else if (sv.isObject()) { + // Scalar replaced object in compiled frame + return new StackValue(((ObjectValue)sv).getValue(), 1); } // Unknown ScopeValue type diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java index ff5ad46c355..f86e4f7a2c5 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java @@ -61,7 +61,7 @@ public class InterpretedVFrame extends JavaVFrame { StackValue sv; if (oopMask.isOop(i)) { // oop value - sv = new StackValue(addr.getOopHandleAt(0)); + sv = new StackValue(addr.getOopHandleAt(0), 0); } else { // integer // Fetch a signed integer the size of a stack slot @@ -95,7 +95,7 @@ public class InterpretedVFrame extends JavaVFrame { StackValue sv; if (oopMask.isOop(i + nofLocals)) { // oop value - sv = new StackValue(addr.getOopHandleAt(0)); + sv = new StackValue(addr.getOopHandleAt(0), 0); } else { // integer // Fetch a signed integer the size of a stack slot @@ -113,7 +113,7 @@ public class InterpretedVFrame extends JavaVFrame { for (BasicObjectLock current = getFrame().interpreterFrameMonitorEnd(); current.address().lessThan(getFrame().interpreterFrameMonitorBegin().address()); current = getFrame().nextMonitorInInterpreterFrame(current)) { - result.add(new MonitorInfo(current.obj(), current.lock())); + result.add(new MonitorInfo(current.obj(), current.lock(), false, false)); } return result; } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java index d689d43597c..d4801fa05f6 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java @@ -25,16 +25,39 @@ package sun.jvm.hotspot.runtime; import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.utilities.*; public class MonitorInfo { private OopHandle owner; private BasicLock lock; + private OopHandle ownerKlass; + private boolean eliminated; + private boolean ownerIsScalarReplaced; - public MonitorInfo(OopHandle owner, BasicLock lock) { - this.owner = owner; - this.lock = lock; + public MonitorInfo(OopHandle owner, BasicLock lock, boolean eliminated, boolean ownerIsScalarReplaced) { + if (!ownerIsScalarReplaced) { + this.owner = owner; + this.ownerKlass = null; + } else { + Assert.that(eliminated, "monitor should be eliminated for scalar replaced object"); + this.owner = null; + this.ownerKlass = owner; + } + this.eliminated = eliminated; + this.ownerIsScalarReplaced = ownerIsScalarReplaced; + } + + public OopHandle owner() { + Assert.that(!ownerIsScalarReplaced, "should not be called for scalar replaced object"); + return owner; + } + + public OopHandle ownerKlass() { + Assert.that(ownerIsScalarReplaced, "should not be called for not scalar replaced object"); + return ownerKlass; } - public OopHandle owner() { return owner; } public BasicLock lock() { return lock; } + public boolean eliminated() { return eliminated; } + public boolean ownerIsScalarReplaced() { return ownerIsScalarReplaced; } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java index 246b7098c77..98becd01816 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java @@ -37,9 +37,11 @@ public class StackValue { type = BasicType.getTConflict(); } - public StackValue(OopHandle h) { + public StackValue(OopHandle h, long scalar_replaced) { handleValue = h; type = BasicType.getTObject(); + integerValue = scalar_replaced; + Assert.that(integerValue == 0 || handleValue == null, "not null object should not be marked as scalar replaced"); } public StackValue(long i) { @@ -59,6 +61,13 @@ public class StackValue { return handleValue; } + boolean objIsScalarReplaced() { + if (Assert.ASSERTS_ENABLED) { + Assert.that(type == BasicType.getTObject(), "type check"); + } + return integerValue != 0; + } + public long getInteger() { if (Assert.ASSERTS_ENABLED) { Assert.that(type == BasicType.getTInt(), "type check"); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java index 40402b5a3a8..b8fce3abdbf 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java @@ -135,6 +135,10 @@ public class JSJavaThread extends JSJavaInstance { List frameMonitors = frame.getMonitors(); // List for (Iterator miItr = frameMonitors.iterator(); miItr.hasNext(); ) { MonitorInfo mi = (MonitorInfo) miItr.next(); + + if (mi.eliminated() && frame.isCompiledFrame()) { + continue; // skip eliminated monitor + } OopHandle obj = mi.owner(); if (obj == null) { // this monitor doesn't have an owning object so skip it diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 6be045c8078..22509077fbb 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -104,7 +104,9 @@ void C2Compiler::compile_method(ciEnv* env, initialize(); } bool subsume_loads = true; - bool do_escape_analysis = DoEscapeAnalysis; + bool do_escape_analysis = DoEscapeAnalysis && + !(env->jvmti_can_hotswap_or_post_breakpoint() || + env->jvmti_can_examine_or_deopt_anywhere()); while (!env->failing()) { // Attempt to compile while subsuming loads into machine instructions. Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis); diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp index c0c98f01e53..142b60c54e4 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp @@ -606,6 +606,7 @@ JvmtiEnvBase::count_locked_objects(JavaThread *java_thread, Handle hobj) { if (!mons->is_empty()) { for (int i = 0; i < mons->length(); i++) { MonitorInfo *mi = mons->at(i); + if (mi->owner_is_scalar_replaced()) continue; // see if owner of the monitor is our object if (mi->owner() != NULL && mi->owner() == hobj()) { @@ -726,6 +727,8 @@ JvmtiEnvBase::get_locked_objects_in_frame(JavaThread* calling_thread, JavaThread for (int i = 0; i < mons->length(); i++) { MonitorInfo *mi = mons->at(i); + if (mi->owner_is_scalar_replaced()) continue; + oop obj = mi->owner(); if (obj == NULL) { // this monitor doesn't have an owning object so skip it diff --git a/hotspot/src/share/vm/runtime/biasedLocking.cpp b/hotspot/src/share/vm/runtime/biasedLocking.cpp index 21d2ea7da87..ddc7305c77f 100644 --- a/hotspot/src/share/vm/runtime/biasedLocking.cpp +++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp @@ -121,6 +121,7 @@ static GrowableArray* get_or_compute_monitor_info(JavaThread* thre // Walk monitors youngest to oldest for (int i = len - 1; i >= 0; i--) { MonitorInfo* mon_info = monitors->at(i); + if (mon_info->owner_is_scalar_replaced()) continue; oop owner = mon_info->owner(); if (owner != NULL) { info->append(mon_info); @@ -694,6 +695,7 @@ void BiasedLocking::preserve_marks() { // Walk monitors youngest to oldest for (int i = len - 1; i >= 0; i--) { MonitorInfo* mon_info = monitors->at(i); + if (mon_info->owner_is_scalar_replaced()) continue; oop owner = mon_info->owner(); if (owner != NULL) { markOop mark = owner->mark(); diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index e18f38ef6c5..586f4f5fd2f 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -933,7 +933,7 @@ static void collect_monitors(compiledVFrame* cvf, GrowableArray* objects GrowableArray* monitors = cvf->monitors(); for (int i = 0; i < monitors->length(); i++) { MonitorInfo* mon_info = monitors->at(i); - if (mon_info->owner() != NULL && !mon_info->eliminated()) { + if (!mon_info->eliminated() && mon_info->owner() != NULL) { objects_to_revoke->append(Handle(mon_info->owner())); } } diff --git a/hotspot/src/share/vm/runtime/stackValue.cpp b/hotspot/src/share/vm/runtime/stackValue.cpp index b6b2e359acf..9f3fb0f0ec3 100644 --- a/hotspot/src/share/vm/runtime/stackValue.cpp +++ b/hotspot/src/share/vm/runtime/stackValue.cpp @@ -146,8 +146,9 @@ StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* r value.jl = ((ConstantLongValue *)sv)->value(); return new StackValue(value.p); #endif - } else if (sv->is_object()) { - return new StackValue(((ObjectValue *)sv)->value()); + } else if (sv->is_object()) { // Scalar replaced object in compiled frame + Handle ov = ((ObjectValue *)sv)->value(); + return new StackValue(ov, (ov.is_null()) ? 1 : 0); } // Unknown ScopeValue type diff --git a/hotspot/src/share/vm/runtime/stackValue.hpp b/hotspot/src/share/vm/runtime/stackValue.hpp index 6296b8073a4..1715ec65b20 100644 --- a/hotspot/src/share/vm/runtime/stackValue.hpp +++ b/hotspot/src/share/vm/runtime/stackValue.hpp @@ -34,9 +34,11 @@ class StackValue : public ResourceObj { _i = value; } - StackValue(Handle value) { + StackValue(Handle value, intptr_t scalar_replaced = 0) { _type = T_OBJECT; + _i = scalar_replaced; _o = value; + assert(_i == 0 || _o.is_null(), "not null object should not be marked as scalar replaced"); } StackValue() { @@ -56,6 +58,11 @@ class StackValue : public ResourceObj { return _o; } + bool obj_is_scalar_replaced() const { + assert(type() == T_OBJECT, "type check"); + return _i != 0; + } + void set_obj(Handle value) { assert(type() == T_OBJECT, "type check"); _o = value; diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp index 6474e6fabf8..64215384091 100644 --- a/hotspot/src/share/vm/runtime/vframe.cpp +++ b/hotspot/src/share/vm/runtime/vframe.cpp @@ -106,6 +106,7 @@ GrowableArray* javaVFrame::locked_monitors() { for (int index = (mons->length()-1); index >= 0; index--) { MonitorInfo* monitor = mons->at(index); + if (monitor->eliminated() && is_compiled_frame()) continue; // skip eliminated monitor oop obj = monitor->owner(); if (obj == NULL) continue; // skip unowned monitor // @@ -162,6 +163,18 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) { bool found_first_monitor = false; for (int index = (mons->length()-1); index >= 0; index--) { MonitorInfo* monitor = mons->at(index); + if (monitor->eliminated() && is_compiled_frame()) { // Eliminated in compiled code + if (monitor->owner_is_scalar_replaced()) { + Klass* k = Klass::cast(monitor->owner_klass()); + st->print("\t- eliminated (a %s)", k->external_name()); + } else { + oop obj = monitor->owner(); + if (obj != NULL) { + print_locked_object_class_name(st, obj, "eliminated"); + } + } + continue; + } if (monitor->owner() != NULL) { // First, assume we have the monitor locked. If we haven't found an @@ -171,11 +184,11 @@ void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) { const char *lock_state = "locked"; // assume we have the monitor locked if (!found_first_monitor && frame_count == 0) { - markOop mark = monitor->owner()->mark(); - if (mark->has_monitor() && - mark->monitor() == thread()->current_pending_monitor()) { + markOop mark = monitor->owner()->mark(); + if (mark->has_monitor() && + mark->monitor() == thread()->current_pending_monitor()) { lock_state = "waiting to lock"; - } + } } found_first_monitor = true; @@ -206,7 +219,7 @@ GrowableArray* interpretedVFrame::monitors() const { for (BasicObjectLock* current = (fr().previous_monitor_in_interpreter_frame(fr().interpreter_frame_monitor_begin())); current >= fr().interpreter_frame_monitor_end(); current = fr().previous_monitor_in_interpreter_frame(current)) { - result->push(new MonitorInfo(current->obj(), current->lock(), false)); + result->push(new MonitorInfo(current->obj(), current->lock(), false, false)); } return result; } @@ -531,8 +544,18 @@ void javaVFrame::print() { tty->print_cr("\tmonitor list:"); for (int index = (list->length()-1); index >= 0; index--) { MonitorInfo* monitor = list->at(index); - tty->print("\t obj\t"); monitor->owner()->print_value(); - tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner()); + tty->print("\t obj\t"); + if (monitor->owner_is_scalar_replaced()) { + Klass* k = Klass::cast(monitor->owner_klass()); + tty->print("( is scalar replaced %s)", k->external_name()); + } else if (monitor->owner() == NULL) { + tty->print("( null )"); + } else { + monitor->owner()->print_value(); + tty->print("(" INTPTR_FORMAT ")", (address)monitor->owner()); + } + if (monitor->eliminated() && is_compiled_frame()) + tty->print(" ( lock is eliminated )"); tty->cr(); tty->print("\t "); monitor->lock()->print_on(tty); diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index febfb02cb46..2924aeae983 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -230,18 +230,36 @@ class MonitorInfo : public ResourceObj { private: oop _owner; // the object owning the monitor BasicLock* _lock; + oop _owner_klass; // klass if owner was scalar replaced bool _eliminated; + bool _owner_is_scalar_replaced; public: // Constructor - MonitorInfo(oop owner, BasicLock* lock, bool eliminated) { - _owner = owner; + MonitorInfo(oop owner, BasicLock* lock, bool eliminated, bool owner_is_scalar_replaced) { + if (!owner_is_scalar_replaced) { + _owner = owner; + _owner_klass = NULL; + } else { + assert(eliminated, "monitor should be eliminated for scalar replaced object"); + _owner = NULL; + _owner_klass = owner; + } _lock = lock; _eliminated = eliminated; + _owner_is_scalar_replaced = owner_is_scalar_replaced; } // Accessors - oop owner() const { return _owner; } + oop owner() const { + assert(!_owner_is_scalar_replaced, "should not be called for scalar replaced object"); + return _owner; + } + klassOop owner_klass() const { + assert(_owner_is_scalar_replaced, "should not be called for not scalar replaced object"); + return (klassOop)_owner_klass; + } BasicLock* lock() const { return _lock; } bool eliminated() const { return _eliminated; } + bool owner_is_scalar_replaced() const { return _owner_is_scalar_replaced; } }; class vframeStreamCommon : StackObj { diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp index 84130636685..60a2a23b737 100644 --- a/hotspot/src/share/vm/runtime/vframeArray.cpp +++ b/hotspot/src/share/vm/runtime/vframeArray.cpp @@ -61,6 +61,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) { // Migrate the BasicLocks from the stack to the monitor chunk for (index = 0; index < list->length(); index++) { MonitorInfo* monitor = list->at(index); + assert(!monitor->owner_is_scalar_replaced(), "object should be reallocated already"); assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased"); BasicObjectLock* dest = _monitors->at(index); dest->set_obj(monitor->owner()); @@ -89,6 +90,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) { StackValue* value = locs->at(index); switch(value->type()) { case T_OBJECT: + assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); // preserve object type _locals->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); break; @@ -113,6 +115,7 @@ void vframeArrayElement::fill_in(compiledVFrame* vf) { StackValue* value = exprs->at(index); switch(value->type()) { case T_OBJECT: + assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); // preserve object type _expressions->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); break; diff --git a/hotspot/src/share/vm/runtime/vframe_hp.cpp b/hotspot/src/share/vm/runtime/vframe_hp.cpp index 5f781f39c47..1fc0f2b7d18 100644 --- a/hotspot/src/share/vm/runtime/vframe_hp.cpp +++ b/hotspot/src/share/vm/runtime/vframe_hp.cpp @@ -190,7 +190,7 @@ GrowableArray* compiledVFrame::monitors() const { // Casting away const frame& fr = (frame&) _fr; MonitorInfo* info = new MonitorInfo(fr.compiled_synchronized_native_monitor_owner(nm), - fr.compiled_synchronized_native_monitor(nm), false); + fr.compiled_synchronized_native_monitor(nm), false, false); monitors->push(info); return monitors; } @@ -201,8 +201,20 @@ GrowableArray* compiledVFrame::monitors() const { GrowableArray* result = new GrowableArray(monitors->length()); for (int index = 0; index < monitors->length(); index++) { MonitorValue* mv = monitors->at(index); - StackValue *owner_sv = create_stack_value(mv->owner()); // it is an oop - result->push(new MonitorInfo(owner_sv->get_obj()(), resolve_monitor_lock(mv->basic_lock()), mv->eliminated())); + ScopeValue* ov = mv->owner(); + StackValue *owner_sv = create_stack_value(ov); // it is an oop + if (ov->is_object() && owner_sv->obj_is_scalar_replaced()) { // The owner object was scalar replaced + assert(mv->eliminated(), "monitor should be eliminated for scalar replaced object"); + // Put klass for scalar replaced object. + ScopeValue* kv = ((ObjectValue *)ov)->klass(); + assert(kv->is_constant_oop(), "klass should be oop constant for scalar replaced object"); + KlassHandle k(((ConstantOopReadValue*)kv)->value()()); + result->push(new MonitorInfo(k->as_klassOop(), resolve_monitor_lock(mv->basic_lock()), + mv->eliminated(), true)); + } else { + result->push(new MonitorInfo(owner_sv->get_obj()(), resolve_monitor_lock(mv->basic_lock()), + mv->eliminated(), false)); + } } return result; } From 0f4f530213d4cd22a1811e73bda9c333648cff8f Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Wed, 10 Jun 2009 12:19:48 -0700 Subject: [PATCH 02/91] 6849574: VM crash using NonBlockingHashMap (high_scale_lib) Reviewed-by: kvn --- .../cpu/sparc/vm/c1_LIRGenerator_sparc.cpp | 7 +-- hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 6 +-- hotspot/test/compiler/6849574/Test.java | 44 +++++++++++++++++++ 3 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 hotspot/test/compiler/6849574/Test.java diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index 239d867a043..a6e6c60e2a7 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -371,7 +371,7 @@ void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { } __ move(value.result(), array_addr, null_check_info); if (obj_store) { - // Is this precise? + // Precise card mark post_barrier(LIR_OprFact::address(array_addr), value.result()); } } @@ -685,11 +685,8 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { LIR_Opr result = rlock_result(x); __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); if (type == objectType) { // Write-barrier needed for Object fields. -#ifdef PRECISE_CARDMARK + // Precise card mark since could either be object or array post_barrier(addr, val.result()); -#else - post_barrier(obj.result(), val.result()); -#endif // PRECISE_CARDMARK } } diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 14071816982..47587792922 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1534,12 +1534,8 @@ void LIRGenerator::do_StoreField(StoreField* x) { } if (is_oop) { -#ifdef PRECISE_CARDMARK - // Precise cardmarks don't work - post_barrier(LIR_OprFact::address(address), value.result()); -#else + // Store to object so mark the card of the header post_barrier(object.result(), value.result()); -#endif // PRECISE_CARDMARK } if (is_volatile && os::is_MP()) { diff --git a/hotspot/test/compiler/6849574/Test.java b/hotspot/test/compiler/6849574/Test.java new file mode 100644 index 00000000000..7ba048c3b9f --- /dev/null +++ b/hotspot/test/compiler/6849574/Test.java @@ -0,0 +1,44 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +/** + * @test + * @bug 6849574 + * @summary VM crash using NonBlockingHashMap (high_scale_lib) + * + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC Test + */ + +import java.util.concurrent.atomic.*; + +public class Test extends Thread { + + public static void main(String[] args) { + AtomicReferenceArray a = new AtomicReferenceArray(10000); + for (int i = 0; i < 100000; i++) { + a.getAndSet(9999, new Object()); + if (i > 99990) System.gc(); + } + } +} From bc2c9e927f7570e9ec691ac2091729f852faf4b2 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 17 Jun 2009 09:08:56 -0700 Subject: [PATCH 03/91] 6851829: solaris build fails with 5.8 compilers Solaris builds with the CC 5.8 compilers (used for jdk6 update builds) fail while compiling adlc. Reviewed-by: never --- hotspot/make/solaris/makefiles/adlc.make | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index b13e1fa528f..e2f848c26a5 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -68,7 +68,9 @@ endif # CFLAGS_WARN holds compiler options to suppress/enable warnings. # Compiler warnings are treated as errors -CFLAGS_WARN = +w -errwarn +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) + CFLAGS_WARN = +w -errwarn +endif CFLAGS += $(CFLAGS_WARN) ifeq ("${Platform_compiler}", "sparcWorks") From babd1164a44c543e3f723105ea01fada8e6eb050 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 22 Jun 2009 10:13:20 -0700 Subject: [PATCH 04/91] 6853596: Update Build README-build.html with new info regarding update for Solaris 10u2 and BOOTDIR update Reviewed-by: tbell, ohair --- README-builds.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README-builds.html b/README-builds.html index ad7d16cb30b..dfc2904785e 100644 --- a/README-builds.html +++ b/README-builds.html @@ -119,6 +119,7 @@ Base OS and Architecture OS C/C++ Compiler + BOOT JDK @@ -126,57 +127,65 @@ Linux X86 (32-bit) Fedora 9 gcc 4 + JDK 6u14 FCS Linux X64 (64-bit) Fedora 9 gcc 4 + JDK 6u14 FCS Solaris SPARC (32-bit) - Solaris 10 + patches + Solaris 10u2 + patches
See SunSolve for patch downloads. Sun Studio 12 + JDK 6u14 FCS Solaris SPARCV9 (64-bit) - Solaris 10 + patches + Solaris 10u2 + patches
See SunSolve for patch downloads. Sun Studio 12 + JDK 6u14 FCS Solaris X86 (32-bit) - Solaris 10 + patches + Solaris 10u2 + patches
See SunSolve for patch downloads. Sun Studio 12 + JDK 6u14 FCS Solaris X64 (64-bit) - Solaris 10 + patches + Solaris 10u2 + patches
See SunSolve for patch downloads. Sun Studio 12 + JDK 6u14 FCS Windows X86 (32-bit) Windows XP Microsoft Visual Studio C++ 2008 Standard Edition + JDK 6u14 FCS Windows X64 (64-bit) Windows Server 2003 - Enterprise x64 Edition Microsoft Platform SDK - April 2005 + JDK 6u14 FCS From 2c5f52b511262c52de883364fcccfbc7c5f7c00e Mon Sep 17 00:00:00 2001 From: Chuck Rasbold Date: Tue, 23 Jun 2009 17:52:29 -0700 Subject: [PATCH 05/91] 6837094: False positive for "meet not symmetric" failure Have the meet not symmetric check recursively do the interface-vs-oop check on array subtypes. Reviewed-by: jrose --- hotspot/src/share/vm/opto/type.cpp | 49 ++++++++++--- hotspot/src/share/vm/opto/type.hpp | 13 ++++ hotspot/test/compiler/6837094/Test.java | 94 +++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 9 deletions(-) create mode 100644 hotspot/test/compiler/6837094/Test.java diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index e831a2ad6f7..3c32c348c7e 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -487,6 +487,23 @@ bool Type::is_nan() const { return false; } +//----------------------interface_vs_oop--------------------------------------- +#ifdef ASSERT +bool Type::interface_vs_oop(const Type *t) const { + bool result = false; + + const TypeInstPtr* this_inst = this->isa_instptr(); + const TypeInstPtr* t_inst = t->isa_instptr(); + if( this_inst && this_inst->is_loaded() && t_inst && t_inst->is_loaded() ) { + bool this_interface = this_inst->klass()->is_interface(); + bool t_interface = t_inst->klass()->is_interface(); + result = this_interface ^ t_interface; + } + + return result; +} +#endif + //------------------------------meet------------------------------------------- // Compute the MEET of two types. NOT virtual. It enforces that meet is // commutative and the lattice is symmetric. @@ -507,16 +524,8 @@ const Type *Type::meet( const Type *t ) const { // Interface meet Oop is Not Symmetric: // Interface:AnyNull meet Oop:AnyNull == Interface:AnyNull // Interface:NotNull meet Oop:NotNull == java/lang/Object:NotNull - const TypeInstPtr* this_inst = this->isa_instptr(); - const TypeInstPtr* t_inst = t->isa_instptr(); - bool interface_vs_oop = false; - if( this_inst && this_inst->is_loaded() && t_inst && t_inst->is_loaded() ) { - bool this_interface = this_inst->klass()->is_interface(); - bool t_interface = t_inst->klass()->is_interface(); - interface_vs_oop = this_interface ^ t_interface; - } - if( !interface_vs_oop && (t2t != t->_dual || t2this != _dual) ) { + if( !interface_vs_oop(t) && (t2t != t->_dual || t2this != _dual) ) { tty->print_cr("=== Meet Not Symmetric ==="); tty->print("t = "); t->dump(); tty->cr(); tty->print("this= "); dump(); tty->cr(); @@ -1800,6 +1809,17 @@ int TypeAry::hash(void) const { return (intptr_t)_elem + (intptr_t)_size; } +//----------------------interface_vs_oop--------------------------------------- +#ifdef ASSERT +bool TypeAry::interface_vs_oop(const Type *t) const { + const TypeAry* t_ary = t->is_ary(); + if (t_ary) { + return _elem->interface_vs_oop(t_ary->_elem); + } + return false; +} +#endif + //------------------------------dump2------------------------------------------ #ifndef PRODUCT void TypeAry::dump2( Dict &d, uint depth, outputStream *st ) const { @@ -3389,6 +3409,17 @@ const Type *TypeAryPtr::xdual() const { return new TypeAryPtr( dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id() ); } +//----------------------interface_vs_oop--------------------------------------- +#ifdef ASSERT +bool TypeAryPtr::interface_vs_oop(const Type *t) const { + const TypeAryPtr* t_aryptr = t->isa_aryptr(); + if (t_aryptr) { + return _ary->interface_vs_oop(t_aryptr->_ary); + } + return false; +} +#endif + //------------------------------dump2------------------------------------------ #ifndef PRODUCT void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const { diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index 917c271cce0..1683c384b65 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -190,6 +190,11 @@ public: // Currently, it also works around limitations involving interface types. virtual const Type *filter( const Type *kills ) const; +#ifdef ASSERT + // One type is interface, the other is oop + virtual bool interface_vs_oop(const Type *t) const; +#endif + // Returns true if this pointer points at memory which contains a // compressed oop references. bool is_ptr_to_narrowoop() const; @@ -546,6 +551,10 @@ public: virtual const Type *xmeet( const Type *t ) const; virtual const Type *xdual() const; // Compute dual right now. bool ary_must_be_exact() const; // true if arrays of such are never generic +#ifdef ASSERT + // One type is interface, the other is oop + virtual bool interface_vs_oop(const Type *t) const; +#endif #ifndef PRODUCT virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping #endif @@ -867,6 +876,10 @@ public: } static const TypeAryPtr *_array_body_type[T_CONFLICT+1]; // sharpen the type of an int which is used as an array size +#ifdef ASSERT + // One type is interface, the other is oop + virtual bool interface_vs_oop(const Type *t) const; +#endif #ifndef PRODUCT virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping #endif diff --git a/hotspot/test/compiler/6837094/Test.java b/hotspot/test/compiler/6837094/Test.java new file mode 100644 index 00000000000..9fe2a6a35e5 --- /dev/null +++ b/hotspot/test/compiler/6837094/Test.java @@ -0,0 +1,94 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +/** + * @test + * @bug 6837094 + * @summary False positive for "meet not symmetric" failure + * + * @run main/othervm -Xbatch -XX:CompileOnly=Test.collectIs,Test$Factory$1.getArray,Test$Factory$2.getArray Test + */ + +import java.util.Set; +import java.util.HashSet; + +public class Test { + + private interface Factory { + Factory Zero = new Factory() { + public Child0[] getArray() { return new Child0[1]; } + }; + + Factory One = new Factory() { + public Child1[] getArray() { return new Child1[1]; } + }; + + M[] getArray(); + } + + /** + * C2 asserts when compiling this method. Bimorphic inlining happens at + * getArray call site. A Phi in the catch block tries to join the meet type + * from he inline site (Parent[]) with the type expected by CI (Interface[]). + * + * C2 throws an assert when it doesn't need to. + */ + private static void collectIs( + Factory factory, Set s) { + for (I i : factory.getArray()) { + try { + s.add(i); + } catch (Exception e) { + } + } + } + + static public void main(String argv[]) { + Set s = new HashSet(); + + for (int i = 0; i < 25000; i++) { + collectIs(Factory.Zero, s); + collectIs(Factory.One, s); + } + } +} + +/** + * Establish necessary class hierarchy + */ + +interface Interface { +} + +class Parent { +} + +class Child0 extends Parent implements Interface { +} + +class Child1 extends Parent implements Interface { +} + +class Child2 extends Parent implements Interface { +} From 3a643c42b00d1ba7c358906d1a11aa40ef9ceb6b Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Wed, 24 Jun 2009 11:42:03 -0400 Subject: [PATCH 06/91] 6850869: G1: RSet "scrubbing" scrubs too much RSet scrubbing incorrectly deletes RSet entries that point to regions tagged as "continues humongous" due to a race when RSet scrubbing iterates over regions in parallel. Reviewed-by: apetrusenko, iveresov --- .../gc_implementation/g1/concurrentMark.cpp | 53 +++++++++++++++---- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 34880cc7eb6..d0a702a371c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -1233,6 +1233,41 @@ public: CardTableModRefBS::card_shift); } + // It takes a region that's not empty (i.e., it has at least one + // live object in it and sets its corresponding bit on the region + // bitmap to 1. If the region is "starts humongous" it will also set + // to 1 the bits on the region bitmap that correspond to its + // associated "continues humongous" regions. + void set_bit_for_region(HeapRegion* hr) { + assert(!hr->continuesHumongous(), "should have filtered those out"); + + size_t index = hr->hrs_index(); + if (!hr->startsHumongous()) { + // Normal (non-humongous) case: just set the bit. + _region_bm->par_at_put((BitMap::idx_t) index, true); + } else { + // Starts humongous case: calculate how many regions are part of + // this humongous region and then set the bit range. It might + // have been a bit more efficient to look at the object that + // spans these humongous regions to calculate their number from + // the object's size. However, it's a good idea to calculate + // this based on the metadata itself, and not the region + // contents, so that this code is not aware of what goes into + // the humongous regions (in case this changes in the future). + G1CollectedHeap* g1h = G1CollectedHeap::heap(); + size_t end_index = index + 1; + while (index < g1h->n_regions()) { + HeapRegion* chr = g1h->region_at(index); + if (!chr->continuesHumongous()) { + break; + } + end_index += 1; + } + _region_bm->par_at_put_range((BitMap::idx_t) index, + (BitMap::idx_t) end_index, true); + } + } + bool doHeapRegion(HeapRegion* hr) { if (_co_tracker != NULL) _co_tracker->update(); @@ -1241,13 +1276,13 @@ public: _start_vtime_sec = os::elapsedVTime(); if (hr->continuesHumongous()) { - HeapRegion* hum_start = hr->humongous_start_region(); - // If the head region of the humongous region has been determined - // to be alive, then all the tail regions should be marked - // such as well. - if (_region_bm->at(hum_start->hrs_index())) { - _region_bm->par_at_put(hr->hrs_index(), 1); - } + // We will ignore these here and process them when their + // associated "starts humongous" region is processed (see + // set_bit_for_heap_region()). Note that we cannot rely on their + // associated "starts humongous" region to have their bit set to + // 1 since, due to the region chunking in the parallel region + // iteration, a "continues humongous" region might be visited + // before its associated "starts humongous". return false; } @@ -1343,14 +1378,14 @@ public: intptr_t(uintptr_t(tp) >> CardTableModRefBS::card_shift); mark_card_num_range(start_card_num, last_card_num); // This definitely means the region has live objects. - _region_bm->par_at_put(hr->hrs_index(), 1); + set_bit_for_region(hr); } } hr->add_to_marked_bytes(marked_bytes); // Update the live region bitmap. if (marked_bytes > 0) { - _region_bm->par_at_put(hr->hrs_index(), 1); + set_bit_for_region(hr); } hr->set_top_at_conc_mark_count(nextTop); _tot_live += hr->next_live_bytes(); From 8f6070ce0eb0841120026d3d25aaa68953513247 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Wed, 24 Jun 2009 12:00:51 -0700 Subject: [PATCH 07/91] 6841800: Incorrect boundary values behavior for option -XX:MaxLabelRootDepth=0-6 leads to jvm crash MaxLabelRootDepth value less then 10 is invalid. Reviewed-by: never --- hotspot/src/share/vm/opto/matcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index 2723a32fd34..c5f75e8bbe5 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -141,6 +141,10 @@ void Matcher::verify_new_nodes_only(Node* xroot) { //---------------------------match--------------------------------------------- void Matcher::match( ) { + if( MaxLabelRootDepth < 100 ) { // Too small? + assert(false, "invalid MaxLabelRootDepth, increase it to 100 minimum"); + MaxLabelRootDepth = 100; + } // One-time initialization of some register masks. init_spill_mask( C->root()->in(1) ); _return_addr_mask = return_addr(); From a9ad90fa87e4a0c92059b6968088226d4f8155df Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Fri, 26 Jun 2009 07:26:10 -0700 Subject: [PATCH 08/91] 5057225: Remove useless I2L conversions The optimizer should be told to normalize (AndL (ConvI2L x) 0xFF) to (ConvI2L (AndI x 0xFF)), and then the existing matcher rule will work for free. Reviewed-by: kvn --- hotspot/src/cpu/sparc/vm/sparc.ad | 172 ++++++++++++++++-- hotspot/src/cpu/x86/vm/x86_32.ad | 131 ++++++++++++- hotspot/src/cpu/x86/vm/x86_64.ad | 83 ++++++++- hotspot/src/share/vm/opto/mulnode.cpp | 74 ++++---- .../test/compiler/5057225/Test5057225.java | 140 ++++++++++++++ 5 files changed, 541 insertions(+), 59 deletions(-) create mode 100644 hotspot/test/compiler/5057225/Test5057225.java diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index e3fd272f0cd..757bb388356 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1891,17 +1891,17 @@ RegMask Matcher::modL_proj_mask() { // The intptr_t operand types, defined by textual substitution. // (Cf. opto/type.hpp. This lets us avoid many, many other ifdefs.) #ifdef _LP64 -#define immX immL -#define immX13 immL13 -#define immX13m7 immL13m7 -#define iRegX iRegL -#define g1RegX g1RegL +#define immX immL +#define immX13 immL13 +#define immX13m7 immL13m7 +#define iRegX iRegL +#define g1RegX g1RegL #else -#define immX immI -#define immX13 immI13 -#define immX13m7 immI13m7 -#define iRegX iRegI -#define g1RegX g1RegI +#define immX immI +#define immX13 immI13 +#define immX13m7 immI13m7 +#define iRegX iRegI +#define g1RegX g1RegI #endif //----------ENCODING BLOCK----------------------------------------------------- @@ -3446,6 +3446,15 @@ operand immI() %{ interface(CONST_INTER); %} +// Integer Immediate: 8-bit +operand immI8() %{ + predicate(Assembler::is_simm(n->get_int(), 8)); + match(ConI); + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // Integer Immediate: 13-bit operand immI13() %{ predicate(Assembler::is_simm13(n->get_int())); @@ -3466,6 +3475,15 @@ operand immI13m7() %{ interface(CONST_INTER); %} +// Integer Immediate: 16-bit +operand immI16() %{ + predicate(Assembler::is_simm(n->get_int(), 16)); + match(ConI); + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // Unsigned (positive) Integer Immediate: 13-bit operand immU13() %{ predicate((0 <= n->get_int()) && Assembler::is_simm13(n->get_int())); @@ -5544,7 +5562,7 @@ instruct loadUB(iRegI dst, memory mem) %{ ins_encode %{ __ ldub($mem$$Address, $dst$$Register); %} - ins_pipe(iload_mask_mem); + ins_pipe(iload_mem); %} // Load Unsigned Byte (8bit UNsigned) into a Long Register @@ -5557,7 +5575,22 @@ instruct loadUB2L(iRegL dst, memory mem) %{ ins_encode %{ __ ldub($mem$$Address, $dst$$Register); %} - ins_pipe(iload_mask_mem); + ins_pipe(iload_mem); +%} + +// Load Unsigned Byte (8 bit UNsigned) with 8-bit mask into Long Register +instruct loadUB2L_immI8(iRegL dst, memory mem, immI8 mask) %{ + match(Set dst (ConvI2L (AndI (LoadUB mem) mask))); + ins_cost(MEMORY_REF_COST + DEFAULT_COST); + + size(2*4); + format %{ "LDUB $mem,$dst\t# ubyte & 8-bit mask -> long\n\t" + "AND $dst,$mask,$dst" %} + ins_encode %{ + __ ldub($mem$$Address, $dst$$Register); + __ and3($dst$$Register, $mask$$constant, $dst$$Register); + %} + ins_pipe(iload_mem); %} // Load Short (16bit signed) @@ -5610,7 +5643,7 @@ instruct loadUS(iRegI dst, memory mem) %{ ins_encode %{ __ lduh($mem$$Address, $dst$$Register); %} - ins_pipe(iload_mask_mem); + ins_pipe(iload_mem); %} // Load Unsigned Short/Char (16 bit UNsigned) to Byte (8 bit signed) @@ -5636,7 +5669,56 @@ instruct loadUS2L(iRegL dst, memory mem) %{ ins_encode %{ __ lduh($mem$$Address, $dst$$Register); %} - ins_pipe(iload_mask_mem); + ins_pipe(iload_mem); +%} + +// Load Unsigned Short/Char (16bit UNsigned) with mask 0xFF into a Long Register +instruct loadUS2L_immI_255(iRegL dst, indOffset13m7 mem, immI_255 mask) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + ins_cost(MEMORY_REF_COST); + + size(4); + format %{ "LDUB $mem+1,$dst\t! ushort/char & 0xFF -> long" %} + ins_encode %{ + __ ldub($mem$$Address, $dst$$Register, 1); // LSB is index+1 on BE + %} + ins_pipe(iload_mem); +%} + +// Load Unsigned Short/Char (16bit UNsigned) with a 13-bit mask into a Long Register +instruct loadUS2L_immI13(iRegL dst, memory mem, immI13 mask) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + ins_cost(MEMORY_REF_COST + DEFAULT_COST); + + size(2*4); + format %{ "LDUH $mem,$dst\t! ushort/char & 13-bit mask -> long\n\t" + "AND $dst,$mask,$dst" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ lduh($mem$$Address, Rdst); + __ and3(Rdst, $mask$$constant, Rdst); + %} + ins_pipe(iload_mem); +%} + +// Load Unsigned Short/Char (16bit UNsigned) with a 16-bit mask into a Long Register +instruct loadUS2L_immI16(iRegL dst, memory mem, immI16 mask, iRegL tmp) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + effect(TEMP dst, TEMP tmp); + ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST); + + size(3*4); + format %{ "LDUH $mem,$dst\t! ushort/char & 16-bit mask -> long\n\t" + "SET $mask,$tmp\n\t" + "AND $dst,$tmp,$dst" %} + ins_encode %{ + Register Rdst = $dst$$Register; + Register Rtmp = $tmp$$Register; + __ lduh($mem$$Address, Rdst); + __ set($mask$$constant, Rtmp); + __ and3(Rdst, Rtmp, Rdst); + %} + ins_pipe(iload_mem); %} // Load Integer @@ -5718,6 +5800,68 @@ instruct loadI2L(iRegL dst, memory mem) %{ ins_encode %{ __ ldsw($mem$$Address, $dst$$Register); %} + ins_pipe(iload_mask_mem); +%} + +// Load Integer with mask 0xFF into a Long Register +instruct loadI2L_immI_255(iRegL dst, indOffset13m7 mem, immI_255 mask) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + ins_cost(MEMORY_REF_COST); + + size(4); + format %{ "LDUB $mem+3,$dst\t! int & 0xFF -> long" %} + ins_encode %{ + __ ldub($mem$$Address, $dst$$Register, 3); // LSB is index+3 on BE + %} + ins_pipe(iload_mem); +%} + +// Load Integer with mask 0xFFFF into a Long Register +instruct loadI2L_immI_65535(iRegL dst, indOffset13m7 mem, immI_65535 mask) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + ins_cost(MEMORY_REF_COST); + + size(4); + format %{ "LDUH $mem+2,$dst\t! int & 0xFFFF -> long" %} + ins_encode %{ + __ lduh($mem$$Address, $dst$$Register, 2); // LSW is index+2 on BE + %} + ins_pipe(iload_mem); +%} + +// Load Integer with a 13-bit mask into a Long Register +instruct loadI2L_immI13(iRegL dst, memory mem, immI13 mask) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + ins_cost(MEMORY_REF_COST + DEFAULT_COST); + + size(2*4); + format %{ "LDUW $mem,$dst\t! int & 13-bit mask -> long\n\t" + "AND $dst,$mask,$dst" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ lduw($mem$$Address, Rdst); + __ and3(Rdst, $mask$$constant, Rdst); + %} + ins_pipe(iload_mem); +%} + +// Load Integer with a 32-bit mask into a Long Register +instruct loadI2L_immI(iRegL dst, memory mem, immI mask, iRegL tmp) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + effect(TEMP dst, TEMP tmp); + ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST); + + size(3*4); + format %{ "LDUW $mem,$dst\t! int & 32-bit mask -> long\n\t" + "SET $mask,$tmp\n\t" + "AND $dst,$tmp,$dst" %} + ins_encode %{ + Register Rdst = $dst$$Register; + Register Rtmp = $tmp$$Register; + __ lduw($mem$$Address, Rdst); + __ set($mask$$constant, Rtmp); + __ and3(Rdst, Rtmp, Rdst); + %} ins_pipe(iload_mem); %} diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 1edf7f35a07..58723cd89d1 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -6885,8 +6885,9 @@ instruct loadB(xRegI dst, memory mem) %{ %} // Load Byte (8bit signed) into Long Register -instruct loadB2L(eRegL dst, memory mem) %{ +instruct loadB2L(eRegL dst, memory mem, eFlagsReg cr) %{ match(Set dst (ConvI2L (LoadB mem))); + effect(KILL cr); ins_cost(375); format %{ "MOVSX8 $dst.lo,$mem\t# byte -> long\n\t" @@ -6917,22 +6918,40 @@ instruct loadUB(xRegI dst, memory mem) %{ %} // Load Unsigned Byte (8 bit UNsigned) into Long Register -instruct loadUB2L(eRegL dst, memory mem) -%{ +instruct loadUB2L(eRegL dst, memory mem, eFlagsReg cr) %{ match(Set dst (ConvI2L (LoadUB mem))); + effect(KILL cr); ins_cost(250); format %{ "MOVZX8 $dst.lo,$mem\t# ubyte -> long\n\t" "XOR $dst.hi,$dst.hi" %} ins_encode %{ - __ movzbl($dst$$Register, $mem$$Address); - __ xorl(HIGH_FROM_LOW($dst$$Register), HIGH_FROM_LOW($dst$$Register)); + Register Rdst = $dst$$Register; + __ movzbl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); %} ins_pipe(ialu_reg_mem); %} +// Load Unsigned Byte (8 bit UNsigned) with mask into Long Register +instruct loadUB2L_immI8(eRegL dst, memory mem, immI8 mask, eFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadUB mem) mask))); + effect(KILL cr); + + format %{ "MOVZX8 $dst.lo,$mem\t# ubyte & 8-bit mask -> long\n\t" + "XOR $dst.hi,$dst.hi\n\t" + "AND $dst.lo,$mask" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzbl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); + __ andl(Rdst, $mask$$constant); + %} + ins_pipe(ialu_reg_mem); +%} + // Load Short (16bit signed) instruct loadS(eRegI dst, memory mem) %{ match(Set dst (LoadS mem)); @@ -6960,8 +6979,9 @@ instruct loadS2B(eRegI dst, memory mem, immI_24 twentyfour) %{ %} // Load Short (16bit signed) into Long Register -instruct loadS2L(eRegL dst, memory mem) %{ +instruct loadS2L(eRegL dst, memory mem, eFlagsReg cr) %{ match(Set dst (ConvI2L (LoadS mem))); + effect(KILL cr); ins_cost(375); format %{ "MOVSX $dst.lo,$mem\t# short -> long\n\t" @@ -7004,8 +7024,9 @@ instruct loadUS2B(eRegI dst, memory mem, immI_24 twentyfour) %{ %} // Load Unsigned Short/Char (16 bit UNsigned) into Long Register -instruct loadUS2L(eRegL dst, memory mem) %{ +instruct loadUS2L(eRegL dst, memory mem, eFlagsReg cr) %{ match(Set dst (ConvI2L (LoadUS mem))); + effect(KILL cr); ins_cost(250); format %{ "MOVZX $dst.lo,$mem\t# ushort/char -> long\n\t" @@ -7019,6 +7040,38 @@ instruct loadUS2L(eRegL dst, memory mem) %{ ins_pipe(ialu_reg_mem); %} +// Load Unsigned Short/Char (16 bit UNsigned) with mask 0xFF into Long Register +instruct loadUS2L_immI_255(eRegL dst, memory mem, immI_255 mask, eFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + effect(KILL cr); + + format %{ "MOVZX8 $dst.lo,$mem\t# ushort/char & 0xFF -> long\n\t" + "XOR $dst.hi,$dst.hi" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzbl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); + %} + ins_pipe(ialu_reg_mem); +%} + +// Load Unsigned Short/Char (16 bit UNsigned) with a 16-bit mask into Long Register +instruct loadUS2L_immI16(eRegL dst, memory mem, immI16 mask, eFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + effect(KILL cr); + + format %{ "MOVZX $dst.lo, $mem\t# ushort/char & 16-bit mask -> long\n\t" + "XOR $dst.hi,$dst.hi\n\t" + "AND $dst.lo,$mask" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzwl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); + __ andl(Rdst, $mask$$constant); + %} + ins_pipe(ialu_reg_mem); +%} + // Load Integer instruct loadI(eRegI dst, memory mem) %{ match(Set dst (LoadI mem)); @@ -7082,8 +7135,9 @@ instruct loadI2US(eRegI dst, memory mem, immI_65535 mask) %{ %} // Load Integer into Long Register -instruct loadI2L(eRegL dst, memory mem) %{ +instruct loadI2L(eRegL dst, memory mem, eFlagsReg cr) %{ match(Set dst (ConvI2L (LoadI mem))); + effect(KILL cr); ins_cost(375); format %{ "MOV $dst.lo,$mem\t# int -> long\n\t" @@ -7099,9 +7153,57 @@ instruct loadI2L(eRegL dst, memory mem) %{ ins_pipe(ialu_reg_mem); %} +// Load Integer with mask 0xFF into Long Register +instruct loadI2L_immI_255(eRegL dst, memory mem, immI_255 mask, eFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + effect(KILL cr); + + format %{ "MOVZX8 $dst.lo,$mem\t# int & 0xFF -> long\n\t" + "XOR $dst.hi,$dst.hi" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzbl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); + %} + ins_pipe(ialu_reg_mem); +%} + +// Load Integer with mask 0xFFFF into Long Register +instruct loadI2L_immI_65535(eRegL dst, memory mem, immI_65535 mask, eFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + effect(KILL cr); + + format %{ "MOVZX $dst.lo,$mem\t# int & 0xFFFF -> long\n\t" + "XOR $dst.hi,$dst.hi" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzwl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); + %} + ins_pipe(ialu_reg_mem); +%} + +// Load Integer with 32-bit mask into Long Register +instruct loadI2L_immI(eRegL dst, memory mem, immI mask, eFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + effect(KILL cr); + + format %{ "MOV $dst.lo,$mem\t# int & 32-bit mask -> long\n\t" + "XOR $dst.hi,$dst.hi\n\t" + "AND $dst.lo,$mask" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movl(Rdst, $mem$$Address); + __ xorl(HIGH_FROM_LOW(Rdst), HIGH_FROM_LOW(Rdst)); + __ andl(Rdst, $mask$$constant); + %} + ins_pipe(ialu_reg_mem); +%} + // Load Unsigned Integer into Long Register -instruct loadUI2L(eRegL dst, memory mem) %{ +instruct loadUI2L(eRegL dst, memory mem, eFlagsReg cr) %{ match(Set dst (LoadUI2L mem)); + effect(KILL cr); ins_cost(250); format %{ "MOV $dst.lo,$mem\t# uint -> long\n\t" @@ -7695,6 +7797,17 @@ instruct storeL(long_memory mem, eRegL src) %{ ins_pipe( ialu_mem_long_reg ); %} +// Store Long to Integer +instruct storeL2I(memory mem, eRegL src) %{ + match(Set mem (StoreI mem (ConvL2I src))); + + format %{ "MOV $mem,$src.lo\t# long -> int" %} + ins_encode %{ + __ movl($mem$$Address, $src$$Register); + %} + ins_pipe(ialu_mem_reg); +%} + // Volatile Store Long. Must be atomic, so move it into // the FP TOS and then do a 64-bit FIST. Has to probe the // target address before the store (for null-ptr checks) diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index c0ffe70eb19..52afa81f659 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -6444,6 +6444,21 @@ instruct loadUB2L(rRegL dst, memory mem) ins_pipe(ialu_reg_mem); %} +// Load Unsigned Byte (8 bit UNsigned) with a 8-bit mask into Long Register +instruct loadUB2L_immI8(rRegL dst, memory mem, immI8 mask, rFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadUB mem) mask))); + effect(KILL cr); + + format %{ "movzbq $dst, $mem\t# ubyte & 8-bit mask -> long\n\t" + "andl $dst, $mask" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzbq(Rdst, $mem$$Address); + __ andl(Rdst, $mask$$constant); + %} + ins_pipe(ialu_reg_mem); +%} + // Load Short (16 bit signed) instruct loadS(rRegI dst, memory mem) %{ @@ -6528,6 +6543,32 @@ instruct loadUS2L(rRegL dst, memory mem) ins_pipe(ialu_reg_mem); %} +// Load Unsigned Short/Char (16 bit UNsigned) with mask 0xFF into Long Register +instruct loadUS2L_immI_255(rRegL dst, memory mem, immI_255 mask) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + + format %{ "movzbq $dst, $mem\t# ushort/char & 0xFF -> long" %} + ins_encode %{ + __ movzbq($dst$$Register, $mem$$Address); + %} + ins_pipe(ialu_reg_mem); +%} + +// Load Unsigned Short/Char (16 bit UNsigned) with mask into Long Register +instruct loadUS2L_immI16(rRegL dst, memory mem, immI16 mask, rFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadUS mem) mask))); + effect(KILL cr); + + format %{ "movzwq $dst, $mem\t# ushort/char & 16-bit mask -> long\n\t" + "andl $dst, $mask" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movzwq(Rdst, $mem$$Address); + __ andl(Rdst, $mask$$constant); + %} + ins_pipe(ialu_reg_mem); +%} + // Load Integer instruct loadI(rRegI dst, memory mem) %{ @@ -6606,6 +6647,43 @@ instruct loadI2L(rRegL dst, memory mem) ins_pipe(ialu_reg_mem); %} +// Load Integer with mask 0xFF into Long Register +instruct loadI2L_immI_255(rRegL dst, memory mem, immI_255 mask) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + + format %{ "movzbq $dst, $mem\t# int & 0xFF -> long" %} + ins_encode %{ + __ movzbq($dst$$Register, $mem$$Address); + %} + ins_pipe(ialu_reg_mem); +%} + +// Load Integer with mask 0xFFFF into Long Register +instruct loadI2L_immI_65535(rRegL dst, memory mem, immI_65535 mask) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + + format %{ "movzwq $dst, $mem\t# int & 0xFFFF -> long" %} + ins_encode %{ + __ movzwq($dst$$Register, $mem$$Address); + %} + ins_pipe(ialu_reg_mem); +%} + +// Load Integer with a 32-bit mask into Long Register +instruct loadI2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{ + match(Set dst (ConvI2L (AndI (LoadI mem) mask))); + effect(KILL cr); + + format %{ "movl $dst, $mem\t# int & 32-bit mask -> long\n\t" + "andl $dst, $mask" %} + ins_encode %{ + Register Rdst = $dst$$Register; + __ movl(Rdst, $mem$$Address); + __ andl(Rdst, $mask$$constant); + %} + ins_pipe(ialu_reg_mem); +%} + // Load Unsigned Integer into Long Register instruct loadUI2L(rRegL dst, memory mem) %{ @@ -11673,8 +11751,9 @@ instruct convI2L_reg_reg(rRegL dst, rRegI src) ins_cost(125); format %{ "movslq $dst, $src\t# i2l" %} - opcode(0x63); // needs REX.W - ins_encode(REX_reg_reg_wide(dst, src), OpcP, reg_reg(dst,src)); + ins_encode %{ + __ movslq($dst$$Register, $src$$Register); + %} ins_pipe(ialu_reg_reg); %} diff --git a/hotspot/src/share/vm/opto/mulnode.cpp b/hotspot/src/share/vm/opto/mulnode.cpp index 7700272f6d9..b9dc06bb369 100644 --- a/hotspot/src/share/vm/opto/mulnode.cpp +++ b/hotspot/src/share/vm/opto/mulnode.cpp @@ -430,31 +430,28 @@ Node *AndINode::Identity( PhaseTransform *phase ) { // x & x => x if (phase->eqv(in(1), in(2))) return in(1); - Node *load = in(1); - const TypeInt *t2 = phase->type( in(2) )->isa_int(); - if( t2 && t2->is_con() ) { + Node* in1 = in(1); + uint op = in1->Opcode(); + const TypeInt* t2 = phase->type(in(2))->isa_int(); + if (t2 && t2->is_con()) { int con = t2->get_con(); // Masking off high bits which are always zero is useless. const TypeInt* t1 = phase->type( in(1) )->isa_int(); if (t1 != NULL && t1->_lo >= 0) { - jint t1_support = ((jint)1 << (1 + log2_intptr(t1->_hi))) - 1; + jint t1_support = right_n_bits(1 + log2_intptr(t1->_hi)); if ((t1_support & con) == t1_support) - return load; + return in1; } - uint lop = load->Opcode(); - if( lop == Op_LoadUS && - con == 0x0000FFFF ) // Already zero-extended - return load; // Masking off the high bits of a unsigned-shift-right is not // needed either. - if( lop == Op_URShiftI ) { - const TypeInt *t12 = phase->type( load->in(2) )->isa_int(); - if( t12 && t12->is_con() ) { // Shift is by a constant + if (op == Op_URShiftI) { + const TypeInt* t12 = phase->type(in1->in(2))->isa_int(); + if (t12 && t12->is_con()) { // Shift is by a constant int shift = t12->get_con(); shift &= BitsPerJavaInteger - 1; // semantics of Java shifts int mask = max_juint >> shift; - if( (mask&con) == mask ) // If AND is useless, skip it - return load; + if ((mask & con) == mask) // If AND is useless, skip it + return in1; } } } @@ -476,26 +473,17 @@ Node *AndINode::Ideal(PhaseGVN *phase, bool can_reshape) { return new (phase->C, 3) AndINode(load,phase->intcon(mask&0xFFFF)); // Masking bits off of a Short? Loading a Character does some masking - if( lop == Op_LoadS && - (mask & 0xFFFF0000) == 0 ) { + if (lop == Op_LoadS && (mask & 0xFFFF0000) == 0 ) { Node *ldus = new (phase->C, 3) LoadUSNode(load->in(MemNode::Control), - load->in(MemNode::Memory), - load->in(MemNode::Address), - load->adr_type()); + load->in(MemNode::Memory), + load->in(MemNode::Address), + load->adr_type()); ldus = phase->transform(ldus); - return new (phase->C, 3) AndINode(ldus, phase->intcon(mask&0xFFFF)); + return new (phase->C, 3) AndINode(ldus, phase->intcon(mask & 0xFFFF)); } - // Masking sign bits off of a Byte? Do an unsigned byte load. - if (lop == Op_LoadB && mask == 0x000000FF) { - return new (phase->C, 3) LoadUBNode(load->in(MemNode::Control), - load->in(MemNode::Memory), - load->in(MemNode::Address), - load->adr_type()); - } - - // Masking sign bits off of a Byte plus additional lower bits? Do - // an unsigned byte load plus an and. + // Masking sign bits off of a Byte? Do an unsigned byte load plus + // an and. if (lop == Op_LoadB && (mask & 0xFFFFFF00) == 0) { Node* ldub = new (phase->C, 3) LoadUBNode(load->in(MemNode::Control), load->in(MemNode::Memory), @@ -605,8 +593,13 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* in1 = in(1); uint op = in1->Opcode(); - // Masking sign bits off of an integer? Do an unsigned integer to long load. - if (op == Op_ConvI2L && in1->in(1)->Opcode() == Op_LoadI && mask == 0x00000000FFFFFFFFL) { + // Masking sign bits off of an integer? Do an unsigned integer to + // long load. + // NOTE: This check must be *before* we try to convert the AndLNode + // to an AndINode and commute it with ConvI2LNode because + // 0xFFFFFFFFL masks the whole integer and we get a sign extension, + // which is wrong. + if (op == Op_ConvI2L && in1->in(1)->Opcode() == Op_LoadI && mask == CONST64(0x00000000FFFFFFFF)) { Node* load = in1->in(1); return new (phase->C, 3) LoadUI2LNode(load->in(MemNode::Control), load->in(MemNode::Memory), @@ -614,9 +607,22 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { load->adr_type()); } + // Are we masking a long that was converted from an int with a mask + // that fits in 32-bits? Commute them and use an AndINode. + if (op == Op_ConvI2L && (mask & CONST64(0xFFFFFFFF00000000)) == 0) { + // If we are doing an UI2L conversion (i.e. the mask is + // 0x00000000FFFFFFFF) we cannot convert the AndL to an AndI + // because the AndI would be optimized away later in Identity. + if (mask != CONST64(0x00000000FFFFFFFF)) { + Node* andi = new (phase->C, 3) AndINode(in1->in(1), phase->intcon(mask)); + andi = phase->transform(andi); + return new (phase->C, 2) ConvI2LNode(andi); + } + } + // Masking off sign bits? Dont make them! if (op == Op_RShiftL) { - const TypeInt *t12 = phase->type(in1->in(2))->isa_int(); + const TypeInt* t12 = phase->type(in1->in(2))->isa_int(); if( t12 && t12->is_con() ) { // Shift is by a constant int shift = t12->get_con(); shift &= BitsPerJavaLong - 1; // semantics of Java shifts @@ -626,7 +632,7 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { if( (sign_bits_mask & mask) == 0 ) { // Use zero-fill shift instead Node *zshift = phase->transform(new (phase->C, 3) URShiftLNode(in1->in(1), in1->in(2))); - return new (phase->C, 3) AndLNode( zshift, in(2) ); + return new (phase->C, 3) AndLNode(zshift, in(2)); } } } diff --git a/hotspot/test/compiler/5057225/Test5057225.java b/hotspot/test/compiler/5057225/Test5057225.java new file mode 100644 index 00000000000..2a7360f7de8 --- /dev/null +++ b/hotspot/test/compiler/5057225/Test5057225.java @@ -0,0 +1,140 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 5057225 + * @summary Remove useless I2L conversions + * + * @run main/othervm -Xcomp -XX:CompileOnly=Test5057225.doload Test5057225 + */ + +import java.net.URLClassLoader; + +public class Test5057225 { + static byte[] ba = new byte[] { -1 }; + static short[] sa = new short[] { -1 }; + static int[] ia = new int[] { -1 }; + + static final long[] BYTE_MASKS = { + 0x0FL, + 0x7FL, // 7-bit + 0xFFL, + }; + + static final long[] SHORT_MASKS = { + 0x000FL, + 0x007FL, // 7-bit + 0x00FFL, + 0x0FFFL, + 0x3FFFL, // 14-bit + 0x7FFFL, // 15-bit + 0xFFFFL, + }; + + static final long[] INT_MASKS = { + 0x0000000FL, + 0x0000007FL, // 7-bit + 0x000000FFL, + 0x00000FFFL, + 0x00003FFFL, // 14-bit + 0x00007FFFL, // 15-bit + 0x0000FFFFL, + 0x00FFFFFFL, + 0x7FFFFFFFL, // 31-bit + 0xFFFFFFFFL, + }; + + public static void main(String[] args) throws Exception { + for (int i = 0; i < BYTE_MASKS.length; i++) { + System.setProperty("value", "" + BYTE_MASKS[i]); + loadAndRunClass("Test5057225$loadUB2L"); + } + + for (int i = 0; i < SHORT_MASKS.length; i++) { + System.setProperty("value", "" + SHORT_MASKS[i]); + loadAndRunClass("Test5057225$loadUS2L"); + } + + for (int i = 0; i < INT_MASKS.length; i++) { + System.setProperty("value", "" + INT_MASKS[i]); + loadAndRunClass("Test5057225$loadUI2L"); + } + } + + static void check(long result, long expected) { + if (result != expected) + throw new InternalError(result + " != " + expected); + } + + static void loadAndRunClass(String classname) throws Exception { + Class cl = Class.forName(classname); + URLClassLoader apploader = (URLClassLoader) cl.getClassLoader(); + ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent()); + Class c = loader.loadClass(classname); + Runnable r = (Runnable) c.newInstance(); + r.run(); + } + + public static class loadUB2L implements Runnable { + static final long MASK; + static { + long value = 0; + try { + value = Long.decode(System.getProperty("value")); + } catch (Throwable e) {} + MASK = value; + } + + public void run() { check(doload(ba), MASK); } + static long doload(byte[] ba) { return ba[0] & MASK; } + } + + public static class loadUS2L implements Runnable { + static final long MASK; + static { + long value = 0; + try { + value = Long.decode(System.getProperty("value")); + } catch (Throwable e) {} + MASK = value; + } + + public void run() { check(doload(sa), MASK); } + static long doload(short[] sa) { return sa[0] & MASK; } + } + + public static class loadUI2L implements Runnable { + static final long MASK; + static { + long value = 0; + try { + value = Long.decode(System.getProperty("value")); + } catch (Throwable e) {} + MASK = value; + } + + public void run() { check(doload(ia), MASK); } + static long doload(int[] ia) { return ia[0] & MASK; } + } +} From bf215dbb7e1d25af32bbeedcef1835ff665301e2 Mon Sep 17 00:00:00 2001 From: Andrey Petrusenko Date: Fri, 26 Jun 2009 09:22:19 -0700 Subject: [PATCH 09/91] 6854027: Precompiled headers are not being updated in Linux/GCC builds Fixes incorrect handling of precompiled headers in diff mode. Reviewed-by: never, twisti --- .../src/share/tools/MakeDeps/Database.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/hotspot/src/share/tools/MakeDeps/Database.java b/hotspot/src/share/tools/MakeDeps/Database.java index 3cdffebca49..861fc2ef553 100644 --- a/hotspot/src/share/tools/MakeDeps/Database.java +++ b/hotspot/src/share/tools/MakeDeps/Database.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ public class Database { private HashMap platformDepFiles; private long threshold; private int nOuterFiles; - private int nPrecompiledFiles; private boolean missingOk; private Platform plat; /** These allow you to specify files not in the include database @@ -62,7 +61,6 @@ public class Database { threshold = t; nOuterFiles = 0; - nPrecompiledFiles = 0; missingOk = false; firstFile = null; lastFile = null; @@ -343,7 +341,6 @@ public class Database { plat.getGIFileTemplate().getInvDir() + list.getName() + "\""); - nPrecompiledFiles += 1; } } inclFile.println(); @@ -408,22 +405,22 @@ public class Database { gd.println(); } - if (nPrecompiledFiles > 0) { - // write Precompiled_Files = ... - gd.println("Precompiled_Files = \\"); - for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) { - FileList list = (FileList) iter.next(); + // write Precompiled_Files = ... + gd.println("Precompiled_Files = \\"); + for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) { + FileList list = (FileList) iter.next(); + if (list.getCount() >= threshold) { gd.println(list.getName() + " \\"); String platformDep = platformDepFiles.get(list.getName()); if (platformDep != null) { - // make sure changes to the platform dependent file will - // cause regeneration of the pch file. - gd.println(platformDep + " \\"); + // make sure changes to the platform dependent file will + // cause regeneration of the pch file. + gd.println(platformDep + " \\"); } } - gd.println(); - gd.println(); } + gd.println(); + gd.println(); gd.println("DTraced_Files = \\"); for (Iterator iter = outerFiles.iterator(); iter.hasNext(); ) { @@ -483,7 +480,6 @@ public class Database { } if (plat.includeGIDependencies() - && nPrecompiledFiles > 0 && anII.getUseGrandInclude()) { gd.println(" $(Precompiled_Files) \\"); } From 3bdd70fe1877b3edc93118d2f7583021f87e1a3c Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Fri, 26 Jun 2009 13:03:29 -0700 Subject: [PATCH 10/91] 6818666: G1: Type lost in g1 pre-barrier Reviewed-by: kvn --- hotspot/src/share/vm/opto/graphKit.cpp | 33 ++++++++++++++++------ hotspot/src/share/vm/opto/graphKit.hpp | 9 +++--- hotspot/src/share/vm/opto/library_call.cpp | 9 +++--- hotspot/src/share/vm/opto/parse2.cpp | 2 +- hotspot/src/share/vm/opto/parse3.cpp | 4 +-- 5 files changed, 36 insertions(+), 21 deletions(-) diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index f309c05c6c6..5bf9a759c08 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1378,7 +1378,7 @@ void GraphKit::pre_barrier(Node* ctl, Node* adr, uint adr_idx, Node *val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt) { BarrierSet* bs = Universe::heap()->barrier_set(); set_control(ctl); @@ -1436,7 +1436,7 @@ Node* GraphKit::store_oop_to_object(Node* ctl, Node* adr, const TypePtr* adr_type, Node *val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt) { uint adr_idx = C->get_alias_index(adr_type); Node* store; @@ -1451,7 +1451,7 @@ Node* GraphKit::store_oop_to_array(Node* ctl, Node* adr, const TypePtr* adr_type, Node *val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt) { uint adr_idx = C->get_alias_index(adr_type); Node* store; @@ -1466,12 +1466,29 @@ Node* GraphKit::store_oop_to_unknown(Node* ctl, Node* adr, const TypePtr* adr_type, Node *val, - const Type* val_type, BasicType bt) { - uint adr_idx = C->get_alias_index(adr_type); - Node* store; + Compile::AliasType* at = C->alias_type(adr_type); + const TypeOopPtr* val_type = NULL; + if (adr_type->isa_instptr()) { + if (at->field() != NULL) { + // known field. This code is a copy of the do_put_xxx logic. + ciField* field = at->field(); + if (!field->type()->is_loaded()) { + val_type = TypeInstPtr::BOTTOM; + } else { + val_type = TypeOopPtr::make_from_klass(field->type()->as_klass()); + } + } + } else if (adr_type->isa_aryptr()) { + val_type = adr_type->is_aryptr()->elem()->isa_oopptr(); + } + if (val_type == NULL) { + val_type = TypeInstPtr::BOTTOM; + } + + uint adr_idx = at->index(); pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); - store = store_to_memory(control(), adr, val, bt, adr_idx); + Node* store = store_to_memory(control(), adr, val, bt, adr_idx); post_barrier(control(), store, obj, adr, adr_idx, val, bt, true); return store; } @@ -3202,7 +3219,7 @@ void GraphKit::g1_write_barrier_pre(Node* obj, Node* adr, uint alias_idx, Node* val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt) { IdealKit ideal(gvn(), control(), merged_memory(), true); #define __ ideal. diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index f47bc49a706..7904a0b0f2f 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -454,7 +454,7 @@ class GraphKit : public Phase { Node* adr, // actual adress to store val at const TypePtr* adr_type, Node* val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt); Node* store_oop_to_array(Node* ctl, @@ -462,7 +462,7 @@ class GraphKit : public Phase { Node* adr, // actual adress to store val at const TypePtr* adr_type, Node* val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt); // Could be an array or object we don't know at compile time (unsafe ref.) @@ -471,12 +471,11 @@ class GraphKit : public Phase { Node* adr, // actual adress to store val at const TypePtr* adr_type, Node* val, - const Type* val_type, BasicType bt); // For the few case where the barriers need special help void pre_barrier(Node* ctl, Node* obj, Node* adr, uint adr_idx, - Node* val, const Type* val_type, BasicType bt); + Node* val, const TypeOopPtr* val_type, BasicType bt); void post_barrier(Node* ctl, Node* store, Node* obj, Node* adr, uint adr_idx, Node* val, BasicType bt, bool use_precise); @@ -599,7 +598,7 @@ class GraphKit : public Phase { Node* adr, uint alias_idx, Node* val, - const Type* val_type, + const TypeOopPtr* val_type, BasicType bt); void g1_write_barrier_post(Node* store, diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 136b8cb0d11..483c070e3e6 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -2178,9 +2178,8 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas // Possibly an oop being stored to Java heap or native memory if (!TypePtr::NULL_PTR->higher_equal(_gvn.type(heap_base_oop))) { // oop to Java heap. - (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, val->bottom_type(), type); + (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type); } else { - // We can't tell at compile time if we are storing in the Java heap or outside // of it. So we need to emit code to conditionally do the proper type of // store. @@ -2189,7 +2188,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas kit.declares_done(); // QQQ who knows what probability is here?? kit.if_then(heap_base_oop, BoolTest::ne, null(), PROB_UNLIKELY(0.999)); { - (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, val->bottom_type(), type); + (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type); } kit.else_(); { (void) store_to_memory(control(), adr, val, type, adr_type, is_volatile); } kit.end_if(); @@ -2394,7 +2393,7 @@ bool LibraryCallKit::inline_unsafe_CAS(BasicType type) { case T_OBJECT: // reference stores need a store barrier. // (They don't if CAS fails, but it isn't worth checking.) - pre_barrier(control(), base, adr, alias_idx, newval, value_type, T_OBJECT); + pre_barrier(control(), base, adr, alias_idx, newval, value_type->is_oopptr(), T_OBJECT); #ifdef _LP64 if (adr->bottom_type()->is_ptr_to_narrowoop()) { Node *newval_enc = _gvn.transform(new (C, 2) EncodePNode(newval, newval->bottom_type()->make_narrowoop())); @@ -2489,7 +2488,7 @@ bool LibraryCallKit::inline_unsafe_ordered_store(BasicType type) { bool require_atomic_access = true; Node* store; if (type == T_OBJECT) // reference stores need a store barrier. - store = store_oop_to_unknown(control(), base, adr, adr_type, val, value_type, type); + store = store_oop_to_unknown(control(), base, adr, adr_type, val, type); else { store = store_to_memory(control(), adr, val, type, adr_type, require_atomic_access); } diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index 02a6ceccf07..19e486d83a9 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1565,7 +1565,7 @@ void Parse::do_one_bytecode() { c = pop(); // Oop to store b = pop(); // index (already used) a = pop(); // the array itself - const Type* elemtype = _gvn.type(a)->is_aryptr()->elem(); + const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->is_oopptr(); const TypeAryPtr* adr_type = TypeAryPtr::OOPS; Node* store = store_oop_to_array(control(), a, d, adr_type, c, elemtype, T_OBJECT); break; diff --git a/hotspot/src/share/vm/opto/parse3.cpp b/hotspot/src/share/vm/opto/parse3.cpp index b3e95ad66fa..960b95c1c9c 100644 --- a/hotspot/src/share/vm/opto/parse3.cpp +++ b/hotspot/src/share/vm/opto/parse3.cpp @@ -222,7 +222,7 @@ void Parse::do_put_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool // Store the value. Node* store; if (bt == T_OBJECT) { - const TypePtr* field_type; + const TypeOopPtr* field_type; if (!field->type()->is_loaded()) { field_type = TypeInstPtr::BOTTOM; } else { @@ -361,7 +361,7 @@ Node* Parse::expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, in guarantee(length_con >= 0, "non-constant multianewarray"); ciArrayKlass* array_klass_1 = array_klass->as_obj_array_klass()->element_klass()->as_array_klass(); const TypePtr* adr_type = TypeAryPtr::OOPS; - const Type* elemtype = _gvn.type(array)->is_aryptr()->elem(); + const TypeOopPtr* elemtype = _gvn.type(array)->is_aryptr()->elem()->is_oopptr(); const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT); for (jint i = 0; i < length_con; i++) { Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs); From 986d5709816c5544366cd4b44f7c799bc28b6895 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Fri, 26 Jun 2009 16:14:31 -0700 Subject: [PATCH 11/91] 6851908: interpreter null check profiling broken causing extra compilation invalidation Reviewed-by: kvn --- hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp | 2 ++ hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index 9dc29f31da9..db0b6e32f49 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -1372,6 +1372,8 @@ void InterpreterMacroAssembler::profile_null_seen(Register mdp) { // If no method data exists, go to profile_continue. test_method_data_pointer(mdp, profile_continue); + set_mdp_flag_at(mdp, BitData::null_seen_byte_constant()); + // The method data pointer needs to be updated. int mdp_delta = in_bytes(BitData::bit_data_size()); if (TypeProfileCasts) { diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index dbd858da298..0c1af9b0814 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -1409,6 +1409,8 @@ void InterpreterMacroAssembler::profile_null_seen(Register mdp) { // If no method data exists, go to profile_continue. test_method_data_pointer(mdp, profile_continue); + set_mdp_flag_at(mdp, BitData::null_seen_byte_constant()); + // The method data pointer needs to be updated. int mdp_delta = in_bytes(BitData::bit_data_size()); if (TypeProfileCasts) { From eec17fe775929425c741fff10b70d7b779433e96 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Mon, 29 Jun 2009 12:17:03 -0400 Subject: [PATCH 12/91] 6855115: G1: Fix for 6850869 is incorrect Missed updating two variable names when improving the code for 6850869. Reviewed-by: iveresov, jmasa, ysr --- hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index d0a702a371c..20f001d7758 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -1256,8 +1256,8 @@ public: // the humongous regions (in case this changes in the future). G1CollectedHeap* g1h = G1CollectedHeap::heap(); size_t end_index = index + 1; - while (index < g1h->n_regions()) { - HeapRegion* chr = g1h->region_at(index); + while (end_index < g1h->n_regions()) { + HeapRegion* chr = g1h->region_at(end_index); if (!chr->continuesHumongous()) { break; } From f7b598496d40200f6bab01a8fdac27060a6111c3 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 30 Jun 2009 11:11:10 +0100 Subject: [PATCH 13/91] 6843003: Windows Server 2008 R2 system recognition Reviewed-by: ohair, sherman --- .../windows/native/java/lang/java_props_md.c | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/jdk/src/windows/native/java/lang/java_props_md.c b/jdk/src/windows/native/java/lang/java_props_md.c index b15a9bafac0..4ab139ad307 100644 --- a/jdk/src/windows/native/java/lang/java_props_md.c +++ b/jdk/src/windows/native/java/lang/java_props_md.c @@ -714,10 +714,10 @@ GetJavaProperties(JNIEnv* env) * Windows XP 64 bit 5 2 * where ((&ver.wServicePackMinor) + 2) = 1 * and si.wProcessorArchitecture = 9 - * Windows Vista family 6 0 - * Windows 2008 6 0 - * where ((&ver.wServicePackMinor) + 2) = 1 - * Windows 7 6 1 + * Windows Vista family 6 0 (VER_NT_WORKSTATION) + * Windows Server 2008 6 0 (!VER_NT_WORKSTATION) + * Windows 7 6 1 (VER_NT_WORKSTATION) + * Windows Server 2008 R2 6 1 (!VER_NT_WORKSTATION) * * This mapping will presumably be augmented as new Windows * versions are released. @@ -768,14 +768,7 @@ GetJavaProperties(JNIEnv* env) } } else if (ver.dwMajorVersion == 6) { /* - * From MSDN OSVERSIONINFOEX documentation: - * - * "Because the version numbers for Windows Server 2008 - * and Windows Vista are identical, you must also test - * whether the wProductType member is VER_NT_WORKSTATION. - * If wProductType is VER_NT_WORKSTATION, the operating - * system is Windows Vista or 7; otherwise, it is Windows - * Server 2008." + * See table in MSDN OSVERSIONINFOEX documentation. */ if (ver.wProductType == VER_NT_WORKSTATION) { switch (ver.dwMinorVersion) { @@ -784,7 +777,11 @@ GetJavaProperties(JNIEnv* env) default: sprops.os_name = "Windows NT (unknown)"; } } else { - sprops.os_name = "Windows Server 2008"; + switch (ver.dwMinorVersion) { + case 0: sprops.os_name = "Windows Server 2008"; break; + case 1: sprops.os_name = "Windows Server 2008 R2"; break; + default: sprops.os_name = "Windows NT (unknown)"; + } } } else { sprops.os_name = "Windows NT (unknown)"; From da11e65fa42372d78a2981b61842d6f84af5a91e Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Wed, 1 Jul 2009 12:22:23 -0700 Subject: [PATCH 14/91] 6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer") Reviewed-by: kvn --- hotspot/src/share/vm/adlc/output_h.cpp | 4 ++-- hotspot/src/share/vm/opto/graphKit.cpp | 2 +- hotspot/src/share/vm/opto/library_call.cpp | 2 +- hotspot/src/share/vm/opto/parse2.cpp | 2 +- hotspot/src/share/vm/opto/parse3.cpp | 2 +- hotspot/src/share/vm/opto/type.cpp | 22 +++++++++--------- hotspot/src/share/vm/opto/type.hpp | 27 ++++++++++++++-------- 7 files changed, 35 insertions(+), 26 deletions(-) diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp index 4668d68f9fa..23f0827b2e8 100644 --- a/hotspot/src/share/vm/adlc/output_h.cpp +++ b/hotspot/src/share/vm/adlc/output_h.cpp @@ -1367,11 +1367,11 @@ void ArchDesc::declareClasses(FILE *fp) { else if (!strcmp(oper->ideal_type(_globalNames), "ConN")) { // Access the locally stored constant fprintf(fp," virtual intptr_t constant() const {"); - fprintf(fp, " return _c0->make_oopptr()->get_con();"); + fprintf(fp, " return _c0->get_ptrtype()->get_con();"); fprintf(fp, " }\n"); // Generate query to determine if this pointer is an oop fprintf(fp," virtual bool constant_is_oop() const {"); - fprintf(fp, " return _c0->make_oopptr()->isa_oop_ptr();"); + fprintf(fp, " return _c0->get_ptrtype()->isa_oop_ptr();"); fprintf(fp, " }\n"); } else if (!strcmp(oper->ideal_type(_globalNames), "ConL")) { diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 5bf9a759c08..83646c54ed9 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1480,7 +1480,7 @@ Node* GraphKit::store_oop_to_unknown(Node* ctl, } } } else if (adr_type->isa_aryptr()) { - val_type = adr_type->is_aryptr()->elem()->isa_oopptr(); + val_type = adr_type->is_aryptr()->elem()->make_oopptr(); } if (val_type == NULL) { val_type = TypeInstPtr::BOTTOM; diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 483c070e3e6..dc674f93821 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -2393,7 +2393,7 @@ bool LibraryCallKit::inline_unsafe_CAS(BasicType type) { case T_OBJECT: // reference stores need a store barrier. // (They don't if CAS fails, but it isn't worth checking.) - pre_barrier(control(), base, adr, alias_idx, newval, value_type->is_oopptr(), T_OBJECT); + pre_barrier(control(), base, adr, alias_idx, newval, value_type->make_oopptr(), T_OBJECT); #ifdef _LP64 if (adr->bottom_type()->is_ptr_to_narrowoop()) { Node *newval_enc = _gvn.transform(new (C, 2) EncodePNode(newval, newval->bottom_type()->make_narrowoop())); diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index 19e486d83a9..40675d41cbc 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1565,7 +1565,7 @@ void Parse::do_one_bytecode() { c = pop(); // Oop to store b = pop(); // index (already used) a = pop(); // the array itself - const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->is_oopptr(); + const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->make_oopptr(); const TypeAryPtr* adr_type = TypeAryPtr::OOPS; Node* store = store_oop_to_array(control(), a, d, adr_type, c, elemtype, T_OBJECT); break; diff --git a/hotspot/src/share/vm/opto/parse3.cpp b/hotspot/src/share/vm/opto/parse3.cpp index 960b95c1c9c..0869ee6b634 100644 --- a/hotspot/src/share/vm/opto/parse3.cpp +++ b/hotspot/src/share/vm/opto/parse3.cpp @@ -361,7 +361,7 @@ Node* Parse::expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, in guarantee(length_con >= 0, "non-constant multianewarray"); ciArrayKlass* array_klass_1 = array_klass->as_obj_array_klass()->element_klass()->as_array_klass(); const TypePtr* adr_type = TypeAryPtr::OOPS; - const TypeOopPtr* elemtype = _gvn.type(array)->is_aryptr()->elem()->is_oopptr(); + const TypeOopPtr* elemtype = _gvn.type(array)->is_aryptr()->elem()->make_oopptr(); const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT); for (jint i = 0; i < length_con; i++) { Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs); diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index 3c32c348c7e..1db520a4254 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -3484,27 +3484,27 @@ const TypeNarrowOop* TypeNarrowOop::make(const TypePtr* type) { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeNarrowOop::hash(void) const { - return _ooptype->hash() + 7; + return _ptrtype->hash() + 7; } bool TypeNarrowOop::eq( const Type *t ) const { const TypeNarrowOop* tc = t->isa_narrowoop(); if (tc != NULL) { - if (_ooptype->base() != tc->_ooptype->base()) { + if (_ptrtype->base() != tc->_ptrtype->base()) { return false; } - return tc->_ooptype->eq(_ooptype); + return tc->_ptrtype->eq(_ptrtype); } return false; } bool TypeNarrowOop::singleton(void) const { // TRUE if type is a singleton - return _ooptype->singleton(); + return _ptrtype->singleton(); } bool TypeNarrowOop::empty(void) const { - return _ooptype->empty(); + return _ptrtype->empty(); } //------------------------------xmeet------------------------------------------ @@ -3538,7 +3538,7 @@ const Type *TypeNarrowOop::xmeet( const Type *t ) const { return this; case NarrowOop: { - const Type* result = _ooptype->xmeet(t->make_ptr()); + const Type* result = _ptrtype->xmeet(t->make_ptr()); if (result->isa_ptr()) { return TypeNarrowOop::make(result->is_ptr()); } @@ -3554,13 +3554,13 @@ const Type *TypeNarrowOop::xmeet( const Type *t ) const { } const Type *TypeNarrowOop::xdual() const { // Compute dual right now. - const TypePtr* odual = _ooptype->dual()->is_ptr(); + const TypePtr* odual = _ptrtype->dual()->is_ptr(); return new TypeNarrowOop(odual); } const Type *TypeNarrowOop::filter( const Type *kills ) const { if (kills->isa_narrowoop()) { - const Type* ft =_ooptype->filter(kills->is_narrowoop()->_ooptype); + const Type* ft =_ptrtype->filter(kills->is_narrowoop()->_ptrtype); if (ft->empty()) return Type::TOP; // Canonical empty value if (ft->isa_ptr()) { @@ -3568,7 +3568,7 @@ const Type *TypeNarrowOop::filter( const Type *kills ) const { } return ft; } else if (kills->isa_ptr()) { - const Type* ft = _ooptype->join(kills); + const Type* ft = _ptrtype->join(kills); if (ft->empty()) return Type::TOP; // Canonical empty value return ft; @@ -3579,13 +3579,13 @@ const Type *TypeNarrowOop::filter( const Type *kills ) const { intptr_t TypeNarrowOop::get_con() const { - return _ooptype->get_con(); + return _ptrtype->get_con(); } #ifndef PRODUCT void TypeNarrowOop::dump2( Dict & d, uint depth, outputStream *st ) const { st->print("narrowoop: "); - _ooptype->dump2(d, depth, st); + _ptrtype->dump2(d, depth, st); } #endif diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index 1683c384b65..06419149147 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -232,6 +232,11 @@ public: // Returns this ptr type or the equivalent ptr type for this compressed pointer. const TypePtr* make_ptr() const; + + // Returns this oopptr type or the equivalent oopptr type for this compressed pointer. + // Asserts if the underlying type is not an oopptr or narrowoop. + const TypeOopPtr* make_oopptr() const; + // Returns this compressed pointer or the equivalent compressed version // of this pointer type. const TypeNarrowOop* make_narrowoop() const; @@ -932,13 +937,13 @@ public: // between the normal and the compressed form. class TypeNarrowOop : public Type { protected: - const TypePtr* _ooptype; // Could be TypePtr::NULL_PTR + const TypePtr* _ptrtype; // Could be TypePtr::NULL_PTR - TypeNarrowOop( const TypePtr* ooptype): Type(NarrowOop), - _ooptype(ooptype) { - assert(ooptype->offset() == 0 || - ooptype->offset() == OffsetBot || - ooptype->offset() == OffsetTop, "no real offsets"); + TypeNarrowOop( const TypePtr* ptrtype): Type(NarrowOop), + _ptrtype(ptrtype) { + assert(ptrtype->offset() == 0 || + ptrtype->offset() == OffsetBot || + ptrtype->offset() == OffsetTop, "no real offsets"); } public: virtual bool eq( const Type *t ) const; @@ -962,8 +967,8 @@ public: } // returns the equivalent ptr type for this compressed pointer - const TypePtr *make_oopptr() const { - return _ooptype; + const TypePtr *get_ptrtype() const { + return _ptrtype; } static const TypeNarrowOop *BOTTOM; @@ -1150,10 +1155,14 @@ inline const TypeKlassPtr *Type::is_klassptr() const { } inline const TypePtr* Type::make_ptr() const { - return (_base == NarrowOop) ? is_narrowoop()->make_oopptr() : + return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() : (isa_ptr() ? is_ptr() : NULL); } +inline const TypeOopPtr* Type::make_oopptr() const { + return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype()->is_oopptr() : is_oopptr(); +} + inline const TypeNarrowOop* Type::make_narrowoop() const { return (_base == NarrowOop) ? is_narrowoop() : (isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL); From bb726c6f280ed074ac9100c10d96e3fa9397642c Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Wed, 1 Jul 2009 20:22:18 -0700 Subject: [PATCH 15/91] 6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14 Put missed reference to allocated array in copyOf() intrinsic into OopMap for the call slow_arraycopy(). Reviewed-by: never --- .../hotspot/ui/tree/OopTreeNodeAdapter.java | 2 + hotspot/make/solaris/makefiles/optimized.make | 2 +- hotspot/src/share/vm/opto/block.cpp | 3 + hotspot/src/share/vm/opto/block.hpp | 4 + hotspot/src/share/vm/opto/buildOopMap.cpp | 25 +- hotspot/src/share/vm/opto/gcm.cpp | 3 + hotspot/src/share/vm/opto/library_call.cpp | 334 +++++++++--------- 7 files changed, 189 insertions(+), 184 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java index 4edcd787ad5..6ee998699bd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java @@ -161,6 +161,8 @@ public class OopTreeNodeAdapter extends FieldTreeNodeAdapter { child = new OopTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode()); } catch (AddressException e) { child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode()); + } catch (UnknownOopException e) { + child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode()); } } ++curField; diff --git a/hotspot/make/solaris/makefiles/optimized.make b/hotspot/make/solaris/makefiles/optimized.make index 69848b73661..66609cae946 100644 --- a/hotspot/make/solaris/makefiles/optimized.make +++ b/hotspot/make/solaris/makefiles/optimized.make @@ -41,7 +41,7 @@ ifeq ($(COMPILER_REV_NUMERIC),509) endif # Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) -ifeq ($(COMPILER_REV_NUMERIC),508)) +ifeq ($(COMPILER_REV_NUMERIC),508) OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) endif # COMPILER_REV_NUMERIC == 508 diff --git a/hotspot/src/share/vm/opto/block.cpp b/hotspot/src/share/vm/opto/block.cpp index 10ceec302f9..7af5c4f57f6 100644 --- a/hotspot/src/share/vm/opto/block.cpp +++ b/hotspot/src/share/vm/opto/block.cpp @@ -357,6 +357,9 @@ PhaseCFG::PhaseCFG( Arena *a, RootNode *r, Matcher &m ) : #ifndef PRODUCT , _trace_opto_pipelining(TraceOptoPipelining || C->method_has_option("TraceOptoPipelining")) #endif +#ifdef ASSERT + , _raw_oops(a) +#endif { ResourceMark rm; // I'll need a few machine-specific GotoNodes. Make an Ideal GotoNode, diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp index aac5105d66a..93940b466c3 100644 --- a/hotspot/src/share/vm/opto/block.hpp +++ b/hotspot/src/share/vm/opto/block.hpp @@ -380,6 +380,10 @@ class PhaseCFG : public Phase { bool _trace_opto_pipelining; // tracing flag #endif +#ifdef ASSERT + Unique_Node_List _raw_oops; +#endif + // Build dominators void Dominators(); diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 9401e024a7c..81ad6b7dbee 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -74,9 +74,11 @@ struct OopFlow : public ResourceObj { // this block. Block *_b; // Block for this struct OopFlow *_next; // Next free OopFlow + // or NULL if dead/conflict + Compile* C; - OopFlow( short *callees, Node **defs ) : _callees(callees), _defs(defs), - _b(NULL), _next(NULL) { } + OopFlow( short *callees, Node **defs, Compile* c ) : _callees(callees), _defs(defs), + _b(NULL), _next(NULL), C(c) { } // Given reaching-defs for this block start, compute it for this block end void compute_reach( PhaseRegAlloc *regalloc, int max_reg, Dict *safehash ); @@ -88,7 +90,7 @@ struct OopFlow : public ResourceObj { void clone( OopFlow *flow, int max_size); // Make a new OopFlow from scratch - static OopFlow *make( Arena *A, int max_size ); + static OopFlow *make( Arena *A, int max_size, Compile* C ); // Build an oopmap from the current flow info OopMap *build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, int* live ); @@ -180,11 +182,11 @@ void OopFlow::clone( OopFlow *flow, int max_size ) { } //------------------------------make------------------------------------------- -OopFlow *OopFlow::make( Arena *A, int max_size ) { +OopFlow *OopFlow::make( Arena *A, int max_size, Compile* C ) { short *callees = NEW_ARENA_ARRAY(A,short,max_size+1); Node **defs = NEW_ARENA_ARRAY(A,Node*,max_size+1); debug_only( memset(defs,0,(max_size+1)*sizeof(Node*)) ); - OopFlow *flow = new (A) OopFlow(callees+1, defs+1); + OopFlow *flow = new (A) OopFlow(callees+1, defs+1, C); assert( &flow->_callees[OptoReg::Bad] == callees, "Ok to index at OptoReg::Bad" ); assert( &flow->_defs [OptoReg::Bad] == defs , "Ok to index at OptoReg::Bad" ); return flow; @@ -288,7 +290,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i m = m->in(idx); } } - guarantee( 0, "must find derived/base pair" ); + guarantee( 0, "must find derived/base pair" ); } found: ; Node *base = n->in(i+1); // Base is other half of pair @@ -347,6 +349,13 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i } else { // Other - some reaching non-oop value omap->set_value( r); +#ifdef ASSERT + if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) { + def->dump(); + n->dump(); + assert(false, "there should be a oop in OopMap instead of a live raw oop at safepoint"); + } +#endif } } @@ -562,7 +571,7 @@ void Compile::BuildOopMaps() { // Do the first block 'by hand' to prime the worklist Block *entry = _cfg->_blocks[1]; - OopFlow *rootflow = OopFlow::make(A,max_reg); + OopFlow *rootflow = OopFlow::make(A,max_reg,this); // Initialize to 'bottom' (not 'top') memset( rootflow->_callees, OptoReg::Bad, max_reg*sizeof(short) ); memset( rootflow->_defs , 0, max_reg*sizeof(Node*) ); @@ -628,7 +637,7 @@ void Compile::BuildOopMaps() { // Carry it forward. } else { // Draw a new OopFlow from the freelist if( !free_list ) - free_list = OopFlow::make(A,max_reg); + free_list = OopFlow::make(A,max_reg,C); flow = free_list; assert( flow->_b == NULL, "oopFlow is not free" ); free_list = flow->_next; diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index e502a74ea9d..0f596f7bfc7 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -1130,6 +1130,9 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) { Node *def = self->in(1); if (def != NULL && def->bottom_type()->base() == Type::RawPtr) { early->add_inst(self); +#ifdef ASSERT + _raw_oops.push(def); +#endif continue; } break; diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index dc674f93821..2894cf9a505 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -165,6 +165,7 @@ class LibraryCallKit : public GraphKit { bool inline_native_getLength(); bool inline_array_copyOf(bool is_copyOfRange); bool inline_array_equals(); + void copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array, bool card_mark); bool inline_native_clone(bool is_virtual); bool inline_native_Reflection_getCallerClass(); bool inline_native_AtomicLong_get(); @@ -181,7 +182,6 @@ class LibraryCallKit : public GraphKit { Node* src, Node* src_offset, Node* dest, Node* dest_offset, Node* copy_length, - int nargs, // arguments on stack for debug info bool disjoint_bases = false, bool length_never_negative = false, RegionNode* slow_region = NULL); @@ -202,17 +202,16 @@ class LibraryCallKit : public GraphKit { void generate_slow_arraycopy(const TypePtr* adr_type, Node* src, Node* src_offset, Node* dest, Node* dest_offset, - Node* copy_length, - int nargs); + Node* copy_length); Node* generate_checkcast_arraycopy(const TypePtr* adr_type, Node* dest_elem_klass, Node* src, Node* src_offset, Node* dest, Node* dest_offset, - Node* copy_length, int nargs); + Node* copy_length); Node* generate_generic_arraycopy(const TypePtr* adr_type, Node* src, Node* src_offset, Node* dest, Node* dest_offset, - Node* copy_length, int nargs); + Node* copy_length); void generate_unchecked_arraycopy(const TypePtr* adr_type, BasicType basic_elem_type, bool disjoint_bases, @@ -3229,7 +3228,8 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) { Node* orig_tail = _gvn.transform( new(C, 3) SubINode(orig_length, start) ); Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length); - Node* newcopy = new_array(klass_node, length, nargs); + const bool raw_mem_only = true; + Node* newcopy = new_array(klass_node, length, nargs, raw_mem_only); // Generate a direct call to the right arraycopy function(s). // We know the copy is disjoint but we might not know if the @@ -3240,7 +3240,7 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) { bool length_never_negative = true; generate_arraycopy(TypeAryPtr::OOPS, T_OBJECT, original, start, newcopy, intcon(0), moved, - nargs, disjoint_bases, length_never_negative); + disjoint_bases, length_never_negative); push(newcopy); } @@ -3882,6 +3882,98 @@ bool LibraryCallKit::inline_unsafe_copyMemory() { return true; } +//------------------------clone_coping----------------------------------- +// Helper function for inline_native_clone. +void LibraryCallKit::copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, bool is_array, bool card_mark) { + assert(obj_size != NULL, ""); + Node* raw_obj = alloc_obj->in(1); + assert(alloc_obj->is_CheckCastPP() && raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); + + if (ReduceBulkZeroing) { + // We will be completely responsible for initializing this object - + // mark Initialize node as complete. + AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn); + // The object was just allocated - there should be no any stores! + guarantee(alloc != NULL && alloc->maybe_set_complete(&_gvn), ""); + } + + // Cast to Object for arraycopy. + // We can't use the original CheckCastPP since it should be moved + // after the arraycopy to prevent stores flowing above it. + Node* new_obj = new(C, 2) CheckCastPPNode(alloc_obj->in(0), raw_obj, + TypeInstPtr::NOTNULL); + new_obj = _gvn.transform(new_obj); + // Substitute in the locally valid dest_oop. + replace_in_map(alloc_obj, new_obj); + + // Copy the fastest available way. + // TODO: generate fields copies for small objects instead. + Node* src = obj; + Node* dest = new_obj; + Node* size = _gvn.transform(obj_size); + + // Exclude the header but include array length to copy by 8 bytes words. + // Can't use base_offset_in_bytes(bt) since basic type is unknown. + int base_off = is_array ? arrayOopDesc::length_offset_in_bytes() : + instanceOopDesc::base_offset_in_bytes(); + // base_off: + // 8 - 32-bit VM + // 12 - 64-bit VM, compressed oops + // 16 - 64-bit VM, normal oops + if (base_off % BytesPerLong != 0) { + assert(UseCompressedOops, ""); + if (is_array) { + // Exclude length to copy by 8 bytes words. + base_off += sizeof(int); + } else { + // Include klass to copy by 8 bytes words. + base_off = instanceOopDesc::klass_offset_in_bytes(); + } + assert(base_off % BytesPerLong == 0, "expect 8 bytes alignment"); + } + src = basic_plus_adr(src, base_off); + dest = basic_plus_adr(dest, base_off); + + // Compute the length also, if needed: + Node* countx = size; + countx = _gvn.transform( new (C, 3) SubXNode(countx, MakeConX(base_off)) ); + countx = _gvn.transform( new (C, 3) URShiftXNode(countx, intcon(LogBytesPerLong) )); + + const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM; + bool disjoint_bases = true; + generate_unchecked_arraycopy(raw_adr_type, T_LONG, disjoint_bases, + src, NULL, dest, NULL, countx); + + // If necessary, emit some card marks afterwards. (Non-arrays only.) + if (card_mark) { + assert(!is_array, ""); + // Put in store barrier for any and all oops we are sticking + // into this object. (We could avoid this if we could prove + // that the object type contains no oop fields at all.) + Node* no_particular_value = NULL; + Node* no_particular_field = NULL; + int raw_adr_idx = Compile::AliasIdxRaw; + post_barrier(control(), + memory(raw_adr_type), + new_obj, + no_particular_field, + raw_adr_idx, + no_particular_value, + T_OBJECT, + false); + } + + // Move the original CheckCastPP after arraycopy. + _gvn.hash_delete(alloc_obj); + alloc_obj->set_req(0, control()); + // Replace raw memory edge with new CheckCastPP to have a live oop + // at safepoints instead of raw value. + assert(new_obj->is_CheckCastPP() && new_obj->in(1) == alloc_obj->in(1), "sanity"); + alloc_obj->set_req(1, new_obj); // cast to the original type + _gvn.hash_find_insert(alloc_obj); // put back into GVN table + // Restore in the locally valid dest_oop. + replace_in_map(new_obj, alloc_obj); +} //------------------------inline_native_clone---------------------------- // Here are the simple edge cases: @@ -3916,8 +4008,9 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { // paths into result_reg: enum { _slow_path = 1, // out-of-line call to clone method (virtual or not) - _objArray_path, // plain allocation, plus arrayof_oop_arraycopy - _fast_path, // plain allocation, plus a CopyArray operation + _objArray_path, // plain array allocation, plus arrayof_oop_arraycopy + _array_path, // plain array allocation, plus arrayof_long_arraycopy + _instance_path, // plain instance allocation, plus arrayof_long_arraycopy PATH_LIMIT }; RegionNode* result_reg = new(C, PATH_LIMIT) RegionNode(PATH_LIMIT); @@ -3932,18 +4025,6 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { int raw_adr_idx = Compile::AliasIdxRaw; const bool raw_mem_only = true; - // paths into alloc_reg (on the fast path, just before the CopyArray): - enum { _typeArray_alloc = 1, _instance_alloc, ALLOC_LIMIT }; - RegionNode* alloc_reg = new(C, ALLOC_LIMIT) RegionNode(ALLOC_LIMIT); - PhiNode* alloc_val = new(C, ALLOC_LIMIT) PhiNode(alloc_reg, raw_adr_type); - PhiNode* alloc_siz = new(C, ALLOC_LIMIT) PhiNode(alloc_reg, TypeX_X); - PhiNode* alloc_i_o = new(C, ALLOC_LIMIT) PhiNode(alloc_reg, Type::ABIO); - PhiNode* alloc_mem = new(C, ALLOC_LIMIT) PhiNode(alloc_reg, Type::MEMORY, - raw_adr_type); - record_for_igvn(alloc_reg); - - bool card_mark = false; // (see below) - Node* array_ctl = generate_array_guard(obj_klass, (RegionNode*)NULL); if (array_ctl != NULL) { // It's an array. @@ -3953,16 +4034,6 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { Node* obj_size = NULL; Node* alloc_obj = new_array(obj_klass, obj_length, nargs, raw_mem_only, &obj_size); - assert(obj_size != NULL, ""); - Node* raw_obj = alloc_obj->in(1); - assert(raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); - if (ReduceBulkZeroing) { - AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn); - if (alloc != NULL) { - // We will be completely responsible for initializing this object. - alloc->maybe_set_complete(&_gvn); - } - } if (!use_ReduceInitialCardMarks()) { // If it is an oop array, it requires very special treatment, @@ -3976,7 +4047,7 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { bool length_never_negative = true; generate_arraycopy(TypeAryPtr::OOPS, T_OBJECT, obj, intcon(0), alloc_obj, intcon(0), - obj_length, nargs, + obj_length, disjoint_bases, length_never_negative); result_reg->init_req(_objArray_path, control()); result_val->init_req(_objArray_path, alloc_obj); @@ -3991,19 +4062,24 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { // the object. // Otherwise, there are no card marks to worry about. - alloc_val->init_req(_typeArray_alloc, raw_obj); - alloc_siz->init_req(_typeArray_alloc, obj_size); - alloc_reg->init_req(_typeArray_alloc, control()); - alloc_i_o->init_req(_typeArray_alloc, i_o()); - alloc_mem->init_req(_typeArray_alloc, memory(raw_adr_type)); + + if (!stopped()) { + copy_to_clone(obj, alloc_obj, obj_size, true, false); + + // Present the results of the copy. + result_reg->init_req(_array_path, control()); + result_val->init_req(_array_path, alloc_obj); + result_i_o ->set_req(_array_path, i_o()); + result_mem ->set_req(_array_path, reset_memory()); + } } - // We only go to the fast case code if we pass a number of guards. + // We only go to the instance fast case code if we pass a number of guards. // The paths which do not pass are accumulated in the slow_region. RegionNode* slow_region = new (C, 1) RegionNode(1); record_for_igvn(slow_region); if (!stopped()) { - // It's an instance. Make the slow-path tests. + // It's an instance (we did array above). Make the slow-path tests. // If this is a virtual call, we generate a funny guard. We grab // the vtable entry corresponding to clone() from the target object. // If the target method which we are calling happens to be the @@ -4030,25 +4106,14 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { PreserveJVMState pjvms(this); Node* obj_size = NULL; Node* alloc_obj = new_instance(obj_klass, NULL, raw_mem_only, &obj_size); - assert(obj_size != NULL, ""); - Node* raw_obj = alloc_obj->in(1); - assert(raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); - if (ReduceBulkZeroing) { - AllocateNode* alloc = AllocateNode::Ideal_allocation(alloc_obj, &_gvn); - if (alloc != NULL && !alloc->maybe_set_complete(&_gvn)) - alloc = NULL; - } - if (!use_ReduceInitialCardMarks()) { - // Put in store barrier for any and all oops we are sticking - // into this object. (We could avoid this if we could prove - // that the object type contains no oop fields at all.) - card_mark = true; - } - alloc_val->init_req(_instance_alloc, raw_obj); - alloc_siz->init_req(_instance_alloc, obj_size); - alloc_reg->init_req(_instance_alloc, control()); - alloc_i_o->init_req(_instance_alloc, i_o()); - alloc_mem->init_req(_instance_alloc, memory(raw_adr_type)); + + copy_to_clone(obj, alloc_obj, obj_size, false, !use_ReduceInitialCardMarks()); + + // Present the results of the slow call. + result_reg->init_req(_instance_path, control()); + result_val->init_req(_instance_path, alloc_obj); + result_i_o ->set_req(_instance_path, i_o()); + result_mem ->set_req(_instance_path, reset_memory()); } // Generate code for the slow case. We make a call to clone(). @@ -4064,82 +4129,12 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { result_mem ->set_req(_slow_path, reset_memory()); } - // The object is allocated, as an array and/or an instance. Now copy it. - set_control( _gvn.transform(alloc_reg) ); - set_i_o( _gvn.transform(alloc_i_o) ); - set_memory( _gvn.transform(alloc_mem), raw_adr_type ); - Node* raw_obj = _gvn.transform(alloc_val); - - if (!stopped()) { - // Copy the fastest available way. - // (No need for PreserveJVMState, since we're using it all up now.) - // TODO: generate fields/elements copies for small objects instead. - Node* src = obj; - Node* dest = raw_obj; - Node* size = _gvn.transform(alloc_siz); - - // Exclude the header. - int base_off = instanceOopDesc::base_offset_in_bytes(); - if (UseCompressedOops) { - assert(base_off % BytesPerLong != 0, "base with compressed oops"); - // With compressed oops base_offset_in_bytes is 12 which creates - // the gap since countx is rounded by 8 bytes below. - // Copy klass and the gap. - base_off = instanceOopDesc::klass_offset_in_bytes(); - } - src = basic_plus_adr(src, base_off); - dest = basic_plus_adr(dest, base_off); - - // Compute the length also, if needed: - Node* countx = size; - countx = _gvn.transform( new (C, 3) SubXNode(countx, MakeConX(base_off)) ); - countx = _gvn.transform( new (C, 3) URShiftXNode(countx, intcon(LogBytesPerLong) )); - - // Select an appropriate instruction to initialize the range. - // The CopyArray instruction (if supported) can be optimized - // into a discrete set of scalar loads and stores. - bool disjoint_bases = true; - generate_unchecked_arraycopy(raw_adr_type, T_LONG, disjoint_bases, - src, NULL, dest, NULL, countx); - - // Now that the object is properly initialized, type it as an oop. - // Use a secondary InitializeNode memory barrier. - InitializeNode* init = insert_mem_bar_volatile(Op_Initialize, raw_adr_idx, - raw_obj)->as_Initialize(); - init->set_complete(&_gvn); // (there is no corresponding AllocateNode) - Node* new_obj = new(C, 2) CheckCastPPNode(control(), raw_obj, - TypeInstPtr::NOTNULL); - new_obj = _gvn.transform(new_obj); - - // If necessary, emit some card marks afterwards. (Non-arrays only.) - if (card_mark) { - Node* no_particular_value = NULL; - Node* no_particular_field = NULL; - post_barrier(control(), - memory(raw_adr_type), - new_obj, - no_particular_field, - raw_adr_idx, - no_particular_value, - T_OBJECT, - false); - } - // Present the results of the slow call. - result_reg->init_req(_fast_path, control()); - result_val->init_req(_fast_path, new_obj); - result_i_o ->set_req(_fast_path, i_o()); - result_mem ->set_req(_fast_path, reset_memory()); - } - // Return the combined state. set_control( _gvn.transform(result_reg) ); set_i_o( _gvn.transform(result_i_o) ); set_all_memory( _gvn.transform(result_mem) ); - // Cast the result to a sharper type, since we know what clone does. - Node* new_obj = _gvn.transform(result_val); - Node* cast = new (C, 2) CheckCastPPNode(control(), new_obj, toop); - push(_gvn.transform(cast)); + push(_gvn.transform(result_val)); return true; } @@ -4278,8 +4273,7 @@ bool LibraryCallKit::inline_arraycopy() { // Call StubRoutines::generic_arraycopy stub. generate_arraycopy(TypeRawPtr::BOTTOM, T_CONFLICT, - src, src_offset, dest, dest_offset, length, - nargs); + src, src_offset, dest, dest_offset, length); // Do not let reads from the destination float above the arraycopy. // Since we cannot type the arrays, we don't know which slices @@ -4302,8 +4296,7 @@ bool LibraryCallKit::inline_arraycopy() { // The component types are not the same or are not recognized. Punt. // (But, avoid the native method wrapper to JVM_ArrayCopy.) generate_slow_arraycopy(TypePtr::BOTTOM, - src, src_offset, dest, dest_offset, length, - nargs); + src, src_offset, dest, dest_offset, length); return true; } @@ -4360,7 +4353,7 @@ bool LibraryCallKit::inline_arraycopy() { const TypePtr* adr_type = TypeAryPtr::get_array_body_type(dest_elem); generate_arraycopy(adr_type, dest_elem, src, src_offset, dest, dest_offset, length, - nargs, false, false, slow_region); + false, false, slow_region); return true; } @@ -4405,7 +4398,6 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, Node* src, Node* src_offset, Node* dest, Node* dest_offset, Node* copy_length, - int nargs, bool disjoint_bases, bool length_never_negative, RegionNode* slow_region) { @@ -4417,7 +4409,6 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, Node* original_dest = dest; AllocateArrayNode* alloc = NULL; // used for zeroing, if needed - Node* raw_dest = NULL; // used before zeroing, if needed bool must_clear_dest = false; // See if this is the initialization of a newly-allocated array. @@ -4436,15 +4427,18 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, // "You break it, you buy it." InitializeNode* init = alloc->initialization(); assert(init->is_complete(), "we just did this"); - assert(dest->Opcode() == Op_CheckCastPP, "sanity"); + assert(dest->is_CheckCastPP(), "sanity"); assert(dest->in(0)->in(0) == init, "dest pinned"); - raw_dest = dest->in(1); // grab the raw pointer! - original_dest = dest; - dest = raw_dest; + + // Cast to Object for arraycopy. + // We can't use the original CheckCastPP since it should be moved + // after the arraycopy to prevent stores flowing above it. + Node* new_obj = new(C, 2) CheckCastPPNode(dest->in(0), dest->in(1), + TypeInstPtr::NOTNULL); + dest = _gvn.transform(new_obj); + // Substitute in the locally valid dest_oop. + replace_in_map(original_dest, dest); adr_type = TypeRawPtr::BOTTOM; // all initializations are into raw memory - // Decouple the original InitializeNode, turning it into a simple membar. - // We will build a new one at the end of this routine. - init->set_req(InitializeNode::RawAddress, top()); // From this point on, every exit path is responsible for // initializing any non-copied parts of the object to zero. must_clear_dest = true; @@ -4487,7 +4481,7 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, assert(!must_clear_dest, ""); Node* cv = generate_generic_arraycopy(adr_type, src, src_offset, dest, dest_offset, - copy_length, nargs); + copy_length); if (cv == NULL) cv = intcon(-1); // failure (no stub available) checked_control = control(); checked_i_o = i_o(); @@ -4519,6 +4513,14 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, } } + // Use a secondary InitializeNode as raw memory barrier. + // Currently it is needed only on this path since other + // paths have stub or runtime calls as raw memory barriers. + InitializeNode* init = insert_mem_bar_volatile(Op_Initialize, + Compile::AliasIdxRaw, + top())->as_Initialize(); + init->set_complete(&_gvn); // (there is no corresponding AllocateNode) + // Present the results of the fast call. result_region->init_req(zero_path, control()); result_i_o ->init_req(zero_path, i_o()); @@ -4637,8 +4639,7 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, Node* cv = generate_checkcast_arraycopy(adr_type, dest_elem_klass, src, src_offset, dest, dest_offset, - copy_length, - nargs); + copy_length); if (cv == NULL) cv = intcon(-1); // failure (no stub available) checked_control = control(); checked_i_o = i_o(); @@ -4700,8 +4701,8 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, slow_i_o2 ->init_req(1, slow_i_o); slow_mem2 ->init_req(1, slow_mem); slow_reg2 ->init_req(2, control()); - slow_i_o2 ->init_req(2, i_o()); - slow_mem2 ->init_req(2, memory(adr_type)); + slow_i_o2 ->init_req(2, checked_i_o); + slow_mem2 ->init_req(2, checked_mem); slow_control = _gvn.transform(slow_reg2); slow_i_o = _gvn.transform(slow_i_o2); @@ -4746,21 +4747,9 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, alloc->in(AllocateNode::AllocSize)); } - if (dest != original_dest) { - // Promote from rawptr to oop, so it looks right in the call's GC map. - dest = _gvn.transform( new(C,2) CheckCastPPNode(control(), dest, - TypeInstPtr::NOTNULL) ); - - // Edit the call's debug-info to avoid referring to original_dest. - // (The problem with original_dest is that it isn't ready until - // after the InitializeNode completes, but this stuff is before.) - // Substitute in the locally valid dest_oop. - replace_in_map(original_dest, dest); - } - generate_slow_arraycopy(adr_type, src, src_offset, dest, dest_offset, - copy_length, nargs); + copy_length); result_region->init_req(slow_call_path, control()); result_i_o ->init_req(slow_call_path, i_o()); @@ -4780,16 +4769,16 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, if (dest != original_dest) { // Pin the "finished" array node after the arraycopy/zeroing operations. - // Use a secondary InitializeNode memory barrier. - InitializeNode* init = insert_mem_bar_volatile(Op_Initialize, - Compile::AliasIdxRaw, - raw_dest)->as_Initialize(); - init->set_complete(&_gvn); // (there is no corresponding AllocateNode) _gvn.hash_delete(original_dest); original_dest->set_req(0, control()); + // Replace raw memory edge with new CheckCastPP to have a live oop + // at safepoints instead of raw value. + assert(dest->is_CheckCastPP() && dest->in(1) == original_dest->in(1), "sanity"); + original_dest->set_req(1, dest); // cast to the original type _gvn.hash_find_insert(original_dest); // put back into GVN table + // Restore in the locally valid dest_oop. + replace_in_map(dest, original_dest); } - // The memory edges above are precise in order to model effects around // array copies accurately to allow value numbering of field loads around // arraycopy. Such field loads, both before and after, are common in Java @@ -5073,16 +5062,13 @@ void LibraryCallKit::generate_slow_arraycopy(const TypePtr* adr_type, Node* src, Node* src_offset, Node* dest, Node* dest_offset, - Node* copy_length, - int nargs) { - _sp += nargs; // any deopt will start just before call to enclosing method + Node* copy_length) { Node* call = make_runtime_call(RC_NO_LEAF | RC_UNCOMMON, OptoRuntime::slow_arraycopy_Type(), OptoRuntime::slow_arraycopy_Java(), "slow_arraycopy", adr_type, src, src_offset, dest, dest_offset, copy_length); - _sp -= nargs; // Handle exceptions thrown by this fellow: make_slow_call_ex(call, env()->Throwable_klass(), false); @@ -5094,8 +5080,7 @@ LibraryCallKit::generate_checkcast_arraycopy(const TypePtr* adr_type, Node* dest_elem_klass, Node* src, Node* src_offset, Node* dest, Node* dest_offset, - Node* copy_length, - int nargs) { + Node* copy_length) { if (stopped()) return NULL; address copyfunc_addr = StubRoutines::checkcast_arraycopy(); @@ -5136,8 +5121,7 @@ Node* LibraryCallKit::generate_generic_arraycopy(const TypePtr* adr_type, Node* src, Node* src_offset, Node* dest, Node* dest_offset, - Node* copy_length, - int nargs) { + Node* copy_length) { if (stopped()) return NULL; address copyfunc_addr = StubRoutines::generic_arraycopy(); From 2914141733e7a560d030168c5a4ec82dbe444aa0 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Thu, 2 Jul 2009 19:48:11 +0400 Subject: [PATCH 16/91] 6380849: RFE: Automatic discovery of PersistanceDelegates Reviewed-by: rupashka, alexp --- .../com/sun/beans/finder/BeanInfoFinder.java | 102 +++++++++++++ .../com/sun/beans/finder/InstanceFinder.java | 111 ++++++++++++++ .../finder/PersistenceDelegateFinder.java | 63 ++++++++ .../beans/finder/PropertyEditorFinder.java | 81 ++++++++++ jdk/src/share/classes/java/beans/Encoder.java | 23 +-- .../classes/java/beans/Introspector.java | 101 ++++--------- .../java/beans/PropertyEditorManager.java | 96 ++++-------- .../Introspector/6380849/TestBeanInfo.java | 102 +++++++++++++ .../Introspector/6380849/beans/FirstBean.java | 4 + .../6380849/beans/FirstBeanBeanInfo.java | 11 ++ .../6380849/beans/SecondBean.java | 4 + .../Introspector/6380849/beans/ThirdBean.java | 4 + .../6380849/infos/SecondBeanBeanInfo.java | 13 ++ .../6380849/infos/ThirdBeanBeanInfo.java | 11 ++ .../PropertyEditor/6380849/FirstBean.java | 2 + .../6380849/FirstBeanEditor.java | 4 + .../PropertyEditor/6380849/SecondBean.java | 2 + .../6380849/TestPropertyEditor.java | 141 ++++++++++++++++++ .../PropertyEditor/6380849/ThirdBean.java | 2 + .../6380849/editors/SecondBeanEditor.java | 6 + .../6380849/editors/ThirdBeanEditor.java | 6 + .../java/beans/XMLEncoder/6380849/Bean.java | 2 + .../6380849/BeanPersistenceDelegate.java | 5 + .../6380849/TestPersistenceDelegate.java | 60 ++++++++ 24 files changed, 811 insertions(+), 145 deletions(-) create mode 100644 jdk/src/share/classes/com/sun/beans/finder/BeanInfoFinder.java create mode 100644 jdk/src/share/classes/com/sun/beans/finder/InstanceFinder.java create mode 100644 jdk/src/share/classes/com/sun/beans/finder/PersistenceDelegateFinder.java create mode 100644 jdk/src/share/classes/com/sun/beans/finder/PropertyEditorFinder.java create mode 100644 jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java create mode 100644 jdk/test/java/beans/Introspector/6380849/beans/FirstBean.java create mode 100644 jdk/test/java/beans/Introspector/6380849/beans/FirstBeanBeanInfo.java create mode 100644 jdk/test/java/beans/Introspector/6380849/beans/SecondBean.java create mode 100644 jdk/test/java/beans/Introspector/6380849/beans/ThirdBean.java create mode 100644 jdk/test/java/beans/Introspector/6380849/infos/SecondBeanBeanInfo.java create mode 100644 jdk/test/java/beans/Introspector/6380849/infos/ThirdBeanBeanInfo.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/FirstBean.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/FirstBeanEditor.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/SecondBean.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/TestPropertyEditor.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/ThirdBean.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/editors/SecondBeanEditor.java create mode 100644 jdk/test/java/beans/PropertyEditor/6380849/editors/ThirdBeanEditor.java create mode 100644 jdk/test/java/beans/XMLEncoder/6380849/Bean.java create mode 100644 jdk/test/java/beans/XMLEncoder/6380849/BeanPersistenceDelegate.java create mode 100644 jdk/test/java/beans/XMLEncoder/6380849/TestPersistenceDelegate.java diff --git a/jdk/src/share/classes/com/sun/beans/finder/BeanInfoFinder.java b/jdk/src/share/classes/com/sun/beans/finder/BeanInfoFinder.java new file mode 100644 index 00000000000..3e1c37c2d57 --- /dev/null +++ b/jdk/src/share/classes/com/sun/beans/finder/BeanInfoFinder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.beans.finder; + +import java.beans.BeanDescriptor; +import java.beans.BeanInfo; +import java.beans.MethodDescriptor; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Method; + +/** + * This is utility class that provides functionality + * to find a {@link BeanInfo} for a JavaBean specified by its type. + * + * @since 1.7 + * + * @author Sergey A. Malenkov + */ +public final class BeanInfoFinder + extends InstanceFinder { + + private static final String DEFAULT = "sun.beans.infos"; + + public BeanInfoFinder() { + super(BeanInfo.class, true, "BeanInfo", DEFAULT); + } + + private static boolean isValid(Class type, Method method) { + return (method != null) && type.equals(method.getDeclaringClass()); + } + + @Override + protected BeanInfo instantiate(Class type, String name) { + BeanInfo info = super.instantiate(type, name); + if (info != null) { + // make sure that the returned BeanInfo matches the class + BeanDescriptor bd = info.getBeanDescriptor(); + if (bd != null) { + if (type.equals(bd.getBeanClass())) { + return info; + } + } + else { + PropertyDescriptor[] pds = info.getPropertyDescriptors(); + if (pds != null) { + for (PropertyDescriptor pd : pds) { + Method method = pd.getReadMethod(); + if (method == null) { + method = pd.getWriteMethod(); + } + if (isValid(type, method)) { + return info; + } + } + } + else { + MethodDescriptor[] mds = info.getMethodDescriptors(); + if (mds != null) { + for (MethodDescriptor md : mds) { + if (isValid(type, md.getMethod())) { + return info; + } + } + } + } + } + } + return null; + } + + @Override + protected BeanInfo instantiate(Class type, String prefix, String name) { + // this optimization will only use the BeanInfo search path + // if is has changed from the original + // or trying to get the ComponentBeanInfo + return !DEFAULT.equals(prefix) || "ComponentBeanInfo".equals(name) + ? super.instantiate(type, prefix, name) + : null; + } +} diff --git a/jdk/src/share/classes/com/sun/beans/finder/InstanceFinder.java b/jdk/src/share/classes/com/sun/beans/finder/InstanceFinder.java new file mode 100644 index 00000000000..ddf4b80264b --- /dev/null +++ b/jdk/src/share/classes/com/sun/beans/finder/InstanceFinder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.beans.finder; + +/** + * This is utility class that provides basic functionality + * to find an auxiliary class for a JavaBean specified by its type. + * + * @since 1.7 + * + * @author Sergey A. Malenkov + */ +class InstanceFinder { + + private static final String[] EMPTY = { }; + + private final Class type; + private final boolean allow; + private final String suffix; + private String[] packages; + + InstanceFinder(Class type, boolean allow, String suffix, String... packages) { + this.type = type; + this.allow = allow; + this.suffix = suffix; + this.packages = packages.clone(); + } + + public String[] getPackages() { + return (this.packages.length > 0) + ? this.packages.clone() + : this.packages; + } + + public void setPackages(String... packages) { + this.packages = (packages != null) && (packages.length > 0) + ? packages.clone() + : EMPTY; + } + + public T find(Class type) { + if (type == null) { + return null; + } + String name = type.getName() + this.suffix; + T object = instantiate(type, name); + if (object != null) { + return object; + } + if (this.allow) { + object = instantiate(type, null); + if (object != null) { + return object; + } + } + int index = name.lastIndexOf('.') + 1; + if (index > 0) { + name = name.substring(index); + } + for (String prefix : this.packages) { + object = instantiate(type, prefix, name); + if (object != null) { + return object; + } + } + return null; + } + + protected T instantiate(Class type, String name) { + if (type != null) { + try { + if (name != null) { + type = ClassFinder.findClass(name, type.getClassLoader()); + } + if (this.type.isAssignableFrom(type)) { + return (T) type.newInstance(); + } + } + catch (Exception exception) { + // ignore any exceptions + } + } + return null; + } + + protected T instantiate(Class type, String prefix, String name) { + return instantiate(type, prefix + '.' + name); + } +} diff --git a/jdk/src/share/classes/com/sun/beans/finder/PersistenceDelegateFinder.java b/jdk/src/share/classes/com/sun/beans/finder/PersistenceDelegateFinder.java new file mode 100644 index 00000000000..f7638b65ca7 --- /dev/null +++ b/jdk/src/share/classes/com/sun/beans/finder/PersistenceDelegateFinder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.beans.finder; + +import java.beans.PersistenceDelegate; +import java.util.HashMap; +import java.util.Map; + +/** + * This is utility class that provides functionality + * to find a {@link PersistenceDelegate} for a JavaBean specified by its type. + * + * @since 1.7 + * + * @author Sergey A. Malenkov + */ +public final class PersistenceDelegateFinder + extends InstanceFinder { + + private final Map, PersistenceDelegate> registry; + + public PersistenceDelegateFinder() { + super(PersistenceDelegate.class, true, "PersistenceDelegate"); + this.registry = new HashMap, PersistenceDelegate>(); + } + + public void register(Class type, PersistenceDelegate delegate) { + if (delegate != null) { + this.registry.put(type, delegate); + } + else { + this.registry.remove(type); + } + } + + @Override + public PersistenceDelegate find(Class type) { + PersistenceDelegate delegate = this.registry.get(type); + return (delegate != null) ? delegate : super.find(type); + } +} diff --git a/jdk/src/share/classes/com/sun/beans/finder/PropertyEditorFinder.java b/jdk/src/share/classes/com/sun/beans/finder/PropertyEditorFinder.java new file mode 100644 index 00000000000..604952a1a23 --- /dev/null +++ b/jdk/src/share/classes/com/sun/beans/finder/PropertyEditorFinder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.beans.finder; + +import com.sun.beans.WeakCache; + +import java.beans.PropertyEditor; + +import sun.beans.editors.BooleanEditor; +import sun.beans.editors.ByteEditor; +import sun.beans.editors.DoubleEditor; +import sun.beans.editors.EnumEditor; +import sun.beans.editors.FloatEditor; +import sun.beans.editors.IntegerEditor; +import sun.beans.editors.LongEditor; +import sun.beans.editors.ShortEditor; + +/** + * This is utility class that provides functionality + * to find a {@link PropertyEditor} for a JavaBean specified by its type. + * + * @since 1.7 + * + * @author Sergey A. Malenkov + */ +public final class PropertyEditorFinder + extends InstanceFinder { + + private final WeakCache, Class> registry; + + public PropertyEditorFinder() { + super(PropertyEditor.class, false, "Editor", "sun.beans.editors"); + + this.registry = new WeakCache, Class>(); + this.registry.put(Byte.TYPE, ByteEditor.class); + this.registry.put(Short.TYPE, ShortEditor.class); + this.registry.put(Integer.TYPE, IntegerEditor.class); + this.registry.put(Long.TYPE, LongEditor.class); + this.registry.put(Boolean.TYPE, BooleanEditor.class); + this.registry.put(Float.TYPE, FloatEditor.class); + this.registry.put(Double.TYPE, DoubleEditor.class); + } + + public void register(Class type, Class editor) { + this.registry.put(type, editor); + } + + @Override + public PropertyEditor find(Class type) { + PropertyEditor editor = instantiate(this.registry.get(type), null); + if (editor == null) { + editor = super.find(type); + if ((editor == null) && (null != type.getEnumConstants())) { + editor = new EnumEditor(type); + } + } + return editor; + } +} diff --git a/jdk/src/share/classes/java/beans/Encoder.java b/jdk/src/share/classes/java/beans/Encoder.java index 2fcd5b5c727..92e3d695bcb 100644 --- a/jdk/src/share/classes/java/beans/Encoder.java +++ b/jdk/src/share/classes/java/beans/Encoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,8 @@ */ package java.beans; -import java.util.Collections; +import com.sun.beans.finder.PersistenceDelegateFinder; + import java.util.HashMap; import java.util.IdentityHashMap; import java.util.Map; @@ -45,8 +46,7 @@ import java.util.Map; */ public class Encoder { - private final Map, PersistenceDelegate> delegates - = Collections.synchronizedMap(new HashMap, PersistenceDelegate>()); + private final PersistenceDelegateFinder finder = new PersistenceDelegateFinder(); private Map bindings = new IdentityHashMap(); private ExceptionListener exceptionListener; boolean executeStatements = true; @@ -166,8 +166,13 @@ public class Encoder { * @see java.beans.BeanInfo#getBeanDescriptor */ public PersistenceDelegate getPersistenceDelegate(Class type) { - PersistenceDelegate pd = this.delegates.get(type); - return (pd != null) ? pd : MetaData.getPersistenceDelegate(type); + synchronized (this.finder) { + PersistenceDelegate pd = this.finder.find(type); + if (pd != null) { + return pd; + } + } + return MetaData.getPersistenceDelegate(type); } /** @@ -184,10 +189,8 @@ public class Encoder { public void setPersistenceDelegate(Class type, PersistenceDelegate persistenceDelegate) { - if (persistenceDelegate != null) { - this.delegates.put(type, persistenceDelegate); - } else { - this.delegates.remove(type); + synchronized (this.finder) { + this.finder.register(type, persistenceDelegate); } } diff --git a/jdk/src/share/classes/java/beans/Introspector.java b/jdk/src/share/classes/java/beans/Introspector.java index 6a50cbe7f7d..b43911cf123 100644 --- a/jdk/src/share/classes/java/beans/Introspector.java +++ b/jdk/src/share/classes/java/beans/Introspector.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ package java.beans; +import com.sun.beans.finder.BeanInfoFinder; import com.sun.beans.finder.ClassFinder; import java.lang.ref.Reference; @@ -45,6 +46,8 @@ import java.util.EventListener; import java.util.List; import java.util.WeakHashMap; import java.util.TreeMap; + +import sun.awt.AppContext; import sun.reflect.misc.ReflectUtil; /** @@ -137,10 +140,6 @@ public class Introspector { // events maps from String names to EventSetDescriptors private Map events; - private final static String DEFAULT_INFO_PATH = "sun.beans.infos"; - - private static String[] searchPath = { DEFAULT_INFO_PATH }; - private final static EventSetDescriptor[] EMPTY_EVENTSETDESCRIPTORS = new EventSetDescriptor[0]; static final String ADD_PREFIX = "add"; @@ -149,7 +148,7 @@ public class Introspector { static final String SET_PREFIX = "set"; static final String IS_PREFIX = "is"; - private static final String BEANINFO_SUFFIX = "BeanInfo"; + private static final Object FINDER_KEY = new Object(); //====================================================================== // Public methods @@ -309,13 +308,11 @@ public class Introspector { * Sun implementation initially sets to {"sun.beans.infos"}. */ - public static synchronized String[] getBeanInfoSearchPath() { - // Return a copy of the searchPath. - String result[] = new String[searchPath.length]; - for (int i = 0; i < searchPath.length; i++) { - result[i] = searchPath[i]; + public static String[] getBeanInfoSearchPath() { + BeanInfoFinder finder = getFinder(); + synchronized (finder) { + return finder.getPackages(); } - return result; } /** @@ -334,12 +331,15 @@ public class Introspector { * @see SecurityManager#checkPropertiesAccess */ - public static synchronized void setBeanInfoSearchPath(String path[]) { + public static void setBeanInfoSearchPath(String[] path) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPropertiesAccess(); } - searchPath = path; + BeanInfoFinder finder = getFinder(); + synchronized (finder) { + finder.setPackages(path); + } } @@ -447,67 +447,14 @@ public class Introspector { * then it checks to see if the class is its own BeanInfo. Finally, * the BeanInfo search path is prepended to the class and searched. * + * @param beanClass the class type of the bean * @return Instance of an explicit BeanInfo class or null if one isn't found. */ - private static synchronized BeanInfo findExplicitBeanInfo(Class beanClass) { - String name = beanClass.getName() + BEANINFO_SUFFIX; - try { - return (java.beans.BeanInfo)instantiate(beanClass, name); - } catch (Exception ex) { - // Just drop through - + private static BeanInfo findExplicitBeanInfo(Class beanClass) { + BeanInfoFinder finder = getFinder(); + synchronized (finder) { + return finder.find(beanClass); } - // Now try checking if the bean is its own BeanInfo. - try { - if (isSubclass(beanClass, java.beans.BeanInfo.class)) { - return (java.beans.BeanInfo)beanClass.newInstance(); - } - } catch (Exception ex) { - // Just drop through - } - // Now try looking for .fooBeanInfo - name = name.substring(name.lastIndexOf('.')+1); - - for (int i = 0; i < searchPath.length; i++) { - // This optimization will only use the BeanInfo search path if is has changed - // from the original or trying to get the ComponentBeanInfo. - if (!DEFAULT_INFO_PATH.equals(searchPath[i]) || - DEFAULT_INFO_PATH.equals(searchPath[i]) && "ComponentBeanInfo".equals(name)) { - try { - String fullName = searchPath[i] + "." + name; - java.beans.BeanInfo bi = (java.beans.BeanInfo)instantiate(beanClass, fullName); - - // Make sure that the returned BeanInfo matches the class. - if (bi.getBeanDescriptor() != null) { - if (bi.getBeanDescriptor().getBeanClass() == beanClass) { - return bi; - } - } else if (bi.getPropertyDescriptors() != null) { - PropertyDescriptor[] pds = bi.getPropertyDescriptors(); - for (int j = 0; j < pds.length; j++) { - Method method = pds[j].getReadMethod(); - if (method == null) { - method = pds[j].getWriteMethod(); - } - if (method != null && method.getDeclaringClass() == beanClass) { - return bi; - } - } - } else if (bi.getMethodDescriptors() != null) { - MethodDescriptor[] mds = bi.getMethodDescriptors(); - for (int j = 0; j < mds.length; j++) { - Method method = mds[j].getMethod(); - if (method != null && method.getDeclaringClass() == beanClass) { - return bi; - } - } - } - } catch (Exception ex) { - // Silently ignore any errors. - } - } - } - return null; } /** @@ -1483,6 +1430,16 @@ public class Introspector { return false; } + private static BeanInfoFinder getFinder() { + AppContext context = AppContext.getAppContext(); + Object object = context.get(FINDER_KEY); + if (object instanceof BeanInfoFinder) { + return (BeanInfoFinder) object; + } + BeanInfoFinder finder = new BeanInfoFinder(); + context.put(FINDER_KEY, finder); + return finder; + } /** * Try to create an instance of a named class. diff --git a/jdk/src/share/classes/java/beans/PropertyEditorManager.java b/jdk/src/share/classes/java/beans/PropertyEditorManager.java index a456c2bff54..d884e9f0c0c 100644 --- a/jdk/src/share/classes/java/beans/PropertyEditorManager.java +++ b/jdk/src/share/classes/java/beans/PropertyEditorManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,8 @@ package java.beans; -import com.sun.beans.WeakCache; -import sun.beans.editors.*; +import com.sun.beans.finder.PropertyEditorFinder; +import sun.awt.AppContext; /** * The PropertyEditorManager can be used to locate a property editor for @@ -55,6 +55,8 @@ import sun.beans.editors.*; public class PropertyEditorManager { + private static final Object FINDER_KEY = new Object(); + /** * Registers an editor class to edit values of the given target class. * If the editor class is {@code null}, @@ -74,12 +76,15 @@ public class PropertyEditorManager { * * @see SecurityManager#checkPropertiesAccess */ - public static synchronized void registerEditor(Class targetType, Class editorClass) { + public static void registerEditor(Class targetType, Class editorClass) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPropertiesAccess(); } - registry.put(targetType, editorClass); + PropertyEditorFinder finder = getFinder(); + synchronized (finder) { + finder.register(targetType, editorClass); + } } /** @@ -89,46 +94,11 @@ public class PropertyEditorManager { * @return An editor object for the given target class. * The result is null if no suitable editor can be found. */ - public static synchronized PropertyEditor findEditor(Class targetType) { - Class editorClass = registry.get(targetType); - if (editorClass != null) { - try { - Object o = editorClass.newInstance(); - return (PropertyEditor)o; - } catch (Exception ex) { - System.err.println("Couldn't instantiate type editor \"" + - editorClass.getName() + "\" : " + ex); - } + public static PropertyEditor findEditor(Class targetType) { + PropertyEditorFinder finder = getFinder(); + synchronized (finder) { + return finder.find(targetType); } - - // Now try adding "Editor" to the class name. - - String editorName = targetType.getName() + "Editor"; - try { - return (PropertyEditor) Introspector.instantiate(targetType, editorName); - } catch (Exception ex) { - // Silently ignore any errors. - } - - // Now try looking for .fooEditor - int index = editorName.lastIndexOf('.') + 1; - if (index > 0) { - editorName = editorName.substring(index); - } - for (String path : searchPath) { - String name = path + '.' + editorName; - try { - return (PropertyEditor) Introspector.instantiate(targetType, name); - } catch (Exception ex) { - // Silently ignore any errors. - } - } - - if (null != targetType.getEnumConstants()) { - return new EnumEditor(targetType); - } - // We couldn't find a suitable Editor. - return null; } /** @@ -139,8 +109,11 @@ public class PropertyEditorManager { *

The default value for this array is implementation-dependent, * e.g. Sun implementation initially sets to {"sun.beans.editors"}. */ - public static synchronized String[] getEditorSearchPath() { - return searchPath.clone(); + public static String[] getEditorSearchPath() { + PropertyEditorFinder finder = getFinder(); + synchronized (finder) { + return finder.getPackages(); + } } /** @@ -156,28 +129,25 @@ public class PropertyEditorManager { * of system properties. * @see SecurityManager#checkPropertiesAccess */ - public static synchronized void setEditorSearchPath(String[] path) { + public static void setEditorSearchPath(String[] path) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPropertiesAccess(); } - searchPath = (path != null) - ? path.clone() - : EMPTY; + PropertyEditorFinder finder = getFinder(); + synchronized (finder) { + finder.setPackages(path); + } } - private static String[] searchPath = { "sun.beans.editors" }; - private static final String[] EMPTY = {}; - private static final WeakCache, Class> registry; - - static { - registry = new WeakCache, Class>(); - registry.put(Byte.TYPE, ByteEditor.class); - registry.put(Short.TYPE, ShortEditor.class); - registry.put(Integer.TYPE, IntegerEditor.class); - registry.put(Long.TYPE, LongEditor.class); - registry.put(Boolean.TYPE, BooleanEditor.class); - registry.put(Float.TYPE, FloatEditor.class); - registry.put(Double.TYPE, DoubleEditor.class); + private static PropertyEditorFinder getFinder() { + AppContext context = AppContext.getAppContext(); + Object object = context.get(FINDER_KEY); + if (object instanceof PropertyEditorFinder) { + return (PropertyEditorFinder) object; + } + PropertyEditorFinder finder = new PropertyEditorFinder(); + context.put(FINDER_KEY, finder); + return finder; } } diff --git a/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java b/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java new file mode 100644 index 00000000000..b149bffb820 --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java @@ -0,0 +1,102 @@ +/** + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6380849 + * @summary Tests BeanInfo finder + * @author Sergey Malenkov + */ + +import beans.FirstBean; +import beans.FirstBeanBeanInfo; +import beans.SecondBean; +import beans.ThirdBean; + +import infos.SecondBeanBeanInfo; +import infos.ThirdBeanBeanInfo; + +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.lang.reflect.Field; + +import sun.awt.SunToolkit; + +public class TestBeanInfo implements Runnable { + + private static final String[] SEARCH_PATH = { "infos" }; // NON-NLS: package name + + public static void main(String[] args) throws InterruptedException { + TestBeanInfo test = new TestBeanInfo(); + test.run(); + // the following tests fails on previous build + ThreadGroup group = new ThreadGroup("$$$"); // NON-NLS: unique thread name + Thread thread = new Thread(group, test); + thread.start(); + thread.join(); + } + + private static void test(Class type, Class expected) { + BeanInfo actual; + try { + actual = Introspector.getBeanInfo(type); + type = actual.getClass(); + Field field = type.getDeclaredField("targetBeanInfo"); // NON-NLS: field name + field.setAccessible(true); + actual = (BeanInfo) field.get(actual); + } + catch (Exception exception) { + throw new Error("unexpected error", exception); + } + if ((actual == null) && (expected != null)) { + throw new Error("expected info is not found"); + } + if ((actual != null) && !actual.getClass().equals(expected)) { + throw new Error("found unexpected info"); + } + } + + private boolean passed; + + public void run() { + if (this.passed) { + SunToolkit.createNewAppContext(); + } + Introspector.flushCaches(); + + test(FirstBean.class, FirstBeanBeanInfo.class); + test(SecondBean.class, null); + test(ThirdBean.class, null); + test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class); + + Introspector.setBeanInfoSearchPath(SEARCH_PATH); + Introspector.flushCaches(); + + test(FirstBean.class, FirstBeanBeanInfo.class); + test(SecondBean.class, SecondBeanBeanInfo.class); + test(ThirdBean.class, null); + test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class); + + this.passed = true; + } +} diff --git a/jdk/test/java/beans/Introspector/6380849/beans/FirstBean.java b/jdk/test/java/beans/Introspector/6380849/beans/FirstBean.java new file mode 100644 index 00000000000..cafb44e0bab --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/beans/FirstBean.java @@ -0,0 +1,4 @@ +package beans; + +public class FirstBean { +} diff --git a/jdk/test/java/beans/Introspector/6380849/beans/FirstBeanBeanInfo.java b/jdk/test/java/beans/Introspector/6380849/beans/FirstBeanBeanInfo.java new file mode 100644 index 00000000000..f4d1355703e --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/beans/FirstBeanBeanInfo.java @@ -0,0 +1,11 @@ +package beans; + +import java.beans.BeanDescriptor; +import java.beans.SimpleBeanInfo; + +public class FirstBeanBeanInfo extends SimpleBeanInfo { + @Override + public BeanDescriptor getBeanDescriptor() { + return new BeanDescriptor(FirstBean.class); + } +} diff --git a/jdk/test/java/beans/Introspector/6380849/beans/SecondBean.java b/jdk/test/java/beans/Introspector/6380849/beans/SecondBean.java new file mode 100644 index 00000000000..fbde3902724 --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/beans/SecondBean.java @@ -0,0 +1,4 @@ +package beans; + +public class SecondBean { +} diff --git a/jdk/test/java/beans/Introspector/6380849/beans/ThirdBean.java b/jdk/test/java/beans/Introspector/6380849/beans/ThirdBean.java new file mode 100644 index 00000000000..8fb8b9a92b8 --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/beans/ThirdBean.java @@ -0,0 +1,4 @@ +package beans; + +public class ThirdBean { +} diff --git a/jdk/test/java/beans/Introspector/6380849/infos/SecondBeanBeanInfo.java b/jdk/test/java/beans/Introspector/6380849/infos/SecondBeanBeanInfo.java new file mode 100644 index 00000000000..999a6df9040 --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/infos/SecondBeanBeanInfo.java @@ -0,0 +1,13 @@ +package infos; + +import beans.SecondBean; + +import java.beans.BeanDescriptor; +import java.beans.SimpleBeanInfo; + +public class SecondBeanBeanInfo extends SimpleBeanInfo { + @Override + public BeanDescriptor getBeanDescriptor() { + return new BeanDescriptor(SecondBean.class); + } +} diff --git a/jdk/test/java/beans/Introspector/6380849/infos/ThirdBeanBeanInfo.java b/jdk/test/java/beans/Introspector/6380849/infos/ThirdBeanBeanInfo.java new file mode 100644 index 00000000000..7d295bd07b3 --- /dev/null +++ b/jdk/test/java/beans/Introspector/6380849/infos/ThirdBeanBeanInfo.java @@ -0,0 +1,11 @@ +package infos; + +import java.beans.BeanDescriptor; +import java.beans.SimpleBeanInfo; + +public class ThirdBeanBeanInfo extends SimpleBeanInfo { + @Override + public BeanDescriptor getBeanDescriptor() { + return new BeanDescriptor(ThirdBeanBeanInfo.class); + } +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/FirstBean.java b/jdk/test/java/beans/PropertyEditor/6380849/FirstBean.java new file mode 100644 index 00000000000..e112dbfaa7e --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/FirstBean.java @@ -0,0 +1,2 @@ +public class FirstBean { +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/FirstBeanEditor.java b/jdk/test/java/beans/PropertyEditor/6380849/FirstBeanEditor.java new file mode 100644 index 00000000000..8a227be21fe --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/FirstBeanEditor.java @@ -0,0 +1,4 @@ +import java.beans.PropertyEditorSupport; + +public class FirstBeanEditor extends PropertyEditorSupport { +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/SecondBean.java b/jdk/test/java/beans/PropertyEditor/6380849/SecondBean.java new file mode 100644 index 00000000000..51eea295806 --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/SecondBean.java @@ -0,0 +1,2 @@ +public class SecondBean { +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/TestPropertyEditor.java b/jdk/test/java/beans/PropertyEditor/6380849/TestPropertyEditor.java new file mode 100644 index 00000000000..f7f4d1b1ad1 --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/TestPropertyEditor.java @@ -0,0 +1,141 @@ +/** + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6380849 + * @summary Tests PropertyEditor finder + * @author Sergey Malenkov + */ + +import editors.SecondBeanEditor; +import editors.ThirdBeanEditor; + +import java.awt.Color; +import java.awt.Font; +import java.beans.PropertyEditor; +import java.beans.PropertyEditorManager; + +import sun.awt.SunToolkit; +import sun.beans.editors.BooleanEditor; +import sun.beans.editors.ByteEditor; +import sun.beans.editors.ColorEditor; +import sun.beans.editors.DoubleEditor; +import sun.beans.editors.EnumEditor; +import sun.beans.editors.FloatEditor; +import sun.beans.editors.FontEditor; +import sun.beans.editors.IntegerEditor; +import sun.beans.editors.LongEditor; +import sun.beans.editors.ShortEditor; +import sun.beans.editors.StringEditor; + +public class TestPropertyEditor implements Runnable { + + private enum Enumeration { + FIRST, SECOND, THIRD + } + + private static final String[] SEARCH_PATH = { "editors" }; // NON-NLS: package name + + public static void main(String[] args) throws InterruptedException { + TestPropertyEditor test = new TestPropertyEditor(); + test.run(); + // the following tests fails on previous build + ThreadGroup group = new ThreadGroup("$$$"); // NON-NLS: unique thread name + Thread thread = new Thread(group, test); + thread.start(); + thread.join(); + } + + private static void test(Class type, Class expected) { + PropertyEditor actual = PropertyEditorManager.findEditor(type); + if ((actual == null) && (expected != null)) { + throw new Error("expected editor is not found"); + } + if ((actual != null) && !actual.getClass().equals(expected)) { + throw new Error("found unexpected editor"); + } + } + + private boolean passed; + + public void run() { + if (this.passed) { + SunToolkit.createNewAppContext(); + } + PropertyEditorManager.registerEditor(ThirdBean.class, ThirdBeanEditor.class); + + test(FirstBean.class, FirstBeanEditor.class); + test(SecondBean.class, null); + test(ThirdBean.class, ThirdBeanEditor.class); + // test editors for default primitive types + test(Byte.TYPE, ByteEditor.class); + test(Short.TYPE, ShortEditor.class); + test(Integer.TYPE, IntegerEditor.class); + test(Long.TYPE, LongEditor.class); + test(Boolean.TYPE, BooleanEditor.class); + test(Float.TYPE, FloatEditor.class); + test(Double.TYPE, DoubleEditor.class); + // test editors for default object types + test(Byte.class, ByteEditor.class); + test(Short.class, ShortEditor.class); + test(Integer.class, IntegerEditor.class); + test(Long.class, LongEditor.class); + test(Boolean.class, BooleanEditor.class); + test(Float.class, FloatEditor.class); + test(Double.class, DoubleEditor.class); + test(String.class, StringEditor.class); + test(Color.class, ColorEditor.class); + test(Font.class, FontEditor.class); + test(Enumeration.class, EnumEditor.class); + + PropertyEditorManager.registerEditor(ThirdBean.class, null); + PropertyEditorManager.setEditorSearchPath(SEARCH_PATH); + + test(FirstBean.class, FirstBeanEditor.class); + test(SecondBean.class, SecondBeanEditor.class); + test(ThirdBean.class, ThirdBeanEditor.class); + // test editors for default primitive types + test(Byte.TYPE, ByteEditor.class); + test(Short.TYPE, ShortEditor.class); + test(Integer.TYPE, IntegerEditor.class); + test(Long.TYPE, LongEditor.class); + test(Boolean.TYPE, BooleanEditor.class); + test(Float.TYPE, FloatEditor.class); + test(Double.TYPE, DoubleEditor.class); + // test editors for default object types + test(Byte.class, null); + test(Short.class, null); + test(Integer.class, null); + test(Long.class, null); + test(Boolean.class, null); + test(Float.class, null); + test(Double.class, null); + test(String.class, null); + test(Color.class, null); + test(Font.class, null); + test(Enumeration.class, EnumEditor.class); + + this.passed = true; + } +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/ThirdBean.java b/jdk/test/java/beans/PropertyEditor/6380849/ThirdBean.java new file mode 100644 index 00000000000..094ab830efb --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/ThirdBean.java @@ -0,0 +1,2 @@ +public class ThirdBean { +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/editors/SecondBeanEditor.java b/jdk/test/java/beans/PropertyEditor/6380849/editors/SecondBeanEditor.java new file mode 100644 index 00000000000..e8b48e0f2ea --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/editors/SecondBeanEditor.java @@ -0,0 +1,6 @@ +package editors; + +import java.beans.PropertyEditorSupport; + +public class SecondBeanEditor extends PropertyEditorSupport { +} diff --git a/jdk/test/java/beans/PropertyEditor/6380849/editors/ThirdBeanEditor.java b/jdk/test/java/beans/PropertyEditor/6380849/editors/ThirdBeanEditor.java new file mode 100644 index 00000000000..14bf7b8d168 --- /dev/null +++ b/jdk/test/java/beans/PropertyEditor/6380849/editors/ThirdBeanEditor.java @@ -0,0 +1,6 @@ +package editors; + +import java.beans.PropertyEditorSupport; + +public class ThirdBeanEditor extends PropertyEditorSupport { +} diff --git a/jdk/test/java/beans/XMLEncoder/6380849/Bean.java b/jdk/test/java/beans/XMLEncoder/6380849/Bean.java new file mode 100644 index 00000000000..54145979197 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/6380849/Bean.java @@ -0,0 +1,2 @@ +public class Bean { +} diff --git a/jdk/test/java/beans/XMLEncoder/6380849/BeanPersistenceDelegate.java b/jdk/test/java/beans/XMLEncoder/6380849/BeanPersistenceDelegate.java new file mode 100644 index 00000000000..34278b419e6 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/6380849/BeanPersistenceDelegate.java @@ -0,0 +1,5 @@ +import java.beans.DefaultPersistenceDelegate; + +public class BeanPersistenceDelegate + extends DefaultPersistenceDelegate { +} diff --git a/jdk/test/java/beans/XMLEncoder/6380849/TestPersistenceDelegate.java b/jdk/test/java/beans/XMLEncoder/6380849/TestPersistenceDelegate.java new file mode 100644 index 00000000000..35dde1ab794 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/6380849/TestPersistenceDelegate.java @@ -0,0 +1,60 @@ +/** + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6380849 + * @summary Tests PersistenceDelegate finder + * @author Sergey Malenkov + */ + +import java.beans.PersistenceDelegate; +import java.beans.XMLEncoder; +import java.beans.DefaultPersistenceDelegate; + +public class TestPersistenceDelegate { + + private static final XMLEncoder ENCODER = new XMLEncoder(System.out); + + public static void main(String[] args) throws InterruptedException { + Class type = TestPersistenceDelegate.class; + test(type, DefaultPersistenceDelegate.class); + ENCODER.setPersistenceDelegate(type, new BeanPersistenceDelegate()); + test(type, BeanPersistenceDelegate.class); + ENCODER.setPersistenceDelegate(type, null); + test(type, DefaultPersistenceDelegate.class); + // the following tests fails on previous build + test(Bean.class, BeanPersistenceDelegate.class); + test(BeanPersistenceDelegate.class, BeanPersistenceDelegate.class); + } + + private static void test(Class type, Class expected) { + PersistenceDelegate actual = ENCODER.getPersistenceDelegate(type); + if ((actual == null) && (expected != null)) { + throw new Error("expected delegate is not found"); + } + if ((actual != null) && !actual.getClass().equals(expected)) { + throw new Error("found unexpected delegate"); + } + } +} From 7a36ade1ec931b061b19646b55185d14cf832ade Mon Sep 17 00:00:00 2001 From: Changpeng Fang Date: Thu, 2 Jul 2009 16:18:19 -0700 Subject: [PATCH 17/91] 6855164: SIGSEGV during compilation of method involving loop over CharSequence Don not split a block if it contains a FastLockNode with a PhiNode input. Reviewed-by: kvn, never --- hotspot/src/share/vm/opto/loopopts.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 454c207fd81..5084e3d8234 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -667,7 +667,6 @@ static bool merge_point_too_heavy(Compile* C, Node* region) { } } -#ifdef _LP64 static bool merge_point_safe(Node* region) { // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode // having a PhiNode input. This sidesteps the dangerous case where the split @@ -676,20 +675,25 @@ static bool merge_point_safe(Node* region) { // uses. // A better fix for this problem can be found in the BugTraq entry, but // expediency for Mantis demands this hack. + // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop + // split_if_with_blocks from splitting a block because we could not move around + // the FastLockNode. for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { Node* n = region->fast_out(i); if (n->is_Phi()) { for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) { Node* m = n->fast_out(j); - if (m->Opcode() == Op_ConvI2L) { + if (m->is_FastLock()) return false; - } +#ifdef _LP64 + if (m->Opcode() == Op_ConvI2L) + return false; +#endif } } } return true; } -#endif //------------------------------place_near_use--------------------------------- @@ -771,12 +775,10 @@ void PhaseIdealLoop::split_if_with_blocks_post( Node *n ) { if( get_loop(n_ctrl->in(j)) != n_loop ) return; -#ifdef _LP64 // Check for safety of the merge point. if( !merge_point_safe(n_ctrl) ) { return; } -#endif // Split compare 'n' through the merge point if it is profitable Node *phi = split_thru_phi( n, n_ctrl, policy ); From 5363b41a3e61cd88a565c1568508c9598b239131 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 3 Jul 2009 11:13:42 +0800 Subject: [PATCH 18/91] 6853793: OutOfMemoryError in sun.security.provider.certpath.OCSPChecker.check Allocate memory dynamically, keep reading until EOF. Reviewed-by: weijun --- .../provider/certpath/OCSPChecker.java | 23 ++++++++---- .../security/timestamp/HttpTimestamper.java | 35 ++++++++++++------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java index 35ed85def19..04e0649d8ff 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPChecker.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -351,18 +351,27 @@ class OCSPChecker extends PKIXCertPathChecker { } in = con.getInputStream(); + byte[] response = null; + int total = 0; int contentLength = con.getContentLength(); - if (contentLength == -1) { + if (contentLength != -1) { + response = new byte[contentLength]; + } else { + response = new byte[2048]; contentLength = Integer.MAX_VALUE; } - byte[] response = new byte[contentLength]; - int total = 0; - int count = 0; - while (count != -1 && total < contentLength) { - count = in.read(response, total, response.length - total); + while (total < contentLength) { + int count = in.read(response, total, response.length - total); + if (count < 0) + break; + total += count; + if (total >= response.length && total < contentLength) { + response = Arrays.copyOf(response, total * 2); + } } + response = Arrays.copyOf(response, total); OCSPResponse ocspResponse = new OCSPResponse(response, pkixParams, responderCert); diff --git a/jdk/src/share/classes/sun/security/timestamp/HttpTimestamper.java b/jdk/src/share/classes/sun/security/timestamp/HttpTimestamper.java index 690f13a2a0f..bb735141159 100644 --- a/jdk/src/share/classes/sun/security/timestamp/HttpTimestamper.java +++ b/jdk/src/share/classes/sun/security/timestamp/HttpTimestamper.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.net.URL; import java.net.HttpURLConnection; import java.util.Iterator; import java.util.Set; +import java.util.Arrays; import sun.security.pkcs.*; @@ -137,23 +138,33 @@ public class HttpTimestamper implements Timestamper { } System.out.println(); } - int contentLength = connection.getContentLength(); - if (contentLength == -1) { - contentLength = Integer.MAX_VALUE; - } verifyMimeType(connection.getContentType()); - replyBuffer = new byte[contentLength]; int total = 0; - int count = 0; - while (count != -1 && total < contentLength) { - count = input.read(replyBuffer, total, - replyBuffer.length - total); - total += count; + int contentLength = connection.getContentLength(); + if (contentLength != -1) { + replyBuffer = new byte[contentLength]; + } else { + replyBuffer = new byte[2048]; + contentLength = Integer.MAX_VALUE; } + + while (total < contentLength) { + int count = input.read(replyBuffer, total, + replyBuffer.length - total); + if (count < 0) + break; + + total += count; + if (total >= replyBuffer.length && total < contentLength) { + replyBuffer = Arrays.copyOf(replyBuffer, total * 2); + } + } + replyBuffer = Arrays.copyOf(replyBuffer, total); + if (DEBUG) { System.out.println("received timestamp response (length=" + - replyBuffer.length + ")"); + total + ")"); } } finally { if (input != null) { From 521bc9973e449dd60debaf5ce3a73352e6cfa19f Mon Sep 17 00:00:00 2001 From: Yong Jeffrey Huang Date: Thu, 2 Jul 2009 20:17:59 -0700 Subject: [PATCH 19/91] 6606396: Notepad and Stylepad demos don't run in Japanese locale Reviewed-by: peytoia, ogino --- .../Notepad/resources/Notepad_ja.properties | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/jdk/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties b/jdk/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties index 2999cd757cc..0ec7ce0fcf5 100644 --- a/jdk/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties +++ b/jdk/src/share/demo/jfc/Notepad/resources/Notepad_ja.properties @@ -9,7 +9,7 @@ ViewportBackingStore=false # # Each of the strings that follow form a key to be # used to the actual menu definition. -menubar=\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u30c7\u30d0\u30c3\u30b0 +menubar=file edit debug # file Menu definition # @@ -20,15 +20,15 @@ menubar=\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6\u30c7\u30d0\u30c3\u30b0 # new -> Notepad.newAction # save -> Notepad.saveAction # exit -> Notepad.exitAction -file=\u65b0\u898f \u958b\u304f \u4fdd\u5b58 - \u7d42\u4e86 -fileLabel=\u30d5\u30a1\u30a4\u30eb (F) +file=new open save - exit +fileLabel=\u30d5\u30a1\u30a4\u30eb openLabel=\u958b\u304f openImage=resources/open.gif newLabel=\u65b0\u898f newImage=resources/new.gif saveLabel=\u4fdd\u5b58 saveImage=resources/save.gif -exitLabel=\u7d42\u4e86 (X) +exitLabel=\u7d42\u4e86 # # edit Menu definition @@ -36,26 +36,26 @@ exitLabel=\u7d42\u4e86 (X) # cut -> JTextComponent.cutAction # copy -> JTextComponent.copyAction # paste -> JTextComponent.pasteAction -edit=\u30ab\u30c3\u30c8 \u30b3\u30d4\u30fc \u30da\u30fc\u30b9\u30c8 - \u5143\u306b\u623b\u3059 \u518d\u5b9f\u884c +edit=cut copy paste - undo redo editLabel=\u7de8\u96c6 -cutLabel=Cut +cutLabel=\u30ab\u30c3\u30c8 cutAction=cut-to-clipboard cutImage=resources/cut.gif -copyLabel=Copy -copyAction=cut-to-clipboard +copyLabel=\u30b3\u30d4\u30fc +copyAction=copy-to-clipboard copyImage=resources/copy.gif -pasteLabel=Paste +pasteLabel=\u30da\u30fc\u30b9\u30c8 pasteAction=paste-from-clipboard pasteImage=resources/paste.gif undoLabel=\u5143\u306b\u623b\u3059 -undoAction=\u5143\u306b\u623b\u3059 +undoAction=Undo redoLabel=\u518d\u5b9f\u884c -redoAction=\u518d\u5b9f\u884c +redoAction=Redo # # debug Menu definition # -debug=showElementTree \u306e\u30c0\u30f3\u30d7 +debug=dump showElementTree debugLabel=\u30c7\u30d0\u30c3\u30b0 dumpLabel=\u30e2\u30c7\u30eb\u3092 System.err \u306b\u30c0\u30f3\u30d7 dumpAction=dump-model @@ -67,7 +67,7 @@ showElementTreeLabel=\u8981\u7d20\u3092\u8868\u793a # used as the basis of the tool definition. Actions # are of course sharable, and in this case are shared # with the menu items. -toolbar=\u65b0\u898f \u958b\u304f \u4fdd\u5b58 - \u30ab\u30c3\u30c8 \u30b3\u30d4\u30fc \u30da\u30fc\u30b9\u30c8 +toolbar=new open save - cut copy paste newTooltip=\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b openTooltip=\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f saveTooltip=\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58 From 64bc185e5502ed93d84f3106038b55cb5b7e6dd9 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 3 Jul 2009 16:56:29 +0400 Subject: [PATCH 20/91] 6329581: RFE: LTP: java.beans.XMLEncoder does not manage ClassLoader Reviewed-by: rupashka, alexp --- jdk/src/share/classes/java/beans/Encoder.java | 11 ++- .../share/classes/java/beans/MetaData.java | 6 +- .../share/classes/java/beans/Statement.java | 3 +- .../beans/XMLEncoder/6329581/Test6329581.java | 75 +++++++++++++++++++ 4 files changed, 86 insertions(+), 9 deletions(-) create mode 100644 jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java diff --git a/jdk/src/share/classes/java/beans/Encoder.java b/jdk/src/share/classes/java/beans/Encoder.java index 92e3d695bcb..e7f63397340 100644 --- a/jdk/src/share/classes/java/beans/Encoder.java +++ b/jdk/src/share/classes/java/beans/Encoder.java @@ -246,12 +246,11 @@ public class Encoder { for (int i = 0; i < oldArgs.length; i++) { newArgs[i] = writeObject1(oldArgs[i]); } - if (oldExp.getClass() == Statement.class) { - return new Statement(newTarget, oldExp.getMethodName(), newArgs); - } - else { - return new Expression(newTarget, oldExp.getMethodName(), newArgs); - } + Statement newExp = Statement.class.equals(oldExp.getClass()) + ? new Statement(newTarget, oldExp.getMethodName(), newArgs) + : new Expression(newTarget, oldExp.getMethodName(), newArgs); + newExp.loader = oldExp.loader; + return newExp; } /** diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java index f4d307090a5..96607db806f 100644 --- a/jdk/src/share/classes/java/beans/MetaData.java +++ b/jdk/src/share/classes/java/beans/MetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,7 +219,9 @@ class java_lang_Class_PersistenceDelegate extends PersistenceDelegate { return new Expression(oldInstance, String.class, "getClass", new Object[]{}); } else { - return new Expression(oldInstance, Class.class, "forName", new Object[]{c.getName()}); + Expression newInstance = new Expression(oldInstance, Class.class, "forName", new Object[] { c.getName() }); + newInstance.loader = c.getClassLoader(); + return newInstance; } } } diff --git a/jdk/src/share/classes/java/beans/Statement.java b/jdk/src/share/classes/java/beans/Statement.java index 7bf2fccda56..6169f92742f 100644 --- a/jdk/src/share/classes/java/beans/Statement.java +++ b/jdk/src/share/classes/java/beans/Statement.java @@ -66,6 +66,7 @@ public class Statement { Object target; String methodName; Object[] arguments; + ClassLoader loader; /** * Creates a new Statement object with a target, @@ -157,7 +158,7 @@ public class Statement { // of core from a class inside core. Special // case this method. if (target == Class.class && methodName.equals("forName")) { - return ClassFinder.resolveClass((String)arguments[0]); + return ClassFinder.resolveClass((String)arguments[0], this.loader); } Class[] argClasses = new Class[arguments.length]; for(int i = 0; i < arguments.length; i++) { diff --git a/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java b/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java new file mode 100644 index 00000000000..c307dab1267 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java @@ -0,0 +1,75 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6329581 + * @summary Tests encoding of a class with custom ClassLoader + * @author Sergey Malenkov + */ + +import java.beans.ExceptionListener; +import java.beans.XMLDecoder; +import java.beans.XMLEncoder; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; + +public class Test6329581 implements ExceptionListener { + + public static void main(String[] args) throws Exception { + ExceptionListener listener = new Test6329581(); + // write bean to byte array + ByteArrayOutputStream out = new ByteArrayOutputStream(); + XMLEncoder encoder = new XMLEncoder(out); + encoder.setExceptionListener(listener); + encoder.writeObject(getClassLoader("beans.jar").loadClass("test.Bean").newInstance()); + encoder.close(); + // read bean from byte array + ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); + XMLDecoder decoder = new XMLDecoder(in, null, listener, getClassLoader("beans.jar")); + Object object = decoder.readObject(); + decoder.close(); + + if (!object.getClass().getClassLoader().getClass().equals(URLClassLoader.class)) { + throw new Error("bean is loaded with unexpected class loader"); + } + } + + private static ClassLoader getClassLoader(String name) throws Exception { + StringBuilder sb = new StringBuilder(256); + sb.append("file:"); + sb.append(System.getProperty("test.src", ".")); + sb.append(File.separatorChar); + sb.append(name); + + URL[] url = { new URL(sb.toString()) }; + return new URLClassLoader(url); + } + + public void exceptionThrown(Exception exception) { + throw new Error("unexpected exception", exception); + } +} From 839196d14e119c182b745f417b48d4816d3d4d48 Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Fri, 3 Jul 2009 07:24:43 -0700 Subject: [PATCH 21/91] 6857287: (file) Clarifications for symbolic link related javadoc Fix up jsr203 file javadoc related to symbolic links Reviewed-by: alanb --- .../classes/java/nio/file/LinkPermission.java | 2 +- .../java/nio/file/NotLinkException.java | 2 +- jdk/src/share/classes/java/nio/file/Path.java | 79 ++++++++++--------- .../java/nio/file/SecureDirectoryStream.java | 11 +-- .../java/nio/file/attribute/Attributes.java | 10 +-- .../file/attribute/BasicFileAttributes.java | 4 +- 6 files changed, 55 insertions(+), 53 deletions(-) diff --git a/jdk/src/share/classes/java/nio/file/LinkPermission.java b/jdk/src/share/classes/java/nio/file/LinkPermission.java index 01949114761..a318903365a 100644 --- a/jdk/src/share/classes/java/nio/file/LinkPermission.java +++ b/jdk/src/share/classes/java/nio/file/LinkPermission.java @@ -46,7 +46,7 @@ import java.security.BasicPermission; * known as creating a link, or hard link. * Extreme care should be taken when granting this permission. It allows * linking to any file or directory in the file system thus allowing the - * attacker to access to all files. + * attacker access to all files. * * * symbolic diff --git a/jdk/src/share/classes/java/nio/file/NotLinkException.java b/jdk/src/share/classes/java/nio/file/NotLinkException.java index bdc1fc354ad..fafdeee6cc6 100644 --- a/jdk/src/share/classes/java/nio/file/NotLinkException.java +++ b/jdk/src/share/classes/java/nio/file/NotLinkException.java @@ -27,7 +27,7 @@ package java.nio.file; /** * Checked exception thrown when a file system operation fails because a file - * is not a link. + * is not a symbolic link. * * @since 1.7 */ diff --git a/jdk/src/share/classes/java/nio/file/Path.java b/jdk/src/share/classes/java/nio/file/Path.java index e00c96144d9..113a7c58067 100644 --- a/jdk/src/share/classes/java/nio/file/Path.java +++ b/jdk/src/share/classes/java/nio/file/Path.java @@ -91,8 +91,8 @@ import java.util.Set; * iterate over the entries in the directory.

*
  • Files can be {@link #copyTo(Path,CopyOption[]) copied} or * {@link #moveTo(Path,CopyOption[]) moved}.

  • - *
  • Symbolic-links may be {@link #createSymbolicLink created}, or the - * target of a link may be {@link #readSymbolicLink read}.

  • + *
  • Symbolic links may be {@link #createSymbolicLink created}, or the + * target of a symbolic link may be {@link #readSymbolicLink read}.

  • *
  • The {@link #toRealPath real} path of an existing file may be * obtained.

  • * @@ -403,12 +403,12 @@ public abstract class Path * p.relativize(p.resolve(q)).equals(q) * * - *

    When symbolic-links are supported, then whether the resulting path, + *

    When symbolic links are supported, then whether the resulting path, * when resolved against this path, yields a path that can be used to locate * the {@link #isSameFile same} file as {@code other} is implementation * dependent. For example, if this path is {@code "/a/b"} and the given * path is {@code "/a/x"} then the resulting relative path may be {@code - * "../x"}. If {@code "b"} is a symbolic-link then is implementation + * "../x"}. If {@code "b"} is a symbolic link then is implementation * dependent if {@code "a/b/../x"} would locate the same file as {@code "/a/x"}. * * @param other @@ -430,8 +430,8 @@ public abstract class Path * *

    An implementation may require to examine the file to determine if the * file is a directory. Consequently this method may not be atomic with respect - * to other file system operations. If the file is a symbolic-link then the - * link is deleted and not the final target of the link. + * to other file system operations. If the file is a symbolic link then the + * symbolic link itself, not the final target of the link, is deleted. * *

    If the file is a directory then the directory must be empty. In some * implementations a directory has entries for special files or links that @@ -459,11 +459,11 @@ public abstract class Path /** * Deletes the file located by this path, if it exists. * - *

    As with the {@link #delete delete()} method, an implementation - * may require to examine the file to determine if the file is a directory. + *

    As with the {@link #delete delete()} method, an implementation may + * need to examine the file to determine if the file is a directory. * Consequently this method may not be atomic with respect to other file - * system operations. If the file is a symbolic-link then the link is - * deleted and not the final target of the link. + * system operations. If the file is a symbolic link, then the symbolic + * link itself, not the final target of the link, is deleted. * *

    If the file is a directory then the directory must be empty. In some * implementations a directory has entries for special files or links that @@ -507,7 +507,7 @@ public abstract class Path * create symbolic links, in which case this method may throw {@code IOException}. * * @param target - * the target of the link + * the target of the symbolic link * @param attrs * the array of attributes to set atomically when creating the * symbolic link @@ -573,9 +573,9 @@ public abstract class Path * Reads the target of a symbolic link (optional operation). * *

    If the file system supports symbolic - * links then this method is used read the target of the link, failing - * if the file is not a link. The target of the link need not exist. The - * returned {@code Path} object will be associated with the same file + * links then this method is used to read the target of the link, failing + * if the file is not a symbolic link. The target of the link need not exist. + * The returned {@code Path} object will be associated with the same file * system as this {@code Path}. * * @return a {@code Path} object representing the target of the link @@ -584,7 +584,7 @@ public abstract class Path * if the implementation does not support symbolic links * @throws NotLinkException * if the target could otherwise not be read because the file - * is not a link (optional specific exception) + * is not a symbolic link (optional specific exception) * @throws IOException * if an I/O error occurs * @throws SecurityException @@ -724,8 +724,8 @@ public abstract class Path * exists, except if the source and target are the {@link #isSameFile same} * file, in which case this method has no effect. File attributes are not * required to be copied to the target file. If symbolic links are supported, - * and the file is a link, then the final target of the link is copied. If - * the file is a directory then it creates an empty directory in the target + * and the file is a symbolic link, then the final target of the link is copied. + * If the file is a directory then it creates an empty directory in the target * location (entries in the directory are not copied). This method can be * used with the {@link Files#walkFileTree Files.walkFileTree} utility * method to copy a directory and all entries in the directory, or an entire @@ -740,8 +740,8 @@ public abstract class Path * {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} * If the target file exists, then the target file is replaced if it * is not a non-empty directory. If the target file exists and is a - * symbolic-link then the symbolic-link is replaced (not the target of - * the link. + * symbolic link, then the symbolic link itself, not the target of + * the link, is replaced. * * * {@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} @@ -755,11 +755,11 @@ public abstract class Path * * * {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} - * Symbolic-links are not followed. If the file, located by this path, - * is a symbolic-link then the link is copied rather than the target of - * the link. It is implementation specific if file attributes can be - * copied to the new link. In other words, the {@code COPY_ATTRIBUTES} - * option may be ignored when copying a link. + * Symbolic links are not followed. If the file, located by this path, + * is a symbolic link, then the symbolic link itself, not the target of + * the link, is copied. It is implementation specific if file attributes + * can be copied to the new link. In other words, the {@code + * COPY_ATTRIBUTES} option may be ignored when copying a symbolic link. * * * @@ -807,18 +807,19 @@ public abstract class Path *

    By default, this method attempts to move the file to the target * location, failing if the target file exists except if the source and * target are the {@link #isSameFile same} file, in which case this method - * has no effect. If the file is a symbolic link then the link is moved and - * not the target of the link. This method may be invoked to move an empty - * directory. In some implementations a directory has entries for special - * files or links that are created when the directory is created. In such - * implementations a directory is considered empty when only the special - * entries exist. When invoked to move a directory that is not empty then the - * directory is moved if it does not require moving the entries in the directory. - * For example, renaming a directory on the same {@link FileStore} will usually - * not require moving the entries in the directory. When moving a directory - * requires that its entries be moved then this method fails (by throwing - * an {@code IOException}). To move a file tree may involve copying - * rather than moving directories and this can be done using the {@link + * has no effect. If the file is a symbolic link then the symbolic link + * itself, not the target of the link, is moved. This method may be + * invoked to move an empty directory. In some implementations a directory + * has entries for special files or links that are created when the + * directory is created. In such implementations a directory is considered + * empty when only the special entries exist. When invoked to move a + * directory that is not empty then the directory is moved if it does not + * require moving the entries in the directory. For example, renaming a + * directory on the same {@link FileStore} will usually not require moving + * the entries in the directory. When moving a directory requires that its + * entries be moved then this method fails (by throwing an {@code + * IOException}). To move a file tree may involve copying rather + * than moving directories and this can be done using the {@link * #copyTo copyTo} method in conjunction with the {@link * Files#walkFileTree Files.walkFileTree} utility method. * @@ -831,8 +832,8 @@ public abstract class Path * {@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} * If the target file exists, then the target file is replaced if it * is not a non-empty directory. If the target file exists and is a - * symbolic-link then the symbolic-link is replaced and not the target of - * the link. + * symbolic link, then the symbolic link itself, not the target of + * the link, is replaced. * * * {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} @@ -1495,7 +1496,7 @@ public abstract class Path * *

    Where a file is registered with a watch service by means of a symbolic * link then it is implementation specific if the watch continues to depend - * on the existence of the link after it is registered. + * on the existence of the symbolic link after it is registered. * * @param watcher * the watch service to which this object is to be registered diff --git a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java index 9655695d301..9667a3cf5ce 100644 --- a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java +++ b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java @@ -166,12 +166,13 @@ public abstract class SecureDirectoryStream /** * Deletes a file. * - *

    Unlike the {@link Path#delete delete()} method, this method - * does not first examine the file to determine if the file is a directory. + *

    Unlike the {@link Path#delete delete()} method, this method does + * not first examine the file to determine if the file is a directory. * Whether a directory is deleted by this method is system dependent and - * therefore not specified. If the file is a symbolic-link then the link is - * deleted (not the final target of the link). When the parameter is a - * relative path then the file to delete is relative to this open directory. + * therefore not specified. If the file is a symbolic link, then the link + * itself, not the final target of the link, is deleted. When the + * parameter is a relative path then the file to delete is relative to + * this open directory. * * @param path * the path of the file to delete diff --git a/jdk/src/share/classes/java/nio/file/attribute/Attributes.java b/jdk/src/share/classes/java/nio/file/attribute/Attributes.java index 3ffa6389b43..cfcbf44a708 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/Attributes.java +++ b/jdk/src/share/classes/java/nio/file/attribute/Attributes.java @@ -48,9 +48,9 @@ public final class Attributes { * symbolic links are followed and the file attributes of the final target * of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attributes of the symbolic link. This option - * should be used where there is a need to determine if a file is a - * symbolic link: + * the method returns the file attributes of the symbolic link itself. + * This option should be used where there is a need to determine if a + * file is a symbolic link: *

          *    boolean isSymbolicLink = Attributes.readBasicFileAttributes(file, NOFOLLOW_LINKS).isSymbolicLink();
          * 
    @@ -98,7 +98,7 @@ public final class Attributes { * symbolic links are followed and the file attributes of the final target * of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attributes of the symbolic link. + * the method returns the file attributes of the symbolic link itself. * * @param file * A file reference that locates the file @@ -145,7 +145,7 @@ public final class Attributes { * symbolic links are followed and the file attributes of the final target * of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attributes of the symbolic link. + * the method returns the file attributes of the symbolic link itself. * * @param file * A file reference that locates the file diff --git a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java index 6fb3bbf7ee9..4e45711292a 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java +++ b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java @@ -81,13 +81,13 @@ public interface BasicFileAttributes { boolean isDirectory(); /** - * Tells whether the file is a symbolic-link. + * Tells whether the file is a symbolic link. */ boolean isSymbolicLink(); /** * Tells whether the file is something other than a regular file, directory, - * or link. + * or symbolic link. */ boolean isOther(); From 8a5359c35b6c2af54520afd00bc6b86c3b43eb86 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 6 Jul 2009 14:32:04 +0400 Subject: [PATCH 22/91] 6723447: Introspector doesn't check return type for indexed property setters Reviewed-by: rupashka --- .../java/beans/IndexedPropertyDescriptor.java | 7 +- .../classes/java/beans/Introspector.java | 6 +- .../java/beans/PropertyDescriptor.java | 7 +- .../java/beans/Introspector/Test6723447.java | 88 +++++++++++++++++++ 4 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 jdk/test/java/beans/Introspector/Test6723447.java diff --git a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java index fa5b404c239..e0d2bb4bb4f 100644 --- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java +++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -274,6 +274,11 @@ perty. } indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, 2, (type == null) ? null : new Class[] { int.class, type }); + if (indexedWriteMethod != null) { + if (!indexedWriteMethod.getReturnType().equals(void.class)) { + indexedWriteMethod = null; + } + } setIndexedWriteMethod0(indexedWriteMethod); } return indexedWriteMethod; diff --git a/jdk/src/share/classes/java/beans/Introspector.java b/jdk/src/share/classes/java/beans/Introspector.java index b43911cf123..1c90f205a88 100644 --- a/jdk/src/share/classes/java/beans/Introspector.java +++ b/jdk/src/share/classes/java/beans/Introspector.java @@ -524,9 +524,9 @@ public class Introspector { pd = new PropertyDescriptor(this.beanClass, name.substring(2), method, null); } } else if (argCount == 1) { - if (argTypes[0] == int.class && name.startsWith(GET_PREFIX)) { + if (int.class.equals(argTypes[0]) && name.startsWith(GET_PREFIX)) { pd = new IndexedPropertyDescriptor(this.beanClass, name.substring(3), null, null, method, null); - } else if (resultType == void.class && name.startsWith(SET_PREFIX)) { + } else if (void.class.equals(resultType) && name.startsWith(SET_PREFIX)) { // Simple setter pd = new PropertyDescriptor(this.beanClass, name.substring(3), null, method); if (throwsException(method, PropertyVetoException.class)) { @@ -534,7 +534,7 @@ public class Introspector { } } } else if (argCount == 2) { - if (argTypes[0] == int.class && name.startsWith(SET_PREFIX)) { + if (void.class.equals(resultType) && int.class.equals(argTypes[0]) && name.startsWith(SET_PREFIX)) { pd = new IndexedPropertyDescriptor(this.beanClass, name.substring(3), null, null, null, method); if (throwsException(method, PropertyVetoException.class)) { pd.setConstrained(true); diff --git a/jdk/src/share/classes/java/beans/PropertyDescriptor.java b/jdk/src/share/classes/java/beans/PropertyDescriptor.java index 08ae9a45f42..70a539c81fd 100644 --- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java +++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -294,6 +294,11 @@ public class PropertyDescriptor extends FeatureDescriptor { writeMethod = Introspector.findMethod(cls, writeMethodName, 1, (type == null) ? null : new Class[] { type }); + if (writeMethod != null) { + if (!writeMethod.getReturnType().equals(void.class)) { + writeMethod = null; + } + } try { setWriteMethod(writeMethod); } catch (IntrospectionException ex) { diff --git a/jdk/test/java/beans/Introspector/Test6723447.java b/jdk/test/java/beans/Introspector/Test6723447.java new file mode 100644 index 00000000000..04a3ca632d0 --- /dev/null +++ b/jdk/test/java/beans/Introspector/Test6723447.java @@ -0,0 +1,88 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6723447 + * @summary Tests return type for property setters + * @author Sergey Malenkov + */ + +import java.beans.IndexedPropertyDescriptor; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Method; +import java.math.BigDecimal; + +public class Test6723447 { + + public static void main(String[] args) { + test(Test6723447.class); + test(BigDecimal.class); + } + + private static void test(Class type) { + for (PropertyDescriptor pd : getPropertyDescriptors(type)) { + test(pd.getWriteMethod()); + if (pd instanceof IndexedPropertyDescriptor) { + IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd; + test(ipd.getIndexedWriteMethod()); + } + } + } + + private static void test(Method method) { + if (method != null) { + Class type = method.getReturnType(); + if (!type.equals(void.class)) { + throw new Error("unexpected return type: " + type); + } + } + } + + private static PropertyDescriptor[] getPropertyDescriptors(Class type) { + try { + return Introspector.getBeanInfo(type).getPropertyDescriptors(); + } + catch (IntrospectionException exception) { + throw new Error("unexpected exception", exception); + } + } + + public Object getValue() { + return null; + } + + public Object setValue(Object value) { + return value; + } + + public Object getValues(int index) { + return null; + } + + public Object setValues(int index, Object value) { + return value; + } +} From d8a3c0970652cd914ae4d1ce945f5ff86f15435a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Collet Date: Mon, 6 Jul 2009 15:13:48 +0200 Subject: [PATCH 23/91] 6856856: NPE in HTTP protocol handler logging Fixed the NPE and Moved the java.util.logging dependency to a single class and used reflection to make it a soft one. Reviewed-by: chegar --- .../classes/sun/net/www/http/HttpCapture.java | 72 +++++++++++++++++++ .../classes/sun/net/www/http/HttpClient.java | 10 +-- .../www/protocol/http/HttpLogFormatter.java | 3 +- .../www/protocol/http/HttpURLConnection.java | 65 ++++++++--------- 4 files changed, 105 insertions(+), 45 deletions(-) diff --git a/jdk/src/share/classes/sun/net/www/http/HttpCapture.java b/jdk/src/share/classes/sun/net/www/http/HttpCapture.java index 873c0dcc398..78debed415f 100644 --- a/jdk/src/share/classes/sun/net/www/http/HttpCapture.java +++ b/jdk/src/share/classes/sun/net/www/http/HttpCapture.java @@ -25,6 +25,8 @@ package sun.net.www.http; import java.io.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -60,6 +62,76 @@ public class HttpCapture { private static boolean initialized = false; private static volatile ArrayList patterns = null; private static volatile ArrayList capFiles = null; + /* Logging is done in an ugly way so that it does not require the presence + * the java.util.logging package. If the Logger class is not available, then + * logging is turned off. This is for helping the modularization effort. + */ + private static Object logger = null; + private static boolean logging = false; + + static { + Class cl; + try { + cl = Class.forName("java.util.logging.Logger"); + } catch (ClassNotFoundException ex) { + cl = null; + } + if (cl != null) { + try { + Method m = cl.getMethod("getLogger", String.class); + logger = m.invoke(null, "sun.net.www.protocol.http.HttpURLConnection"); + logging = true; + } catch (NoSuchMethodException noSuchMethodException) { + } catch (SecurityException securityException) { + } catch (IllegalAccessException illegalAccessException) { + } catch (IllegalArgumentException illegalArgumentException) { + } catch (InvocationTargetException invocationTargetException) { + } + } + } + + public static void fine(String s) { + if (logging) { + ((Logger)logger).fine(s); + } + } + + public static void finer(String s) { + if (logging) { + ((Logger)logger).finer(s); + } + } + + public static void finest(String s) { + if (logging) { + ((Logger)logger).finest(s); + } + } + + public static void severe(String s) { + if (logging) { + ((Logger)logger).finest(s); + } + } + + public static void info(String s) { + if (logging) { + ((Logger)logger).info(s); + } + } + + public static void warning(String s) { + if (logging) { + ((Logger)logger).warning(s); + } + } + + public static boolean isLoggable(String level) { + if (!logging) { + return false; + } + return ((Logger)logger).isLoggable(Level.parse(level)); + } private static synchronized void init() { initialized = true; diff --git a/jdk/src/share/classes/sun/net/www/http/HttpClient.java b/jdk/src/share/classes/sun/net/www/http/HttpClient.java index f170ff1cca0..c4ff7552c18 100644 --- a/jdk/src/share/classes/sun/net/www/http/HttpClient.java +++ b/jdk/src/share/classes/sun/net/www/http/HttpClient.java @@ -28,8 +28,6 @@ package sun.net.www.http; import java.io.*; import java.net.*; import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; import sun.net.NetworkClient; import sun.net.ProgressSource; import sun.net.www.MessageHeader; @@ -66,10 +64,6 @@ public class HttpClient extends NetworkClient { /** Default port number for http daemons. REMIND: make these private */ static final int httpPortNumber = 80; - // Use same logger as HttpURLConnection since we want to combine both event - // streams into one single HTTP log - private static Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection"); - /** return default port number (subclasses may override) */ protected int getDefaultPort () { return httpPortNumber; } @@ -810,8 +804,8 @@ public class HttpClient extends NetworkClient { if (isKeepingAlive()) { // Wrap KeepAliveStream if keep alive is enabled. - if (logger.isLoggable(Level.FINEST)) { - logger.finest("KeepAlive stream used: " + url); + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("KeepAlive stream used: " + url); } serverInput = new KeepAliveStream(serverInput, pi, cl, this); failedOnce = false; diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpLogFormatter.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpLogFormatter.java index 0163d42eda0..97b9be64ed1 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpLogFormatter.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpLogFormatter.java @@ -49,8 +49,7 @@ public class HttpLogFormatter extends java.util.logging.SimpleFormatter { @Override public String format(LogRecord record) { - if (!"sun.net.www.protocol.http.HttpURLConnection".equalsIgnoreCase(record.getSourceClassName()) - && !"sun.net.www.http.HttpClient".equalsIgnoreCase(record.getSourceClassName())) { + if (!"sun.net.www.http.HttpCapture".equalsIgnoreCase(record.getSourceClassName())) { // Don't change format for stuff that doesn't concern us return super.format(record); } diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index afd35f0d72e..accd8295503 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -51,14 +51,13 @@ import java.util.List; import java.util.Locale; import java.util.StringTokenizer; import java.util.Iterator; -import java.util.logging.Level; -import java.util.logging.Logger; import sun.net.*; import sun.net.www.*; import sun.net.www.http.HttpClient; import sun.net.www.http.PosterOutputStream; import sun.net.www.http.ChunkedInputStream; import sun.net.www.http.ChunkedOutputStream; +import sun.net.www.http.HttpCapture; import java.text.SimpleDateFormat; import java.util.TimeZone; import java.net.MalformedURLException; @@ -71,8 +70,6 @@ import java.nio.ByteBuffer; public class HttpURLConnection extends java.net.HttpURLConnection { - private static Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection"); - static String HTTP_CONNECT = "CONNECT"; static final String version; @@ -304,14 +301,14 @@ public class HttpURLConnection extends java.net.HttpURLConnection { return java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { public PasswordAuthentication run() { - if (logger.isLoggable(Level.FINEST)) { - logger.finest("Requesting Authentication: host =" + host + " url = " + url); + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("Requesting Authentication: host =" + host + " url = " + url); } PasswordAuthentication pass = Authenticator.requestPasswordAuthentication( host, addr, port, protocol, prompt, scheme, url, authType); - if (pass != null && logger.isLoggable(Level.FINEST)) { - logger.finest("Authentication returned: " + pass.toString()); + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("Authentication returned: " + (pass != null ? pass.toString() : "null")); } return pass; } @@ -466,8 +463,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { setRequests=true; } - if (logger.isLoggable(Level.FINE)) { - logger.fine(requests.toString()); + if (HttpCapture.isLoggable("FINE")) { + HttpCapture.fine(requests.toString()); } http.writeRequests(requests, poster); if (ps.checkError()) { @@ -723,11 +720,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { && !(cachedResponse instanceof SecureCacheResponse)) { cachedResponse = null; } - if (logger.isLoggable(Level.FINEST)) { - logger.finest("Cache Request for " + uri + " / " + getRequestMethod()); - if (cachedResponse != null) { - logger.finest("From cache: "+cachedResponse.toString()); - } + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("Cache Request for " + uri + " / " + getRequestMethod()); + HttpCapture.finest("From cache: " + (cachedResponse != null ? cachedResponse.toString() : "null")); } if (cachedResponse != null) { cachedHeaders = mapToMessageHeader(cachedResponse.getHeaders()); @@ -766,8 +761,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { }); if (sel != null) { URI uri = sun.net.www.ParseUtil.toURI(url); - if (logger.isLoggable(Level.FINEST)) { - logger.finest("ProxySelector Request for " + uri); + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("ProxySelector Request for " + uri); } Iterator it = sel.select(uri).iterator(); Proxy p; @@ -783,9 +778,9 @@ public class HttpURLConnection extends java.net.HttpURLConnection { http = getNewHttpClient(url, p, connectTimeout, false); http.setReadTimeout(readTimeout); } - if (logger.isLoggable(Level.FINEST)) { + if (HttpCapture.isLoggable("FINEST")) { if (p != null) { - logger.finest("Proxy used: " + p.toString()); + HttpCapture.finest("Proxy used: " + p.toString()); } } break; @@ -1015,15 +1010,15 @@ public class HttpURLConnection extends java.net.HttpURLConnection { URI uri = ParseUtil.toURI(url); if (uri != null) { - if (logger.isLoggable(Level.FINEST)) { - logger.finest("CookieHandler request for " + uri); + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("CookieHandler request for " + uri); } Map> cookies = cookieHandler.get( uri, requests.getHeaders(EXCLUDE_HEADERS)); if (!cookies.isEmpty()) { - if (logger.isLoggable(Level.FINEST)) { - logger.finest("Cookies retrieved: " + cookies.toString()); + if (HttpCapture.isLoggable("FINEST")) { + HttpCapture.finest("Cookies retrieved: " + cookies.toString()); } for (Map.Entry> entry : cookies.entrySet()) { @@ -1154,8 +1149,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { writeRequests(); } http.parseHTTP(responses, pi, this); - if (logger.isLoggable(Level.FINE)) { - logger.fine(responses.toString()); + if (HttpCapture.isLoggable("FINE")) { + HttpCapture.fine(responses.toString()); } inputStream = http.getInputStream(); @@ -1599,8 +1594,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { http.parseHTTP(responses, null, this); /* Log the response to the CONNECT */ - if (logger.isLoggable(Level.FINE)) { - logger.fine(responses.toString()); + if (HttpCapture.isLoggable("FINE")) { + HttpCapture.fine(responses.toString()); } statusLine = responses.getValue(0); @@ -1727,8 +1722,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { setPreemptiveProxyAuthentication(requests); /* Log the CONNECT request */ - if (logger.isLoggable(Level.FINE)) { - logger.fine(requests.toString()); + if (HttpCapture.isLoggable("FINE")) { + HttpCapture.fine(requests.toString()); } http.writeRequests(requests, null); @@ -1872,8 +1867,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { } } } - if (logger.isLoggable(Level.FINER)) { - logger.finer("Proxy Authentication for " + authhdr.toString() +" returned " + ret.toString()); + if (HttpCapture.isLoggable("FINER")) { + HttpCapture.finer("Proxy Authentication for " + authhdr.toString() +" returned " + (ret != null ? ret.toString() : "null")); } return ret; } @@ -2002,8 +1997,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { } } } - if (logger.isLoggable(Level.FINER)) { - logger.finer("Server Authentication for " + authhdr.toString() +" returned " + ret.toString()); + if (HttpCapture.isLoggable("FINER")) { + HttpCapture.finer("Server Authentication for " + authhdr.toString() +" returned " + (ret != null ? ret.toString() : "null")); } return ret; } @@ -2078,8 +2073,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (streaming()) { throw new HttpRetryException (RETRY_MSG3, stat, loc); } - if (logger.isLoggable(Level.FINE)) { - logger.fine("Redirected from " + url + " to " + locUrl); + if (HttpCapture.isLoggable("FINE")) { + HttpCapture.fine("Redirected from " + url + " to " + locUrl); } // clear out old response headers!!!! From cab876d8d1dea4bb41278315342d50db85f65da9 Mon Sep 17 00:00:00 2001 From: Martin Buchholz Date: Mon, 6 Jul 2009 11:30:40 -0700 Subject: [PATCH 24/91] 6854795: Miscellaneous improvements to "jar" Cleanup of jar/Main.java (Initial patch by tobyr@google.com, additional review by jeremymanson@google.com, ulf.zibis@gmx.de) Reviewed-by: sherman, alanb --- jdk/src/share/classes/sun/tools/jar/Main.java | 349 +++++++++++------- jdk/test/tools/jar/index/MetaInf.java | 75 +++- 2 files changed, 263 insertions(+), 161 deletions(-) diff --git a/jdk/src/share/classes/sun/tools/jar/Main.java b/jdk/src/share/classes/sun/tools/jar/Main.java index ecd76d6e800..99f60f94c7a 100644 --- a/jdk/src/share/classes/sun/tools/jar/Main.java +++ b/jdk/src/share/classes/sun/tools/jar/Main.java @@ -26,12 +26,16 @@ package sun.tools.jar; import java.io.*; +import java.nio.file.Path; import java.util.*; import java.util.zip.*; import java.util.jar.*; import java.util.jar.Manifest; import java.text.MessageFormat; import sun.misc.JarIndex; +import static sun.misc.JarIndex.INDEX_NAME; +import static java.util.jar.JarFile.MANIFEST_NAME; +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; /** * This class implements a simple utility for creating files in the JAR @@ -58,7 +62,6 @@ class Main { // Directories specified by "-C" operation. Set paths = new HashSet(); - CRC32 crc32 = new CRC32(); /* * cflag: create * uflag: update @@ -71,10 +74,8 @@ class Main { */ boolean cflag, uflag, xflag, tflag, vflag, flag0, Mflag, iflag; - static final String MANIFEST = JarFile.MANIFEST_NAME; static final String MANIFEST_DIR = "META-INF/"; static final String VERSION = "1.0"; - static final String INDEX = JarIndex.INDEX_NAME; private static ResourceBundle rsrc; @@ -126,9 +127,21 @@ class Main { this.program = program; } + /** + * Creates a new empty temporary file in the same directory as the + * specified file. A variant of File.createTempFile. + */ + private static File createTempFileInSameDirectoryAs(File file) + throws IOException { + File dir = file.getParentFile(); + if (dir == null) + dir = new File("."); + return File.createTempFile("jartmp", null, dir); + } + private boolean ok; - /* + /** * Starts main program with the specified arguments. */ public synchronized boolean run(String args[]) { @@ -161,7 +174,7 @@ class Main { } addVersion(manifest); addCreatedBy(manifest); - if (isAmbigousMainClass(manifest)) { + if (isAmbiguousMainClass(manifest)) { if (in != null) { in.close(); } @@ -195,9 +208,7 @@ class Main { FileOutputStream out; if (fname != null) { inputFile = new File(fname); - String path = inputFile.getParent(); - tmpFile = File.createTempFile("tmp", null, - new File((path == null) ? "." : path)); + tmpFile = createTempFileInSameDirectoryAs(inputFile); in = new FileInputStream(inputFile); out = new FileOutputStream(tmpFile); } else { @@ -208,7 +219,8 @@ class Main { InputStream manifest = (!Mflag && (mname != null)) ? (new FileInputStream(mname)) : null; expand(null, files, true); - boolean updateOk = update(in, new BufferedOutputStream(out), manifest, null); + boolean updateOk = update(in, new BufferedOutputStream(out), + manifest, null); if (ok) { ok = updateOk; } @@ -270,8 +282,8 @@ class Main { return ok; } - /* - * Parse command line arguments. + /** + * Parses command line arguments. */ boolean parseArgs(String args[]) { /* Preprocess and expand @file arguments */ @@ -405,7 +417,7 @@ class Main { return true; } - /* + /** * Expands list of files to process into full list of all files that * can be found by recursively descending directories. */ @@ -442,7 +454,7 @@ class Main { } } - /* + /** * Creates a new JAR file. */ void create(OutputStream out, Manifest manifest) @@ -461,7 +473,7 @@ class Main { e.setSize(0); e.setCrc(0); zos.putNextEntry(e); - e = new ZipEntry(MANIFEST); + e = new ZipEntry(MANIFEST_NAME); e.setTime(System.currentTimeMillis()); if (flag0) { crc32Manifest(e, manifest); @@ -476,8 +488,32 @@ class Main { zos.close(); } - /* - * update an existing jar file. + private char toUpperCaseASCII(char c) { + return (c < 'a' || c > 'z') ? c : (char) (c + 'A' - 'a'); + } + + /** + * Compares two strings for equality, ignoring case. The second + * argument must contain only upper-case ASCII characters. + * We don't want case comparison to be locale-dependent (else we + * have the notorious "turkish i bug"). + */ + private boolean equalsIgnoreCase(String s, String upper) { + assert upper.toUpperCase(java.util.Locale.ENGLISH).equals(upper); + int len; + if ((len = s.length()) != upper.length()) + return false; + for (int i = 0; i < len; i++) { + char c1 = s.charAt(i); + char c2 = upper.charAt(i); + if (c1 != c2 && toUpperCaseASCII(c1) != c2) + return false; + } + return true; + } + + /** + * Updates an existing jar file. */ boolean update(InputStream in, OutputStream out, InputStream newManifest, @@ -487,8 +523,6 @@ class Main { ZipOutputStream zos = new JarOutputStream(out); ZipEntry e = null; boolean foundManifest = false; - byte[] buf = new byte[1024]; - int n = 0; boolean updateOk = true; if (jarIndex != null) { @@ -499,10 +533,9 @@ class Main { while ((e = zis.getNextEntry()) != null) { String name = e.getName(); - boolean isManifestEntry = name.toUpperCase( - java.util.Locale.ENGLISH). - equals(MANIFEST); - if ((name.toUpperCase().equals(INDEX) && jarIndex != null) + boolean isManifestEntry = equalsIgnoreCase(name, MANIFEST_NAME); + + if ((jarIndex != null && equalsIgnoreCase(name, INDEX_NAME)) || (Mflag && isManifestEntry)) { continue; } else if (isManifestEntry && ((newManifest != null) || @@ -513,9 +546,9 @@ class Main { // might need it below, and we can't re-read the same data // twice. FileInputStream fis = new FileInputStream(mname); - boolean ambigous = isAmbigousMainClass(new Manifest(fis)); + boolean ambiguous = isAmbiguousMainClass(new Manifest(fis)); fis.close(); - if (ambigous) { + if (ambiguous) { return false; } } @@ -539,9 +572,7 @@ class Main { e2.setCrc(e.getCrc()); } zos.putNextEntry(e2); - while ((n = zis.read(buf, 0, buf.length)) != -1) { - zos.write(buf, 0, n); - } + copy(zis, zos); } else { // replace with the new files File f = entryMap.get(name); addFile(zos, f); @@ -558,7 +589,7 @@ class Main { if (!foundManifest) { if (newManifest != null) { Manifest m = new Manifest(newManifest); - updateOk = !isAmbigousMainClass(m); + updateOk = !isAmbiguousMainClass(m); if (updateOk) { updateManifest(m, zos); } @@ -575,23 +606,16 @@ class Main { private void addIndex(JarIndex index, ZipOutputStream zos) throws IOException { - ZipEntry e = new ZipEntry(INDEX); + ZipEntry e = new ZipEntry(INDEX_NAME); e.setTime(System.currentTimeMillis()); if (flag0) { - e.setMethod(ZipEntry.STORED); - File ifile = File.createTempFile("index", null, new File(".")); - BufferedOutputStream bos = new BufferedOutputStream - (new FileOutputStream(ifile)); - index.write(bos); - crc32File(e, ifile); - bos.close(); - ifile.delete(); + CRC32OutputStream os = new CRC32OutputStream(); + index.write(os); + os.updateEntry(e); } zos.putNextEntry(e); index.write(zos); - if (vflag) { - // output(getMsg("out.update.manifest")); - } + zos.closeEntry(); } private void updateManifest(Manifest m, ZipOutputStream zos) @@ -602,10 +626,9 @@ class Main { if (ename != null) { addMainClass(m, ename); } - ZipEntry e = new ZipEntry(MANIFEST); + ZipEntry e = new ZipEntry(MANIFEST_NAME); e.setTime(System.currentTimeMillis()); if (flag0) { - e.setMethod(ZipEntry.STORED); crc32Manifest(e, m); } zos.putNextEntry(e); @@ -620,7 +643,8 @@ class Main { name = name.replace(File.separatorChar, '/'); String matchPath = ""; for (String path : paths) { - if (name.startsWith(path) && (path.length() > matchPath.length())) { + if (name.startsWith(path) + && (path.length() > matchPath.length())) { matchPath = path; } } @@ -658,7 +682,7 @@ class Main { global.put(Attributes.Name.MAIN_CLASS, mainApp); } - private boolean isAmbigousMainClass(Manifest m) { + private boolean isAmbiguousMainClass(Manifest m) { if (ename != null) { Attributes global = m.getMainAttributes(); if ((global.get(Attributes.Name.MAIN_CLASS) != null)) { @@ -670,7 +694,7 @@ class Main { return false; } - /* + /** * Adds a new file entry to the ZIP output stream. */ void addFile(ZipOutputStream zos, File file) throws IOException { @@ -684,7 +708,7 @@ class Main { if (name.equals("") || name.equals(".") || name.equals(zname)) { return; - } else if ((name.equals(MANIFEST_DIR) || name.equals(MANIFEST)) + } else if ((name.equals(MANIFEST_DIR) || name.equals(MANIFEST_NAME)) && !Mflag) { if (vflag) { output(formatMsg("out.ignore.entry", name)); @@ -704,19 +728,11 @@ class Main { e.setSize(0); e.setCrc(0); } else if (flag0) { - e.setSize(size); - e.setMethod(ZipEntry.STORED); crc32File(e, file); } zos.putNextEntry(e); if (!isDir) { - byte[] buf = new byte[8192]; - int len; - InputStream is = new BufferedInputStream(new FileInputStream(file)); - while ((len = is.read(buf, 0, buf.length)) != -1) { - zos.write(buf, 0, len); - } - is.close(); + copy(file, zos); } zos.closeEntry(); /* report how much compression occurred. */ @@ -737,39 +753,83 @@ class Main { } } - /* - * compute the crc32 of a file. This is necessary when the ZipOutputStream - * is in STORED mode. + /** + * A buffer for use only by copy(InputStream, OutputStream). + * Not as clean as allocating a new buffer as needed by copy, + * but significantly more efficient. */ - private void crc32Manifest(ZipEntry e, Manifest m) throws IOException { - crc32.reset(); - CRC32OutputStream os = new CRC32OutputStream(crc32); - m.write(os); - e.setSize((long) os.n); - e.setCrc(crc32.getValue()); + private byte[] copyBuf = new byte[8192]; + + /** + * Copies all bytes from the input stream to the output stream. + * Does not close or flush either stream. + * + * @param from the input stream to read from + * @param to the output stream to write to + * @throws IOException if an I/O error occurs + */ + private void copy(InputStream from, OutputStream to) throws IOException { + int n; + while ((n = from.read(copyBuf)) != -1) + to.write(copyBuf, 0, n); } - /* - * compute the crc32 of a file. This is necessary when the ZipOutputStream - * is in STORED mode. + /** + * Copies all bytes from the input file to the output stream. + * Does not close or flush the output stream. + * + * @param from the input file to read from + * @param to the output stream to write to + * @throws IOException if an I/O error occurs + */ + private void copy(File from, OutputStream to) throws IOException { + InputStream in = new FileInputStream(from); + try { + copy(in, to); + } finally { + in.close(); + } + } + + /** + * Copies all bytes from the input stream to the output file. + * Does not close the input stream. + * + * @param from the input stream to read from + * @param to the output file to write to + * @throws IOException if an I/O error occurs + */ + private void copy(InputStream from, File to) throws IOException { + OutputStream out = new FileOutputStream(to); + try { + copy(from, out); + } finally { + out.close(); + } + } + + /** + * Computes the crc32 of a Manifest. This is necessary when the + * ZipOutputStream is in STORED mode. + */ + private void crc32Manifest(ZipEntry e, Manifest m) throws IOException { + CRC32OutputStream os = new CRC32OutputStream(); + m.write(os); + os.updateEntry(e); + } + + /** + * Computes the crc32 of a File. This is necessary when the + * ZipOutputStream is in STORED mode. */ private void crc32File(ZipEntry e, File f) throws IOException { - InputStream is = new BufferedInputStream(new FileInputStream(f)); - byte[] buf = new byte[8192]; - crc32.reset(); - int r = 0; - int nread = 0; - long len = f.length(); - while ((r = is.read(buf)) != -1) { - nread += r; - crc32.update(buf, 0, r); - } - is.close(); - if (nread != (int) len) { + CRC32OutputStream os = new CRC32OutputStream(); + copy(f, os); + if (os.n != f.length()) { throw new JarException(formatMsg( "error.incorrect.length", f.getPath())); } - e.setCrc(crc32.getValue()); + os.updateEntry(e); } void replaceFSC(String files[]) { @@ -780,6 +840,7 @@ class Main { } } + @SuppressWarnings("serial") Set newDirSet() { return new HashSet() { public boolean add(ZipEntry e) { @@ -797,7 +858,7 @@ class Main { } } - /* + /** * Extracts specified entries from JAR file. */ void extract(InputStream in, String files[]) throws IOException { @@ -827,7 +888,7 @@ class Main { updateLastModifiedTime(dirs); } - /* + /** * Extracts specified entries from JAR file, via ZipFile. */ void extract(String fname, String files[]) throws IOException { @@ -853,7 +914,7 @@ class Main { updateLastModifiedTime(dirs); } - /* + /** * Extracts next entry from JAR file, creating directories as needed. If * the entry is for a directory which doesn't exist prior to this * invocation, returns that entry, otherwise returns null. @@ -888,19 +949,13 @@ class Main { "error.create.dir", d.getPath())); } } - OutputStream os = new FileOutputStream(f); - byte[] b = new byte[8192]; - int len; try { - while ((len = is.read(b, 0, b.length)) != -1) { - os.write(b, 0, len); - } + copy(is, f); } finally { if (is instanceof ZipInputStream) ((ZipInputStream)is).closeEntry(); else is.close(); - os.close(); } if (vflag) { if (e.getMethod() == ZipEntry.DEFLATED) { @@ -919,7 +974,7 @@ class Main { return rc; } - /* + /** * Lists contents of JAR file. */ void list(InputStream in, String files[]) throws IOException { @@ -937,7 +992,7 @@ class Main { } } - /* + /** * Lists contents of JAR file, via ZipFile. */ void list(String fname, String files[]) throws IOException { @@ -950,32 +1005,38 @@ class Main { } /** - * Output the class index table to the INDEX.LIST file of the + * Outputs the class index table to the INDEX.LIST file of the * root jar file. */ void dumpIndex(String rootjar, JarIndex index) throws IOException { - File scratchFile = File.createTempFile("scratch", null, new File(".")); File jarFile = new File(rootjar); - boolean updateOk = update(new FileInputStream(jarFile), - new FileOutputStream(scratchFile), - null, index); - jarFile.delete(); - if (!scratchFile.renameTo(jarFile)) { - scratchFile.delete(); - throw new IOException(getMsg("error.write.file")); + Path jarPath = jarFile.toPath(); + Path tmpPath = createTempFileInSameDirectoryAs(jarFile).toPath(); + try { + if (update(jarPath.newInputStream(), + tmpPath.newOutputStream(), + null, index)) { + try { + tmpPath.moveTo(jarPath, REPLACE_EXISTING); + } catch (IOException e) { + throw new IOException(getMsg("error.write.file"), e); + } + } + } finally { + tmpPath.deleteIfExists(); } - scratchFile.delete(); } - private Hashtable jarTable = new Hashtable(); - /* - * Generate the transitive closure of the Class-Path attribute for + private HashSet jarPaths = new HashSet(); + + /** + * Generates the transitive closure of the Class-Path attribute for * the specified jar file. */ - Vector getJarPath(String jar) throws IOException { - Vector files = new Vector(); + List getJarPath(String jar) throws IOException { + List files = new ArrayList(); files.add(jar); - jarTable.put(jar, jar); + jarPaths.add(jar); // take out the current path String path = jar.substring(0, Math.max(0, jar.lastIndexOf('/') + 1)); @@ -998,7 +1059,7 @@ class Main { if (!ajar.endsWith("/")) { // it is a jar file ajar = path.concat(ajar); /* check on cyclic dependency */ - if (jarTable.get(ajar) == null) { + if (! jarPaths.contains(ajar)) { files.addAll(getJarPath(ajar)); } } @@ -1012,10 +1073,10 @@ class Main { } /** - * Generate class index file for the specified root jar file. + * Generates class index file for the specified root jar file. */ void genIndex(String rootjar, String[] files) throws IOException { - Vector jars = getJarPath(rootjar); + List jars = getJarPath(rootjar); int njars = jars.size(); String[] jarfiles; @@ -1027,12 +1088,12 @@ class Main { } njars = jars.size(); } - jarfiles = (String[])jars.toArray(new String[njars]); + jarfiles = jars.toArray(new String[njars]); JarIndex index = new JarIndex(jarfiles); dumpIndex(rootjar, index); } - /* + /** * Prints entry information, if requested. */ void printEntry(ZipEntry e, String[] files) throws IOException { @@ -1049,7 +1110,7 @@ class Main { } } - /* + /** * Prints entry information. */ void printEntry(ZipEntry e) throws IOException { @@ -1067,21 +1128,21 @@ class Main { } } - /* - * Print usage message and die. + /** + * Prints usage message. */ void usageError() { error(getMsg("usage")); } - /* + /** * A fatal exception has been caught. No recovery possible */ void fatalError(Exception e) { e.printStackTrace(); } - /* + /** * A fatal condition has been detected; message is "s". * No recovery possible */ @@ -1103,39 +1164,43 @@ class Main { err.println(s); } - /* + /** * Main routine to start program. */ public static void main(String args[]) { Main jartool = new Main(System.out, System.err, "jar"); System.exit(jartool.run(args) ? 0 : 1); } -} -/* - * an OutputStream that doesn't send its output anywhere, (but could). - * It's here to find the CRC32 of a manifest, necessary for STORED only - * mode in ZIP. - */ -final class CRC32OutputStream extends java.io.OutputStream { - CRC32 crc; - int n = 0; - CRC32OutputStream(CRC32 crc) { - this.crc = crc; - } + /** + * An OutputStream that doesn't send its output anywhere, (but could). + * It's here to find the CRC32 of an input file, necessary for STORED + * mode in ZIP. + */ + private static class CRC32OutputStream extends java.io.OutputStream { + final CRC32 crc = new CRC32(); + long n = 0; - public void write(int r) throws IOException { - crc.update(r); - n++; - } + CRC32OutputStream() {} - public void write(byte[] b) throws IOException { - crc.update(b, 0, b.length); - n += b.length; - } + public void write(int r) throws IOException { + crc.update(r); + n++; + } - public void write(byte[] b, int off, int len) throws IOException { - crc.update(b, off, len); - n += len - off; + public void write(byte[] b, int off, int len) throws IOException { + crc.update(b, off, len); + n += len; + } + + /** + * Updates a ZipEntry which describes the data read by this + * output stream, in STORED mode. + */ + public void updateEntry(ZipEntry e) { + e.setMethod(ZipEntry.STORED); + e.setSize(n); + e.setCrc(crc.getValue()); + } } } diff --git a/jdk/test/tools/jar/index/MetaInf.java b/jdk/test/tools/jar/index/MetaInf.java index dae74836938..9e05a8d4fb4 100644 --- a/jdk/test/tools/jar/index/MetaInf.java +++ b/jdk/test/tools/jar/index/MetaInf.java @@ -23,13 +23,15 @@ /* * @test - * @bug 4408526 + * @bug 4408526 6854795 * @summary Index the non-meta files in META-INF, such as META-INF/services. */ import java.io.*; +import java.util.Arrays; import java.util.jar.*; import sun.tools.jar.Main; +import java.util.zip.ZipFile; public class MetaInf { @@ -39,29 +41,51 @@ public class MetaInf { static String contents = System.getProperty("test.src") + File.separatorChar + "jarcontents"; - // Options passed to "jar" command. - static String[] jarArgs1 = new String[] { - "cf", jarName, "-C", contents, SERVICES - }; - static String[] jarArgs2 = new String[] { - "i", jarName - }; + static void run(String ... args) { + if (! new Main(System.out, System.err, "jar").run(args)) + throw new Error("jar failed: args=" + Arrays.toString(args)); + } - public static void main(String[] args) throws IOException { + static void copy(File from, File to) throws IOException { + FileInputStream in = new FileInputStream(from); + FileOutputStream out = new FileOutputStream(to); + try { + byte[] buf = new byte[8192]; + int n; + while ((n = in.read(buf)) != -1) + out.write(buf, 0, n); + } finally { + in.close(); + out.close(); + } + } + + static boolean contains(File jarFile, String entryName) + throws IOException { + return new ZipFile(jarFile).getEntry(entryName) != null; + } + + static void checkContains(File jarFile, String entryName) + throws IOException { + if (! contains(jarFile, entryName)) + throw new Error(String.format("expected jar %s to contain %s", + jarFile, entryName)); + } + + static void testIndex(String jarName) throws IOException { + System.err.printf("jarName=%s%n", jarName); + + File jar = new File(jarName); // Create a jar to be indexed. - Main jarTool = new Main(System.out, System.err, "jar"); - if (!jarTool.run(jarArgs1)) { - throw new Error("Could not create jar file."); + run("cf", jarName, "-C", contents, SERVICES); + + for (int i = 0; i < 2; i++) { + run("i", jarName); + checkContains(jar, INDEX); + checkContains(jar, SERVICES); } - // Index the jar. - jarTool = new Main(System.out, System.err, "jar"); - if (!jarTool.run(jarArgs2)) { - throw new Error("Could not index jar file."); - } - - // Read the index. Verify that META-INF/services is indexed. JarFile f = new JarFile(jarName); BufferedReader index = new BufferedReader( @@ -75,4 +99,17 @@ public class MetaInf { } throw new Error(SERVICES + " not indexed."); } + + public static void main(String[] args) throws IOException { + testIndex("a.jar"); // a path with parent == null + testIndex("./a.zip"); // a path with parent != null + + // Try indexing a jar in the default temp directory. + File tmpFile = File.createTempFile("MetaInf", null, null); + try { + testIndex(tmpFile.getPath()); + } finally { + tmpFile.delete(); + } + } } From 92d332e08b7adf54d18b39f6a5541ab644c67d62 Mon Sep 17 00:00:00 2001 From: Changpeng Fang Date: Mon, 6 Jul 2009 12:54:17 -0700 Subject: [PATCH 25/91] 6857707: Add missing test case for CR 6855164 from its bug description Add missing test case for CR 6855164 from its bug description. Reviewed-by: never --- hotspot/test/compiler/6855164/Test.java | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 hotspot/test/compiler/6855164/Test.java diff --git a/hotspot/test/compiler/6855164/Test.java b/hotspot/test/compiler/6855164/Test.java new file mode 100644 index 00000000000..e8113adf783 --- /dev/null +++ b/hotspot/test/compiler/6855164/Test.java @@ -0,0 +1,55 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6855164 + * @summary SIGSEGV during compilation of method involving loop over CharSequence + * @run main/othervm -Xbatch Test + */ + +public class Test{ + public static void main(String[] args) throws Exception { + StringBuffer builder = new StringBuffer(); + + for(int i = 0; i < 100; i++) + builder.append("I am the very model of a modern major general\n"); + + for(int j = 0; j < builder.length(); j++){ + previousSpaceIndex(builder, j); + } + } + + private static final int previousSpaceIndex(CharSequence sb, int seek) { + seek--; + while (seek > 0) { + if (sb.charAt(seek) == ' ') { + while (seek > 0 && sb.charAt(seek - 1) == ' ') + seek--; + return seek; + } + seek--; + } + return 0; + } +} From 5a1032d9e6c08151737f032f9981f3081caab69f Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Mon, 6 Jul 2009 15:53:30 -0700 Subject: [PATCH 26/91] 6857661: 64-bit server VM: assert(is_Initialize(),"invalid node class") Move the secondary raw memory barrier to the correct place in generate_arraycopy(). Reviewed-by: never --- hotspot/src/share/vm/opto/library_call.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 2894cf9a505..4fd8f5044a7 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -4500,27 +4500,27 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, generate_negative_guard(copy_length, slow_region); } + // copy_length is 0. if (!stopped() && must_clear_dest) { Node* dest_length = alloc->in(AllocateNode::ALength); if (_gvn.eqv_uncast(copy_length, dest_length) || _gvn.find_int_con(dest_length, 1) <= 0) { - // There is no zeroing to do. + // There is no zeroing to do. No need for a secondary raw memory barrier. } else { // Clear the whole thing since there are no source elements to copy. generate_clear_array(adr_type, dest, basic_elem_type, intcon(0), NULL, alloc->in(AllocateNode::AllocSize)); + // Use a secondary InitializeNode as raw memory barrier. + // Currently it is needed only on this path since other + // paths have stub or runtime calls as raw memory barriers. + InitializeNode* init = insert_mem_bar_volatile(Op_Initialize, + Compile::AliasIdxRaw, + top())->as_Initialize(); + init->set_complete(&_gvn); // (there is no corresponding AllocateNode) } } - // Use a secondary InitializeNode as raw memory barrier. - // Currently it is needed only on this path since other - // paths have stub or runtime calls as raw memory barriers. - InitializeNode* init = insert_mem_bar_volatile(Op_Initialize, - Compile::AliasIdxRaw, - top())->as_Initialize(); - init->set_complete(&_gvn); // (there is no corresponding AllocateNode) - // Present the results of the fast call. result_region->init_req(zero_path, control()); result_i_o ->init_req(zero_path, i_o()); From f3358ba3db77de135e196b2b2dc57617420c5b06 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Tue, 7 Jul 2009 14:11:06 +0400 Subject: [PATCH 27/91] 6489447: Apply the more robust fix for 6449933 to dolphin and 6ux Reviewed-by: malenkov --- jdk/src/windows/native/sun/windows/ShellFolder2.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jdk/src/windows/native/sun/windows/ShellFolder2.cpp b/jdk/src/windows/native/sun/windows/ShellFolder2.cpp index 6799b098218..64eea69bced 100644 --- a/jdk/src/windows/native/sun/windows/ShellFolder2.cpp +++ b/jdk/src/windows/native/sun/windows/ShellFolder2.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -981,6 +981,15 @@ JNIEXPORT jintArray JNICALL Java_sun_awt_shell_Win32ShellFolder2_getFileChooserB hBitmap = (HBITMAP)LoadImage(libShell32, IS_WINVISTA ? TEXT("IDB_TB_SH_DEF_16") : MAKEINTRESOURCE(216), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); + + if (hBitmap == NULL) { + // version of shell32.dll doesn't match OS version. + // So we either are in a Vista Compatibility Mode + // or shell32.dll was copied from OS of another version + hBitmap = (HBITMAP)LoadImage(libShell32, + IS_WINVISTA ? MAKEINTRESOURCE(216) : TEXT("IDB_TB_SH_DEF_16"), + IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); + } } if (hBitmap == NULL) { libComCtl32 = LoadLibrary(TEXT("comctl32.dll")); From b3f3644fea86f475e02ba7b139f30e7a0e191695 Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Tue, 7 Jul 2009 17:05:50 +0400 Subject: [PATCH 28/91] 6853916: java.awt.Window.setBackground(null) throws NullPointerException Window.setBackground() should check for null. Reviewed-by: art, dcherepanov --- jdk/src/share/classes/java/awt/Window.java | 2 +- .../SetBackgroundNPE/SetBackgroundNPE.java | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 jdk/test/java/awt/Window/SetBackgroundNPE/SetBackgroundNPE.java diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index aac5d3789da..31c94ca77e5 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -3597,7 +3597,7 @@ public class Window extends Container implements Accessible { return; } int oldAlpha = oldBg != null ? oldBg.getAlpha() : 255; - int alpha = bgColor.getAlpha(); + int alpha = bgColor != null ? bgColor.getAlpha() : 255; if ((oldAlpha == 255) && (alpha < 255)) { // non-opaque window GraphicsConfiguration gc = getGraphicsConfiguration(); GraphicsDevice gd = gc.getDevice(); diff --git a/jdk/test/java/awt/Window/SetBackgroundNPE/SetBackgroundNPE.java b/jdk/test/java/awt/Window/SetBackgroundNPE/SetBackgroundNPE.java new file mode 100644 index 00000000000..10c9ac72e0f --- /dev/null +++ b/jdk/test/java/awt/Window/SetBackgroundNPE/SetBackgroundNPE.java @@ -0,0 +1,38 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + @test + @bug 6853916 + @summary Window.setBackground() should not throw NPE + @author anthony.petrov@sun.com: area=awt.toplevel + @run main SetBackgroundNPE +*/ + +import java.awt.Window; + +public class SetBackgroundNPE { + public static void main(String args[]) { + new Window(null).setBackground(null); + } +} From 1215bc6717e86914234311924df59c8c958b40b3 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Tue, 7 Jul 2009 14:23:00 -0400 Subject: [PATCH 29/91] 6855834: G1: minimize the output when -XX:+PrintHeapAtGC is set Changing the behavior of -XX:+PrintHeapAtGC for G1 from printing lengthy, per-region information to instead printing a concise summary. Reviewed-by: ysr, apetrusenko, jcoomes --- .../gc_implementation/g1/g1CollectedHeap.cpp | 473 ++++++++++-------- .../gc_implementation/g1/g1CollectedHeap.hpp | 6 + .../g1/g1CollectorPolicy.hpp | 4 + .../vm/gc_implementation/g1/heapRegion.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 4 + 5 files changed, 269 insertions(+), 220 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 1c7a5442bfb..a42ace5ecac 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -902,6 +902,10 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs, size_t word_size) { ResourceMark rm; + if (PrintHeapAtGC) { + Universe::print_heap_before_gc(); + } + if (full && DisableExplicitGC) { gclog_or_tty->print("\n\n\nDisabling Explicit GC\n\n\n"); return; @@ -927,7 +931,7 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs, g1_policy()->record_full_collection_start(); gc_prologue(true); - increment_total_collections(); + increment_total_collections(true /* full gc */); size_t g1h_prev_used = used(); assert(used() == recalculate_used(), "Should be equal"); @@ -1066,6 +1070,10 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs, assert( check_young_list_empty(false, false), "young list should be empty at this point"); } + + if (PrintHeapAtGC) { + Universe::print_heap_after_gc(); + } } void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) { @@ -2325,9 +2333,37 @@ public: } }; -void G1CollectedHeap::print() const { print_on(gclog_or_tty); } +void G1CollectedHeap::print() const { print_on(tty); } void G1CollectedHeap::print_on(outputStream* st) const { + print_on(st, PrintHeapAtGCExtended); +} + +void G1CollectedHeap::print_on(outputStream* st, bool extended) const { + st->print(" %-20s", "garbage-first heap"); + st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", + capacity()/K, used()/K); + st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", + _g1_storage.low_boundary(), + _g1_storage.high(), + _g1_storage.high_boundary()); + st->cr(); + st->print(" region size " SIZE_FORMAT "K, ", + HeapRegion::GrainBytes/K); + size_t young_regions = _young_list->length(); + st->print(SIZE_FORMAT " young (" SIZE_FORMAT "K), ", + young_regions, young_regions * HeapRegion::GrainBytes / K); + size_t survivor_regions = g1_policy()->recorded_survivor_regions(); + st->print(SIZE_FORMAT " survivors (" SIZE_FORMAT "K)", + survivor_regions, survivor_regions * HeapRegion::GrainBytes / K); + st->cr(); + perm()->as_gen()->print_on(st); + if (extended) { + print_on_extended(st); + } +} + +void G1CollectedHeap::print_on_extended(outputStream* st) const { PrintRegionClosure blk(st); _hrs->iterate(&blk); } @@ -2408,10 +2444,6 @@ G1CollectedHeap* G1CollectedHeap::heap() { } void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { - if (PrintHeapAtGC){ - gclog_or_tty->print_cr(" {Heap before GC collections=%d:", total_collections()); - Universe::print(); - } assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer"); // Call allocation profiler AllocationProfiler::iterate_since_last_gc(); @@ -2425,12 +2457,6 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { // is set. COMPILER2_PRESENT(assert(DerivedPointerTable::is_empty(), "derived pointer present")); - - if (PrintHeapAtGC){ - gclog_or_tty->print_cr(" Heap after GC collections=%d:", total_collections()); - Universe::print(); - gclog_or_tty->print("} "); - } } void G1CollectedHeap::do_collection_pause() { @@ -2559,241 +2585,250 @@ G1CollectedHeap::cleanup_surviving_young_words() { void G1CollectedHeap::do_collection_pause_at_safepoint() { - char verbose_str[128]; - sprintf(verbose_str, "GC pause "); - if (g1_policy()->in_young_gc_mode()) { - if (g1_policy()->full_young_gcs()) - strcat(verbose_str, "(young)"); - else - strcat(verbose_str, "(partial)"); - } - if (g1_policy()->should_initiate_conc_mark()) - strcat(verbose_str, " (initial-mark)"); - - GCCauseSetter x(this, GCCause::_g1_inc_collection_pause); - - // if PrintGCDetails is on, we'll print long statistics information - // in the collector policy code, so let's not print this as the output - // is messy if we do. - gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - TraceTime t(verbose_str, PrintGC && !PrintGCDetails, true, gclog_or_tty); - - ResourceMark rm; - assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); - assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread"); - guarantee(!is_gc_active(), "collection is not reentrant"); - assert(regions_accounted_for(), "Region leakage!"); - - increment_gc_time_stamp(); - - if (g1_policy()->in_young_gc_mode()) { - assert(check_young_list_well_formed(), - "young list should be well formed"); + if (PrintHeapAtGC) { + Universe::print_heap_before_gc(); } - if (GC_locker::is_active()) { - return; // GC is disabled (e.g. JNI GetXXXCritical operation) - } + { + char verbose_str[128]; + sprintf(verbose_str, "GC pause "); + if (g1_policy()->in_young_gc_mode()) { + if (g1_policy()->full_young_gcs()) + strcat(verbose_str, "(young)"); + else + strcat(verbose_str, "(partial)"); + } + if (g1_policy()->should_initiate_conc_mark()) + strcat(verbose_str, " (initial-mark)"); - bool abandoned = false; - { // Call to jvmpi::post_class_unload_events must occur outside of active GC - IsGCActiveMark x; + GCCauseSetter x(this, GCCause::_g1_inc_collection_pause); - gc_prologue(false); - increment_total_collections(); + // if PrintGCDetails is on, we'll print long statistics information + // in the collector policy code, so let's not print this as the output + // is messy if we do. + gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); + TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); + TraceTime t(verbose_str, PrintGC && !PrintGCDetails, true, gclog_or_tty); + + ResourceMark rm; + assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); + assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread"); + guarantee(!is_gc_active(), "collection is not reentrant"); + assert(regions_accounted_for(), "Region leakage!"); + + increment_gc_time_stamp(); + + if (g1_policy()->in_young_gc_mode()) { + assert(check_young_list_well_formed(), + "young list should be well formed"); + } + + if (GC_locker::is_active()) { + return; // GC is disabled (e.g. JNI GetXXXCritical operation) + } + + bool abandoned = false; + { // Call to jvmpi::post_class_unload_events must occur outside of active GC + IsGCActiveMark x; + + gc_prologue(false); + increment_total_collections(false /* full gc */); #if G1_REM_SET_LOGGING - gclog_or_tty->print_cr("\nJust chose CS, heap:"); - print(); -#endif - - if (VerifyBeforeGC && total_collections() >= VerifyGCStartAt) { - HandleMark hm; // Discard invalid handles created during verification - prepare_for_verify(); - gclog_or_tty->print(" VerifyBeforeGC:"); - Universe::verify(false); - } - - COMPILER2_PRESENT(DerivedPointerTable::clear()); - - // We want to turn off ref discovery, if necessary, and turn it back on - // on again later if we do. - bool was_enabled = ref_processor()->discovery_enabled(); - if (was_enabled) ref_processor()->disable_discovery(); - - // Forget the current alloc region (we might even choose it to be part - // of the collection set!). - abandon_cur_alloc_region(); - - // The elapsed time induced by the start time below deliberately elides - // the possible verification above. - double start_time_sec = os::elapsedTime(); - GCOverheadReporter::recordSTWStart(start_time_sec); - size_t start_used_bytes = used(); - if (!G1ConcMark) { - do_sync_mark(); - } - - g1_policy()->record_collection_pause_start(start_time_sec, - start_used_bytes); - - guarantee(_in_cset_fast_test == NULL, "invariant"); - guarantee(_in_cset_fast_test_base == NULL, "invariant"); - _in_cset_fast_test_length = max_regions(); - _in_cset_fast_test_base = - NEW_C_HEAP_ARRAY(bool, _in_cset_fast_test_length); - memset(_in_cset_fast_test_base, false, - _in_cset_fast_test_length * sizeof(bool)); - // We're biasing _in_cset_fast_test to avoid subtracting the - // beginning of the heap every time we want to index; basically - // it's the same with what we do with the card table. - _in_cset_fast_test = _in_cset_fast_test_base - - ((size_t) _g1_reserved.start() >> HeapRegion::LogOfHRGrainBytes); - -#if SCAN_ONLY_VERBOSE - _young_list->print(); -#endif // SCAN_ONLY_VERBOSE - - if (g1_policy()->should_initiate_conc_mark()) { - concurrent_mark()->checkpointRootsInitialPre(); - } - save_marks(); - - // We must do this before any possible evacuation that should propagate - // marks. - if (mark_in_progress()) { - double start_time_sec = os::elapsedTime(); - - _cm->drainAllSATBBuffers(); - double finish_mark_ms = (os::elapsedTime() - start_time_sec) * 1000.0; - g1_policy()->record_satb_drain_time(finish_mark_ms); - - } - // Record the number of elements currently on the mark stack, so we - // only iterate over these. (Since evacuation may add to the mark - // stack, doing more exposes race conditions.) If no mark is in - // progress, this will be zero. - _cm->set_oops_do_bound(); - - assert(regions_accounted_for(), "Region leakage."); - - if (mark_in_progress()) - concurrent_mark()->newCSet(); - - // Now choose the CS. - g1_policy()->choose_collection_set(); - - // We may abandon a pause if we find no region that will fit in the MMU - // pause. - bool abandoned = (g1_policy()->collection_set() == NULL); - - // Nothing to do if we were unable to choose a collection set. - if (!abandoned) { -#if G1_REM_SET_LOGGING - gclog_or_tty->print_cr("\nAfter pause, heap:"); + gclog_or_tty->print_cr("\nJust chose CS, heap:"); print(); #endif - setup_surviving_young_words(); + if (VerifyBeforeGC && total_collections() >= VerifyGCStartAt) { + HandleMark hm; // Discard invalid handles created during verification + prepare_for_verify(); + gclog_or_tty->print(" VerifyBeforeGC:"); + Universe::verify(false); + } - // Set up the gc allocation regions. - get_gc_alloc_regions(); + COMPILER2_PRESENT(DerivedPointerTable::clear()); - // Actually do the work... - evacuate_collection_set(); - free_collection_set(g1_policy()->collection_set()); - g1_policy()->clear_collection_set(); + // We want to turn off ref discovery, if necessary, and turn it back on + // on again later if we do. + bool was_enabled = ref_processor()->discovery_enabled(); + if (was_enabled) ref_processor()->disable_discovery(); - FREE_C_HEAP_ARRAY(bool, _in_cset_fast_test_base); - // this is more for peace of mind; we're nulling them here and - // we're expecting them to be null at the beginning of the next GC - _in_cset_fast_test = NULL; - _in_cset_fast_test_base = NULL; + // Forget the current alloc region (we might even choose it to be part + // of the collection set!). + abandon_cur_alloc_region(); - release_gc_alloc_regions(false /* totally */); + // The elapsed time induced by the start time below deliberately elides + // the possible verification above. + double start_time_sec = os::elapsedTime(); + GCOverheadReporter::recordSTWStart(start_time_sec); + size_t start_used_bytes = used(); + if (!G1ConcMark) { + do_sync_mark(); + } - cleanup_surviving_young_words(); + g1_policy()->record_collection_pause_start(start_time_sec, + start_used_bytes); - if (g1_policy()->in_young_gc_mode()) { - _young_list->reset_sampled_info(); - assert(check_young_list_empty(true), - "young list should be empty"); + guarantee(_in_cset_fast_test == NULL, "invariant"); + guarantee(_in_cset_fast_test_base == NULL, "invariant"); + _in_cset_fast_test_length = max_regions(); + _in_cset_fast_test_base = + NEW_C_HEAP_ARRAY(bool, _in_cset_fast_test_length); + memset(_in_cset_fast_test_base, false, + _in_cset_fast_test_length * sizeof(bool)); + // We're biasing _in_cset_fast_test to avoid subtracting the + // beginning of the heap every time we want to index; basically + // it's the same with what we do with the card table. + _in_cset_fast_test = _in_cset_fast_test_base - + ((size_t) _g1_reserved.start() >> HeapRegion::LogOfHRGrainBytes); #if SCAN_ONLY_VERBOSE - _young_list->print(); + _young_list->print(); #endif // SCAN_ONLY_VERBOSE - g1_policy()->record_survivor_regions(_young_list->survivor_length(), - _young_list->first_survivor_region(), - _young_list->last_survivor_region()); - _young_list->reset_auxilary_lists(); + if (g1_policy()->should_initiate_conc_mark()) { + concurrent_mark()->checkpointRootsInitialPre(); } - } else { - COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); - } + save_marks(); - if (evacuation_failed()) { - _summary_bytes_used = recalculate_used(); - } else { - // The "used" of the the collection set have already been subtracted - // when they were freed. Add in the bytes evacuated. - _summary_bytes_used += g1_policy()->bytes_in_to_space(); - } + // We must do this before any possible evacuation that should propagate + // marks. + if (mark_in_progress()) { + double start_time_sec = os::elapsedTime(); - if (g1_policy()->in_young_gc_mode() && - g1_policy()->should_initiate_conc_mark()) { - concurrent_mark()->checkpointRootsInitialPost(); - set_marking_started(); - doConcurrentMark(); - } - -#if SCAN_ONLY_VERBOSE - _young_list->print(); -#endif // SCAN_ONLY_VERBOSE - - double end_time_sec = os::elapsedTime(); - double pause_time_ms = (end_time_sec - start_time_sec) * MILLIUNITS; - g1_policy()->record_pause_time_ms(pause_time_ms); - GCOverheadReporter::recordSTWEnd(end_time_sec); - g1_policy()->record_collection_pause_end(abandoned); - - assert(regions_accounted_for(), "Region leakage."); - - if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { - HandleMark hm; // Discard invalid handles created during verification - gclog_or_tty->print(" VerifyAfterGC:"); - prepare_for_verify(); - Universe::verify(false); - } - - if (was_enabled) ref_processor()->enable_discovery(); - - { - size_t expand_bytes = g1_policy()->expansion_amount(); - if (expand_bytes > 0) { - size_t bytes_before = capacity(); - expand(expand_bytes); + _cm->drainAllSATBBuffers(); + double finish_mark_ms = (os::elapsedTime() - start_time_sec) * 1000.0; + g1_policy()->record_satb_drain_time(finish_mark_ms); } - } + // Record the number of elements currently on the mark stack, so we + // only iterate over these. (Since evacuation may add to the mark + // stack, doing more exposes race conditions.) If no mark is in + // progress, this will be zero. + _cm->set_oops_do_bound(); - if (mark_in_progress()) { - concurrent_mark()->update_g1_committed(); - } + assert(regions_accounted_for(), "Region leakage."); -#ifdef TRACESPINNING - ParallelTaskTerminator::print_termination_counts(); + if (mark_in_progress()) + concurrent_mark()->newCSet(); + + // Now choose the CS. + g1_policy()->choose_collection_set(); + + // We may abandon a pause if we find no region that will fit in the MMU + // pause. + bool abandoned = (g1_policy()->collection_set() == NULL); + + // Nothing to do if we were unable to choose a collection set. + if (!abandoned) { +#if G1_REM_SET_LOGGING + gclog_or_tty->print_cr("\nAfter pause, heap:"); + print(); #endif - gc_epilogue(false); + setup_surviving_young_words(); + + // Set up the gc allocation regions. + get_gc_alloc_regions(); + + // Actually do the work... + evacuate_collection_set(); + free_collection_set(g1_policy()->collection_set()); + g1_policy()->clear_collection_set(); + + FREE_C_HEAP_ARRAY(bool, _in_cset_fast_test_base); + // this is more for peace of mind; we're nulling them here and + // we're expecting them to be null at the beginning of the next GC + _in_cset_fast_test = NULL; + _in_cset_fast_test_base = NULL; + + release_gc_alloc_regions(false /* totally */); + + cleanup_surviving_young_words(); + + if (g1_policy()->in_young_gc_mode()) { + _young_list->reset_sampled_info(); + assert(check_young_list_empty(true), + "young list should be empty"); + +#if SCAN_ONLY_VERBOSE + _young_list->print(); +#endif // SCAN_ONLY_VERBOSE + + g1_policy()->record_survivor_regions(_young_list->survivor_length(), + _young_list->first_survivor_region(), + _young_list->last_survivor_region()); + _young_list->reset_auxilary_lists(); + } + } else { + COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); + } + + if (evacuation_failed()) { + _summary_bytes_used = recalculate_used(); + } else { + // The "used" of the the collection set have already been subtracted + // when they were freed. Add in the bytes evacuated. + _summary_bytes_used += g1_policy()->bytes_in_to_space(); + } + + if (g1_policy()->in_young_gc_mode() && + g1_policy()->should_initiate_conc_mark()) { + concurrent_mark()->checkpointRootsInitialPost(); + set_marking_started(); + doConcurrentMark(); + } + +#if SCAN_ONLY_VERBOSE + _young_list->print(); +#endif // SCAN_ONLY_VERBOSE + + double end_time_sec = os::elapsedTime(); + double pause_time_ms = (end_time_sec - start_time_sec) * MILLIUNITS; + g1_policy()->record_pause_time_ms(pause_time_ms); + GCOverheadReporter::recordSTWEnd(end_time_sec); + g1_policy()->record_collection_pause_end(abandoned); + + assert(regions_accounted_for(), "Region leakage."); + + if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { + HandleMark hm; // Discard invalid handles created during verification + gclog_or_tty->print(" VerifyAfterGC:"); + prepare_for_verify(); + Universe::verify(false); + } + + if (was_enabled) ref_processor()->enable_discovery(); + + { + size_t expand_bytes = g1_policy()->expansion_amount(); + if (expand_bytes > 0) { + size_t bytes_before = capacity(); + expand(expand_bytes); + } + } + + if (mark_in_progress()) { + concurrent_mark()->update_g1_committed(); + } + +#ifdef TRACESPINNING + ParallelTaskTerminator::print_termination_counts(); +#endif + + gc_epilogue(false); + } + + assert(verify_region_lists(), "Bad region lists."); + + if (ExitAfterGCNum > 0 && total_collections() == ExitAfterGCNum) { + gclog_or_tty->print_cr("Stopping after GC #%d", ExitAfterGCNum); + print_tracing_info(); + vm_exit(-1); + } } - assert(verify_region_lists(), "Bad region lists."); - - if (ExitAfterGCNum > 0 && total_collections() == ExitAfterGCNum) { - gclog_or_tty->print_cr("Stopping after GC #%d", ExitAfterGCNum); - print_tracing_info(); - vm_exit(-1); + if (PrintHeapAtGC) { + Universe::print_heap_after_gc(); } } @@ -5357,7 +5392,7 @@ void G1CollectedHeap::tear_down_region_lists() { assert(_free_region_list == NULL, "Postcondition of loop."); if (_free_region_list_size != 0) { gclog_or_tty->print_cr("Size is %d.", _free_region_list_size); - print(); + print_on(gclog_or_tty, true /* extended */); } assert(_free_region_list_size == 0, "Postconditions of loop."); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index bc68d7f7804..82cfc8488f3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -1061,8 +1061,14 @@ public: // Override; it uses the "prev" marking information virtual void verify(bool allow_dirty, bool silent); + // Default behavior by calling print(tty); virtual void print() const; + // This calls print_on(st, PrintHeapAtGCExtended). virtual void print_on(outputStream* st) const; + // If extended is true, it will print out information for all + // regions in the heap by calling print_on_extended(st). + virtual void print_on(outputStream* st, bool extended) const; + virtual void print_on_extended(outputStream* st) const; virtual void print_gc_threads_on(outputStream* st) const; virtual void gc_threads_do(ThreadClosure* tc) const; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp index 8b8927571a8..8fa4ef4a8a1 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @@ -1097,6 +1097,10 @@ public: _recorded_survivor_tail = tail; } + size_t recorded_survivor_regions() { + return _recorded_survivor_regions; + } + void record_thread_age_table(ageTable* age_table) { _survivors_age_table.merge_par(age_table); diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index b844b2e70be..43af2b52cb7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -703,7 +703,7 @@ void HeapRegion::verify(bool allow_dirty, bool use_prev_marking) const { } if (vl_cl.failures()) { gclog_or_tty->print_cr("Heap:"); - G1CollectedHeap::heap()->print(); + G1CollectedHeap::heap()->print_on(gclog_or_tty, true /* extended */); gclog_or_tty->print_cr(""); } if (VerifyDuringGC && diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 85d55ea382a..781bc93aae5 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1994,6 +1994,10 @@ class CommandLineFlags { product_rw(bool, PrintHeapAtGC, false, \ "Print heap layout before and after each GC") \ \ + product_rw(bool, PrintHeapAtGCExtended, false, \ + "Prints extended information about the layout of the heap " \ + "when -XX:+PrintHeapAtGC is set") \ + \ product(bool, PrintHeapAtSIGBREAK, true, \ "Print heap layout in response to SIGBREAK") \ \ From 21aa3652d44605eb6a91fcfddc1d206398295503 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 7 Jul 2009 16:12:34 -0700 Subject: [PATCH 30/91] 6857803: Missing links to exceptions in javadoc for Class.getGeneric{Superclass, Interfaces} Reviewed-by: chegar --- jdk/src/share/classes/java/lang/Class.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index 4ba497c64cf..ddf57631790 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -627,7 +627,7 @@ public final * * @return an array of {@code TypeVariable} objects that represent * the type variables declared by this generic declaration - * @throws GenericSignatureFormatError if the generic + * @throws java.lang.reflect.GenericSignatureFormatError if the generic * signature of this generic declaration does not conform to * the format specified in the Java Virtual Machine Specification, * 3rd edition @@ -673,12 +673,12 @@ public final * {@code Class} object representing the {@code Object} class is * returned. * - * @throws GenericSignatureFormatError if the generic + * @throws java.lang.reflect.GenericSignatureFormatError if the generic * class signature does not conform to the format specified in the * Java Virtual Machine Specification, 3rd edition * @throws TypeNotPresentException if the generic superclass * refers to a non-existent type declaration - * @throws MalformedParameterizedTypeException if the + * @throws java.lang.reflect.MalformedParameterizedTypeException if the * generic superclass refers to a parameterized type that cannot be * instantiated for any reason * @return the superclass of the class represented by this object @@ -795,14 +795,14 @@ public final *

    If this object represents a primitive type or void, the * method returns an array of length 0. * - * @throws GenericSignatureFormatError + * @throws java.lang.reflect.GenericSignatureFormatError * if the generic class signature does not conform to the format * specified in the Java Virtual Machine Specification, 3rd edition * @throws TypeNotPresentException if any of the generic * superinterfaces refers to a non-existent type declaration - * @throws MalformedParameterizedTypeException if any of the - * generic superinterfaces refer to a parameterized type that cannot - * be instantiated for any reason + * @throws java.lang.reflect.MalformedParameterizedTypeException + * if any of the generic superinterfaces refer to a parameterized + * type that cannot be instantiated for any reason * @return an array of interfaces implemented by this class * @since 1.5 */ From 96a8d1a9f8805de2786eee08b3352b49a6dacb16 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 8 Jul 2009 12:07:16 +0800 Subject: [PATCH 31/91] 6857802: GSS getRemainingInitLifetime method returns milliseconds not seconds Reviewed-by: xuelei --- .../jgss/krb5/Krb5InitCredential.java | 2 +- .../security/krb5/auto/LifeTimeInSeconds.java | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 jdk/test/sun/security/krb5/auto/LifeTimeInSeconds.java diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java index 1aac87223e1..4718f57e7d3 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java @@ -238,7 +238,7 @@ public class Krb5InitCredential retVal = (int)(getEndTime().getTime() - (new Date().getTime())); - return retVal; + return retVal/1000; } /** diff --git a/jdk/test/sun/security/krb5/auto/LifeTimeInSeconds.java b/jdk/test/sun/security/krb5/auto/LifeTimeInSeconds.java new file mode 100644 index 00000000000..2d20fc415bb --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/LifeTimeInSeconds.java @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6857802 + * @summary GSS getRemainingInitLifetime method returns milliseconds not seconds + */ +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSManager; + +public class LifeTimeInSeconds { + public static void main(String[] args) throws Exception { + new OneKDC(null).writeJAASConf(); + System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); + + GSSManager gm = GSSManager.getInstance(); + GSSCredential cred = gm.createCredential(GSSCredential.INITIATE_AND_ACCEPT); + int time = cred.getRemainingLifetime(); + int time2 = cred.getRemainingInitLifetime(null); + // The test KDC issues a TGT with a default lifetime of 11 hours + int elevenhrs = 11*3600; + if (time > elevenhrs+60 || time < elevenhrs-60) { + throw new Exception("getRemainingLifetime returns wrong value."); + } + if (time2 > elevenhrs+60 || time2 < elevenhrs-60) { + throw new Exception("getRemainingInitLifetime returns wrong value."); + } + } +} From 9148ed61cfd3c9f22826249ea3639e90e23c73ab Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 8 Jul 2009 12:07:43 +0800 Subject: [PATCH 32/91] 6857795: krb5.conf ignored if system properties on realm and kdc are provided Reviewed-by: xuelei --- .../classes/sun/security/krb5/Config.java | 35 ++++--- jdk/test/sun/security/krb5/ConfPlusProp.java | 94 +++++++++++++++++++ jdk/test/sun/security/krb5/confplusprop.conf | 11 +++ jdk/test/sun/security/krb5/confplusprop2.conf | 7 ++ 4 files changed, 133 insertions(+), 14 deletions(-) create mode 100644 jdk/test/sun/security/krb5/ConfPlusProp.java create mode 100644 jdk/test/sun/security/krb5/confplusprop.conf create mode 100644 jdk/test/sun/security/krb5/confplusprop2.conf diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java index e036776f53e..8adcba81f53 100644 --- a/jdk/src/share/classes/sun/security/krb5/Config.java +++ b/jdk/src/share/classes/sun/security/krb5/Config.java @@ -123,7 +123,7 @@ public class Config { java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction ("java.security.krb5.kdc")); - defaultRealm = + defaultRealm = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction ("java.security.krb5.realm")); @@ -134,6 +134,16 @@ public class Config { "java.security.krb5.realm both must be set or " + "neither must be set."); } + + // Read the Kerberos configuration file + try { + Vector configFile; + configFile = loadConfigFile(); + stanzaTable = parseStanzaTable(configFile); + } catch (IOException ioe) { + // No krb5.conf, no problem. We'll use DNS etc. + } + if (kdchost != null) { /* * If configuration information is only specified by @@ -141,22 +151,19 @@ public class Config { * java.security.krb5.realm, we put both in the hashtable * under [libdefaults]. */ - Hashtable kdcs = new Hashtable (); + if (stanzaTable == null) { + stanzaTable = new Hashtable (); + } + Hashtable kdcs = + (Hashtable)stanzaTable.get("libdefaults"); + if (kdcs == null) { + kdcs = new Hashtable (); + stanzaTable.put("libdefaults", kdcs); + } kdcs.put("default_realm", defaultRealm); // The user can specify a list of kdc hosts separated by ":" kdchost = kdchost.replace(':', ' '); kdcs.put("kdc", kdchost); - stanzaTable = new Hashtable (); - stanzaTable.put("libdefaults", kdcs); - } else { - // Read the Kerberos configuration file - try { - Vector configFile; - configFile = loadConfigFile(); - stanzaTable = parseStanzaTable(configFile); - } catch (IOException ioe) { - // No krb5.conf, no problem. We'll use DNS etc. - } } } @@ -294,7 +301,7 @@ public class Config { * hashtable. */ if (name.equalsIgnoreCase("kdc") && - (!section.equalsIgnoreCase("libdefaults")) && + (section.equalsIgnoreCase(getDefault("default_realm", "libdefaults"))) && (java.security.AccessController.doPrivileged( new sun.security.action. GetPropertyAction("java.security.krb5.kdc")) != null)) { diff --git a/jdk/test/sun/security/krb5/ConfPlusProp.java b/jdk/test/sun/security/krb5/ConfPlusProp.java new file mode 100644 index 00000000000..b1ea2ca5e75 --- /dev/null +++ b/jdk/test/sun/security/krb5/ConfPlusProp.java @@ -0,0 +1,94 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +/* + * @test + * @bug 6857795 + * @summary krb5.conf ignored if system properties on realm and kdc are provided + */ + +import sun.security.krb5.Config; +import sun.security.krb5.KrbException; + +public class ConfPlusProp { + public static void main(String[] args) throws Exception { + System.setProperty("java.security.krb5.realm", "R2"); + System.setProperty("java.security.krb5.kdc", "k2"); + + // Point to a file with existing default_realm + System.setProperty("java.security.krb5.conf", + System.getProperty("test.src", ".") +"/confplusprop.conf"); + Config config = Config.getInstance(); + + if (!config.getDefaultRealm().equals("R2")) { + throw new Exception("Default realm error"); + } + if (!config.getKDCList("R1").equals("k1")) { + throw new Exception("R1 kdc error"); + } + if (!config.getKDCList("R2").equals("k2")) { + throw new Exception("R2 kdc error"); + } + if (!config.getDefault("forwardable", "libdefaults").equals("well")) { + throw new Exception("Extra config error"); + } + + // Point to a file with no libdefaults + System.setProperty("java.security.krb5.conf", + System.getProperty("test.src", ".") +"/confplusprop2.conf"); + Config.refresh(); + + config = Config.getInstance(); + + if (!config.getDefaultRealm().equals("R2")) { + throw new Exception("Default realm error again"); + } + if (!config.getKDCList("R1").equals("k12")) { + throw new Exception("R1 kdc error"); + } + if (!config.getKDCList("R2").equals("k2")) { + throw new Exception("R2 kdc error"); + } + + // Point to a non-existing file + System.setProperty("java.security.krb5.conf", "i-am-not-a file"); + Config.refresh(); + + config = Config.getInstance(); + + if (!config.getDefaultRealm().equals("R2")) { + throw new Exception("Default realm error"); + } + try { + config.getKDCList("R1"); + throw new Exception("R1 is nowhere"); + } catch (KrbException ke) { + // OK + } + if (!config.getKDCList("R2").equals("k2")) { + throw new Exception("R2 kdc error"); + } + if (config.getDefault("forwardable", "libdefaults") != null) { + throw new Exception("Extra config error"); + } + } +} diff --git a/jdk/test/sun/security/krb5/confplusprop.conf b/jdk/test/sun/security/krb5/confplusprop.conf new file mode 100644 index 00000000000..80c925b14cd --- /dev/null +++ b/jdk/test/sun/security/krb5/confplusprop.conf @@ -0,0 +1,11 @@ +[libdefaults] +default_realm = R1 +forwardable = well + +[realms] +R1 = { + kdc = k1 +} +R2 = { + kdc = old +} diff --git a/jdk/test/sun/security/krb5/confplusprop2.conf b/jdk/test/sun/security/krb5/confplusprop2.conf new file mode 100644 index 00000000000..df00eccbccf --- /dev/null +++ b/jdk/test/sun/security/krb5/confplusprop2.conf @@ -0,0 +1,7 @@ +[realms] +R1 = { + kdc = k12 +} +R2 = { + kdc = old +} From 529e9065c2026ba0d359af78d1b8f0c6d0596371 Mon Sep 17 00:00:00 2001 From: Kelly O'Hair Date: Wed, 8 Jul 2009 09:11:24 -0700 Subject: [PATCH 33/91] 6858127: Missing -DNDEBUG on Linux and Windows native code compiles Reviewed-by: tbell, dcubed --- jdk/make/common/Defs-linux.gmk | 2 +- jdk/make/common/Defs-windows.gmk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/make/common/Defs-linux.gmk b/jdk/make/common/Defs-linux.gmk index 672affde32b..424eaf0a7db 100644 --- a/jdk/make/common/Defs-linux.gmk +++ b/jdk/make/common/Defs-linux.gmk @@ -193,7 +193,7 @@ ifeq ($(ARCH_DATA_MODEL), 64) CPPFLAGS_COMMON += -D_LP64=1 endif -CPPFLAGS_OPT = +CPPFLAGS_OPT = -DNDEBUG CPPFLAGS_DBG = -DDEBUG ifneq ($(PRODUCT), java) CPPFLAGS_DBG += -DLOGGING diff --git a/jdk/make/common/Defs-windows.gmk b/jdk/make/common/Defs-windows.gmk index 00b8ea71e2a..0c220107df2 100644 --- a/jdk/make/common/Defs-windows.gmk +++ b/jdk/make/common/Defs-windows.gmk @@ -363,7 +363,7 @@ ifeq ($(COMPILER_WARNINGS_FATAL),true) CFLAGS_COMMON += -WX endif -CPPFLAGS_OPT = +CPPFLAGS_OPT = -DNDEBUG CPPFLAGS_DBG = -DDEBUG -DLOGGING CXXFLAGS_COMMON = $(CFLAGS_COMMON) From 64697c3e7ac7741b9b62373bcca0fcb5a08e730d Mon Sep 17 00:00:00 2001 From: Kelly O'Hair Date: Wed, 8 Jul 2009 09:12:17 -0700 Subject: [PATCH 34/91] 6855551: java -Xrunhprof crashes when running with classes compiled with targed=7 Reviewed-by: tbell, dcubed --- jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c | 4 ++-- jdk/test/demo/jvmti/hprof/HelloWorld.java | 2 +- jdk/test/demo/jvmti/hprof/StackMapTableTest.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c b/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c index 6d43d9baa90..d241e80dafa 100644 --- a/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c +++ b/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c @@ -263,8 +263,8 @@ assert_error(CrwClassImage *ci, const char *condition, (void)sprintf(buf, "CRW ASSERTION FAILURE: %s (%s:%s:%d)", condition, - ci->name==0?"?":ci->name, - mi->name==0?"?":mi->name, + ci->name==NULL?"?":ci->name, + (mi==NULL||mi->name==NULL)?"?":mi->name, byte_code_offset); fatal_error(ci, buf, file, line); } diff --git a/jdk/test/demo/jvmti/hprof/HelloWorld.java b/jdk/test/demo/jvmti/hprof/HelloWorld.java index e349bbd08e9..ae8ec5c1482 100644 --- a/jdk/test/demo/jvmti/hprof/HelloWorld.java +++ b/jdk/test/demo/jvmti/hprof/HelloWorld.java @@ -24,7 +24,7 @@ /* HelloWorld: * - * Sample target appluication for HPROF tests + * Sample target application for HPROF tests * */ diff --git a/jdk/test/demo/jvmti/hprof/StackMapTableTest.java b/jdk/test/demo/jvmti/hprof/StackMapTableTest.java index a34614dfccb..0acc6fe61dc 100644 --- a/jdk/test/demo/jvmti/hprof/StackMapTableTest.java +++ b/jdk/test/demo/jvmti/hprof/StackMapTableTest.java @@ -23,11 +23,11 @@ /* @test - * @bug 6266289 6299047 + * @bug 6266289 6299047 6855180 6855551 * @summary Test jvmti hprof and java_crw_demo with StackMapTable attributes * * @compile ../DemoRun.java - * @compile -source 1.6 -g:lines HelloWorld.java + * @compile -source 7 -g:lines HelloWorld.java * @build StackMapTableTest * @run main StackMapTableTest HelloWorld */ From 74d89957476c683d095d1d99325184e82b4cd1fc Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Thu, 9 Jul 2009 15:15:28 -0400 Subject: [PATCH 35/91] 6855323: Robot(GraphicsDevice) constructor initializes LEGAL_BUTTON_MASK variable improperly Reviewed-by: art --- jdk/src/share/classes/java/awt/Robot.java | 41 ++++++----- .../java/awt/Robot/CtorTest/CtorTest.java | 71 +++++++++++++++++++ 2 files changed, 94 insertions(+), 18 deletions(-) create mode 100644 jdk/test/java/awt/Robot/CtorTest/CtorTest.java diff --git a/jdk/src/share/classes/java/awt/Robot.java b/jdk/src/share/classes/java/awt/Robot.java index f7a40c740bc..1233c291a3e 100644 --- a/jdk/src/share/classes/java/awt/Robot.java +++ b/jdk/src/share/classes/java/awt/Robot.java @@ -70,7 +70,7 @@ public class Robot { private RobotPeer peer; private boolean isAutoWaitForIdle = false; private int autoDelay = 0; - private static int LEGAL_BUTTON_MASK; + private static int LEGAL_BUTTON_MASK = 0; // location of robot's GC, used in mouseMove(), getPixelColor() and captureScreenImage() private Point gdLoc; @@ -95,23 +95,6 @@ public class Robot { } init(GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice()); - int tmpMask = 0; - - if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ - if (Toolkit.getDefaultToolkit() instanceof SunToolkit) { - final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons(); - for (int i = 0; i < buttonsNumber; i++){ - tmpMask |= InputEvent.getMaskForButton(i+1); - } - } - } - tmpMask |= InputEvent.BUTTON1_MASK| - InputEvent.BUTTON2_MASK| - InputEvent.BUTTON3_MASK| - InputEvent.BUTTON1_DOWN_MASK| - InputEvent.BUTTON2_DOWN_MASK| - InputEvent.BUTTON3_DOWN_MASK; - LEGAL_BUTTON_MASK = tmpMask; } /** @@ -156,6 +139,28 @@ public class Robot { disposer = new RobotDisposer(peer); sun.java2d.Disposer.addRecord(anchor, disposer); } + initLegalButtonMask(); + } + + private static synchronized void initLegalButtonMask() { + if (LEGAL_BUTTON_MASK != 0) return; + + int tmpMask = 0; + if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + if (Toolkit.getDefaultToolkit() instanceof SunToolkit) { + final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons(); + for (int i = 0; i < buttonsNumber; i++){ + tmpMask |= InputEvent.getMaskForButton(i+1); + } + } + } + tmpMask |= InputEvent.BUTTON1_MASK| + InputEvent.BUTTON2_MASK| + InputEvent.BUTTON3_MASK| + InputEvent.BUTTON1_DOWN_MASK| + InputEvent.BUTTON2_DOWN_MASK| + InputEvent.BUTTON3_DOWN_MASK; + LEGAL_BUTTON_MASK = tmpMask; } /* determine if the security policy allows Robot's to be created */ diff --git a/jdk/test/java/awt/Robot/CtorTest/CtorTest.java b/jdk/test/java/awt/Robot/CtorTest/CtorTest.java new file mode 100644 index 00000000000..ea9c56fa2d5 --- /dev/null +++ b/jdk/test/java/awt/Robot/CtorTest/CtorTest.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + @test + @bug 6855323 + @summary Robot(GraphicsDevice) constructor initializes LEGAL_BUTTON_MASK variable improperly + @author Dmitry Cherepanov area=awt.robot + @run main CtorTest +*/ + +/** + * CtorRobot.java + * + * summary: creates Robot using one parameter constructor + */ + +import java.awt.*; +import java.awt.event.*; + +import sun.awt.SunToolkit; + +public class CtorTest +{ + public static void main(String []s) throws Exception + { + // one parameter constructor + GraphicsDevice graphicsDevice = GraphicsEnvironment. + getLocalGraphicsEnvironment().getDefaultScreenDevice(); + Robot robot = new Robot(graphicsDevice); + clickOnFrame(robot); + } + + // generate mouse events + private static void clickOnFrame(Robot robot) { + Frame frame = new Frame(); + frame.setBounds(100, 100, 100, 100); + frame.setVisible(true); + + ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + + // click in the middle of the frame + robot.mouseMove(150, 150); + robot.delay(50); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + + ((SunToolkit)Toolkit.getDefaultToolkit()).realSync(); + } +} From 4d337f68e85eda235757611ebc1dbadfe92da276 Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Thu, 9 Jul 2009 15:18:50 -0400 Subject: [PATCH 36/91] 6759726: TrayIcon constructor throws NPE instead of documented IAE Reviewed-by: art --- jdk/src/share/classes/java/awt/TrayIcon.java | 3 ++ .../java/awt/TrayIcon/CtorTest/CtorTest.java | 53 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 jdk/test/java/awt/TrayIcon/CtorTest/CtorTest.java diff --git a/jdk/src/share/classes/java/awt/TrayIcon.java b/jdk/src/share/classes/java/awt/TrayIcon.java index 9fcdd2a6af1..e0c31f8c3ee 100644 --- a/jdk/src/share/classes/java/awt/TrayIcon.java +++ b/jdk/src/share/classes/java/awt/TrayIcon.java @@ -143,6 +143,9 @@ public class TrayIcon { */ public TrayIcon(Image image) { this(); + if (image == null) { + throw new IllegalArgumentException("creating TrayIcon with null Image"); + } setImage(image); } diff --git a/jdk/test/java/awt/TrayIcon/CtorTest/CtorTest.java b/jdk/test/java/awt/TrayIcon/CtorTest/CtorTest.java new file mode 100644 index 00000000000..d16034a1a01 --- /dev/null +++ b/jdk/test/java/awt/TrayIcon/CtorTest/CtorTest.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + @test + @bug 6759726 + @summary TrayIcon constructor throws NPE instead of documented IAE + @author Dmitry Cherepanov area=awt.tray + @run main CtorTest +*/ + +/** + * CtorTest.java + * + * summary: TrayIcon ctor throws IAE if image is null + */ + +import java.awt.*; + +public class CtorTest +{ + public static void main(String []s) + { + boolean isSupported = SystemTray.isSupported(); + if (isSupported) { + try { + TrayIcon tray = new TrayIcon(null); + } catch(IllegalArgumentException e) { + // ctor should throw IAE + } + } + } +} From cd90c35e8f20b3b53ed9ed87d480c501aa6750c3 Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Thu, 9 Jul 2009 15:23:22 -0400 Subject: [PATCH 37/91] 6847958: MouseWheel event is getting triggered for the disabled Textarea in jdk7 b60 pit build Reviewed-by: art --- .../classes/sun/awt/X11/XBaseWindow.java | 5 +- .../DisabledComponent/DisabledComponent.java | 107 ++++++++++++++++++ 2 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 jdk/test/java/awt/event/MouseWheelEvent/DisabledComponent/DisabledComponent.java diff --git a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java index 07a4fc7c265..0cd25523538 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java @@ -1000,10 +1000,7 @@ public class XBaseWindow { int buttonState = 0; final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons(); for (int i = 0; i Date: Thu, 9 Jul 2009 15:53:07 +0400 Subject: [PATCH 38/91] 6847149: test/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java fails Reviewed-by: art --- jdk/test/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/test/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java b/jdk/test/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java index 44f43c1b3bf..dda735cb7f3 100644 --- a/jdk/test/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java +++ b/jdk/test/java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java @@ -65,6 +65,7 @@ public class OwnedWindowsLeak break; } } + garbage = null; // Third, make sure all the weak references are null for (WeakReference ref : children) From 40a7ea7c9c6ded29c0774c04f561698f5c163e43 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Thu, 9 Jul 2009 12:31:30 -0700 Subject: [PATCH 39/91] 6628737: Specification of wrapper class valueOf static factories should require caching Reviewed-by: mr --- jdk/src/share/classes/java/lang/Byte.java | 4 ++-- jdk/src/share/classes/java/lang/Character.java | 4 ++++ jdk/src/share/classes/java/lang/Integer.java | 3 +++ jdk/src/share/classes/java/lang/Long.java | 5 +++++ jdk/src/share/classes/java/lang/Short.java | 3 +++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/java/lang/Byte.java b/jdk/src/share/classes/java/lang/Byte.java index 2bb6480c539..ba7486377d6 100644 --- a/jdk/src/share/classes/java/lang/Byte.java +++ b/jdk/src/share/classes/java/lang/Byte.java @@ -90,8 +90,8 @@ public final class Byte extends Number implements Comparable { * If a new {@code Byte} instance is not required, this method * should generally be used in preference to the constructor * {@link #Byte(byte)}, as this method is likely to yield - * significantly better space and time performance by caching - * frequently requested values. + * significantly better space and time performance since + * all byte values are cached. * * @param b a byte value. * @return a {@code Byte} instance representing {@code b}. diff --git a/jdk/src/share/classes/java/lang/Character.java b/jdk/src/share/classes/java/lang/Character.java index e33052ee170..9b9c938fa1e 100644 --- a/jdk/src/share/classes/java/lang/Character.java +++ b/jdk/src/share/classes/java/lang/Character.java @@ -2571,6 +2571,10 @@ class Character extends Object implements java.io.Serializable, ComparableCharacter instance representing c. * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/Integer.java b/jdk/src/share/classes/java/lang/Integer.java index 50863dd7e9f..da35d2f7a4e 100644 --- a/jdk/src/share/classes/java/lang/Integer.java +++ b/jdk/src/share/classes/java/lang/Integer.java @@ -638,6 +638,9 @@ public final class Integer extends Number implements Comparable { * to yield significantly better space and time performance by * caching frequently requested values. * + * This method will always cache values in the range -128 to 127, + * inclusive, and may cache other values outside of this range. + * * @param i an {@code int} value. * @return an {@code Integer} instance representing {@code i}. * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java index c632d5df2d9..a2fe09c959d 100644 --- a/jdk/src/share/classes/java/lang/Long.java +++ b/jdk/src/share/classes/java/lang/Long.java @@ -560,6 +560,11 @@ public final class Long extends Number implements Comparable { * significantly better space and time performance by caching * frequently requested values. * + * Note that unlike the {@linkplain Integer#valueOf(int) + * corresponding method} in the {@code Integer} class, this method + * is not required to cache values within a particular + * range. + * * @param l a long value. * @return a {@code Long} instance representing {@code l}. * @since 1.5 diff --git a/jdk/src/share/classes/java/lang/Short.java b/jdk/src/share/classes/java/lang/Short.java index 8abbf65d61a..a5d72120dfb 100644 --- a/jdk/src/share/classes/java/lang/Short.java +++ b/jdk/src/share/classes/java/lang/Short.java @@ -219,6 +219,9 @@ public final class Short extends Number implements Comparable { * significantly better space and time performance by caching * frequently requested values. * + * This method will always cache values in the range -128 to 127, + * inclusive, and may cache other values outside of this range. + * * @param s a short value. * @return a {@code Short} instance representing {@code s}. * @since 1.5 From 5ba2fd7d33d98a75b94044fcdc0b099bd9d74ba3 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 10 Jul 2009 17:27:13 +0800 Subject: [PATCH 40/91] 6852744: PIT b61: PKI test suite fails because self signed certificates are beingrejected Make the builder aware of SKID/AKID, break the internal circular dependences Reviewed-by: mullan --- .../certpath/DistributionPointFetcher.java | 96 ++++- .../provider/certpath/ForwardBuilder.java | 176 +++++++- .../selfIssued/DisableRevocation.java | 260 ++++++++++++ .../selfIssued/KeyUsageMatters.java | 303 ++++++++++++++ .../cert/CertPathBuilder/selfIssued/README | 382 ++++++++++++++++++ .../selfIssued/StatusLoopDependency.java | 309 ++++++++++++++ .../CertPathBuilder/selfIssued/generate.sh | 221 ++++++++++ .../CertPathBuilder/selfIssued/openssl.cnf | 205 ++++++++++ 8 files changed, 1940 insertions(+), 12 deletions(-) create mode 100644 jdk/test/java/security/cert/CertPathBuilder/selfIssued/DisableRevocation.java create mode 100644 jdk/test/java/security/cert/CertPathBuilder/selfIssued/KeyUsageMatters.java create mode 100644 jdk/test/java/security/cert/CertPathBuilder/selfIssued/README create mode 100644 jdk/test/java/security/cert/CertPathBuilder/selfIssued/StatusLoopDependency.java create mode 100644 jdk/test/java/security/cert/CertPathBuilder/selfIssued/generate.sh create mode 100644 jdk/test/java/security/cert/CertPathBuilder/selfIssued/openssl.cnf diff --git a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java index 34f26f64a0f..39ee1f1dad6 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import javax.security.auth.x500.X500Principal; import sun.security.action.GetPropertyAction; import sun.security.util.Debug; +import sun.security.util.DerOutputStream; import sun.security.x509.*; /** @@ -333,7 +334,15 @@ class DistributionPointFetcher { if (match == false) { return false; } - indirectCRL = true; + + // we accept the case that a CRL issuer provide status + // information for itself. + if (ForwardBuilder.issues(certImpl, crlImpl, provider)) { + // reset the public key used to verify the CRL's signature + prevKey = certImpl.getPublicKey(); + } else { + indirectCRL = true; + } } else if (crlIssuer.equals(certIssuer) == false) { if (debug != null) { debug.println("crl issuer does not equal cert issuer"); @@ -347,7 +356,14 @@ class DistributionPointFetcher { PKIXExtensions.AuthorityKey_Id.toString()); if (!Arrays.equals(certAKID, crlAKID)) { - indirectCRL = true; + // we accept the case that a CRL issuer provide status + // information for itself. + if (ForwardBuilder.issues(certImpl, crlImpl, provider)) { + // reset the public key used to verify the CRL's signature + prevKey = certImpl.getPublicKey(); + } else { + indirectCRL = true; + } } } @@ -542,10 +558,80 @@ class DistributionPointFetcher { certSel.setSubject(crlIssuer.asX500Principal()); boolean[] crlSign = {false,false,false,false,false,false,true}; certSel.setKeyUsage(crlSign); + + // Currently by default, forward builder does not enable + // subject/authority key identifier identifying for target + // certificate, instead, it only compares the CRL issuer and + // the target certificate subject. If the certificate of the + // delegated CRL issuer is a self-issued certificate, the + // builder is unable to find the proper CRL issuer by issuer + // name only, there is a potential dead loop on finding the + // proper issuer. It is of great help to narrow the target + // scope down to aware of authority key identifiers in the + // selector, for the purposes of breaking the dead loop. + AuthorityKeyIdentifierExtension akidext = + crlImpl.getAuthKeyIdExtension(); + if (akidext != null) { + KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID); + if (akid != null) { + DerOutputStream derout = new DerOutputStream(); + derout.putOctetString(akid.getIdentifier()); + certSel.setSubjectKeyIdentifier(derout.toByteArray()); + } + + SerialNumber asn = + (SerialNumber)akidext.get(akidext.SERIAL_NUMBER); + if (asn != null) { + certSel.setSerialNumber(asn.getNumber()); + } + // the subject criterion will be set by builder automatically. + } + + // by far, we have validated the previous certificate, we can + // trust it during validating the CRL issuer. + // Except the performance improvement, another benefit is to break + // the dead loop while looking for the issuer back and forth + // between the delegated self-issued certificate and its issuer. + Set trustAnchors = new HashSet(); + if (anchor != null) { + trustAnchors.add(anchor); + } + + if (prevKey != null) { + // if the previous key is of the anchor, don't bother to + // duplicate the trust. + boolean duplicated = false; + PublicKey publicKey = prevKey; + X500Principal principal = certImpl.getIssuerX500Principal(); + + if (anchor != null) { + X509Certificate trustedCert = anchor.getTrustedCert(); + X500Principal trustedPrincipal; + PublicKey trustedPublicKey; + if (trustedCert != null) { + trustedPrincipal = trustedCert.getSubjectX500Principal(); + trustedPublicKey = trustedCert.getPublicKey(); + } else { + trustedPrincipal = anchor.getCA(); + trustedPublicKey = anchor.getCAPublicKey(); + } + + if (principal.equals(trustedPrincipal) && + publicKey.equals(trustedPublicKey)) { + duplicated = true; + } + } + + if (!duplicated) { + TrustAnchor temporary = + new TrustAnchor(principal, publicKey, null); + trustAnchors.add(temporary); + } + } + PKIXBuilderParameters params = null; try { - params = new PKIXBuilderParameters - (Collections.singleton(anchor), certSel); + params = new PKIXBuilderParameters(trustAnchors, certSel); } catch (InvalidAlgorithmParameterException iape) { throw new CRLException(iape); } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java index d8713cdcac4..393a7663c91 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ import java.util.*; import java.security.GeneralSecurityException; import java.security.InvalidKeyException; +import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertPathValidatorException; import java.security.cert.PKIXReason; @@ -43,12 +44,22 @@ import java.security.cert.X509CertSelector; import javax.security.auth.x500.X500Principal; import sun.security.util.Debug; +import sun.security.util.DerOutputStream; import sun.security.x509.AccessDescription; import sun.security.x509.AuthorityInfoAccessExtension; import sun.security.x509.PKIXExtensions; import sun.security.x509.PolicyMappingsExtension; import sun.security.x509.X500Name; import sun.security.x509.X509CertImpl; +import sun.security.x509.X509CRLImpl; +import sun.security.x509.AuthorityKeyIdentifierExtension; +import sun.security.x509.KeyIdentifier; +import sun.security.x509.SubjectKeyIdentifierExtension; +import sun.security.x509.SerialNumber; +import sun.security.x509.GeneralNames; +import sun.security.x509.GeneralName; +import sun.security.x509.GeneralNameInterface; +import java.math.BigInteger; /** * This class represents a forward builder, which is able to retrieve @@ -237,7 +248,7 @@ class ForwardBuilder extends Builder { } else { if (caSelector == null) { - caSelector = new X509CertSelector(); + caSelector = new AdaptableX509CertSelector(); /* * Match on certificate validity date. @@ -269,6 +280,29 @@ class ForwardBuilder extends Builder { * at least as many CA certs that have already been traversed */ caSelector.setBasicConstraints(currentState.traversedCACerts); + + /* + * Facilitate certification path construction with authority + * key identifier and subject key identifier. + */ + AuthorityKeyIdentifierExtension akidext = + currentState.cert.getAuthorityKeyIdentifierExtension(); + if (akidext != null) { + KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID); + if (akid != null) { + DerOutputStream derout = new DerOutputStream(); + derout.putOctetString(akid.getIdentifier()); + caSelector.setSubjectKeyIdentifier(derout.toByteArray()); + } + + SerialNumber asn = + (SerialNumber)akidext.get(akidext.SERIAL_NUMBER); + if (asn != null) { + caSelector.setSerialNumber(asn.getNumber()); + } + // the subject criterion was set previously. + } + sel = caSelector; } @@ -817,13 +851,25 @@ class ForwardBuilder extends Builder { } else { continue; } - } + } else { + X500Principal principal = anchor.getCA(); + java.security.PublicKey publicKey = anchor.getCAPublicKey(); - X500Principal trustedCAName = anchor.getCA(); + if (principal != null && publicKey != null && + principal.equals(cert.getSubjectX500Principal())) { + if (publicKey.equals(cert.getPublicKey())) { + // the cert itself is a trust anchor + this.trustAnchor = anchor; + return true; + } + // else, it is a self-issued certificate of the anchor + } - /* Check subject/issuer name chaining */ - if (!trustedCAName.equals(cert.getIssuerX500Principal())) { - continue; + // Check subject/issuer name chaining + if (principal == null || + !principal.equals(cert.getIssuerX500Principal())) { + continue; + } } /* Check revocation if it is enabled */ @@ -890,4 +936,120 @@ class ForwardBuilder extends Builder { void removeFinalCertFromPath(LinkedList certPathList) { certPathList.removeFirst(); } + + /** Verifies whether a CRL is issued by a certain certificate + * + * @param cert the certificate + * @param crl the CRL to be verified + * @param provider the name of the signature provider + */ + static boolean issues(X509CertImpl cert, X509CRLImpl crl, String provider) + throws IOException { + + boolean kidmatched = false; + + // check certificate's key usage + boolean[] usages = cert.getKeyUsage(); + if (usages != null && !usages[6]) { + return false; + } + + // check certificate's SKID and CRL's AKID + AuthorityKeyIdentifierExtension akidext = crl.getAuthKeyIdExtension(); + if (akidext != null) { + // the highest priority, matching KID + KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID); + if (akid != null) { + SubjectKeyIdentifierExtension skidext = + cert.getSubjectKeyIdentifierExtension(); + if (skidext != null) { + KeyIdentifier skid = + (KeyIdentifier)skidext.get(skidext.KEY_ID); + if (!akid.equals(skid)) { + return false; + } + + kidmatched = true; + } + // conservatively, in case of X509 V1 certificate, + // does return false here if no SKID extension. + } + + // the medium priority, matching issuer name/serial number + SerialNumber asn = (SerialNumber)akidext.get(akidext.SERIAL_NUMBER); + GeneralNames anames = (GeneralNames)akidext.get(akidext.AUTH_NAME); + if (asn != null && anames != null) { + X500Name subject = (X500Name)cert.getSubjectDN(); + BigInteger serial = cert.getSerialNumber(); + + if (serial != null && subject != null) { + if (serial.equals(asn.getNumber())) { + return false; + } + + for (GeneralName name : anames.names()) { + GeneralNameInterface gni = name.getName(); + if (subject.equals(gni)) { + return true; + } + } + } + + return false; + } + + if (kidmatched) { + return true; + } + } + + // the last priority, verify the CRL signature with the cert. + X500Principal crlIssuer = crl.getIssuerX500Principal(); + X500Principal certSubject = cert.getSubjectX500Principal(); + if (certSubject != null && certSubject.equals(crlIssuer)) { + try { + crl.verify(cert.getPublicKey(), provider); + return true; + } catch (Exception e) { + // ignore all exceptions. + } + } + + return false; + } + + /** + * An adaptable X509 certificate selector for forward certification path + * building. + */ + private static class AdaptableX509CertSelector extends X509CertSelector { + public AdaptableX509CertSelector() { + super(); + } + + /** + * Decides whether a Certificate should be selected. + * + * For the purpose of compatibility, when a certificate is of + * version 1 and version 2, or the certificate does not include + * a subject key identifier extension, the selection criterion + * of subjectKeyIdentifier will be disabled. + * + * @Override + */ + public boolean match(Certificate cert) { + if (!(cert instanceof X509Certificate)) { + return false; + } + X509Certificate xcert = (X509Certificate)cert; + + if (xcert.getVersion() < 3 || + xcert.getExtensionValue("2.5.29.14") == null) { + // disable the subjectKeyIdentifier criterion + setSubjectKeyIdentifier(null); + } + + return super.match(cert); + } + } } diff --git a/jdk/test/java/security/cert/CertPathBuilder/selfIssued/DisableRevocation.java b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/DisableRevocation.java new file mode 100644 index 00000000000..236ec77a4ab --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/DisableRevocation.java @@ -0,0 +1,260 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6852744 + * @summary PIT b61: PKI test suite fails because self signed certificates + * are being rejected + * @run main/othervm DisableRevocation subca + * @run main/othervm DisableRevocation subci + * @run main/othervm DisableRevocation alice + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.SocketException; +import java.util.*; +import java.security.Security; +import java.security.cert.*; +import java.security.cert.CertPathValidatorException.BasicReason; +import sun.security.util.DerInputStream; + +/** + * A test case helps to ensure that a certification path building process is + * able to identify a self-issued certificate from its issuer when disable + * revocation checking. + */ +public final class DisableRevocation { + + // the trust anchor + static String selfSignedCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICPjCCAaegAwIBAgIBADANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMThaFw0zMDA2MDgxMzMyMTha\n" + + "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" + + "AQUAA4GNADCBiQKBgQDInJhXi0655bPXAVkz1n5I6fAcZejzPnOPuwq3hU3OxFw8\n" + + "81Uf6o9oKI1h4w4XAD8u1cUNOgiX+wPwojronlp68bIfO6FVhNf287pLtLhNJo+7\n" + + "m6Qxw3ymFvEKy+PVj20CHSggdKHxUa4MBZBmHMFNBuxfYmjwzn+yTMmCCXOvSwID\n" + + "AQABo4GJMIGGMB0GA1UdDgQWBBSQ52Dpau+gtL+Kc31dusYnKj16ZTBHBgNVHSME\n" + + "QDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" + + "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw\n" + + "DQYJKoZIhvcNAQEEBQADgYEAjBt6ea65HCqbGsS2rs/HhlGusYXtThRVC5vwXSey\n" + + "ZFYwSgukuq1KDzckqZFu1meNImEwdZjwxdN0e2p/nVREPC42rZliSj6V1ThayKXj\n" + + "DWEZW1U5aR8T+3NYfDrdKcJGx4Hzfz0qKz1j4ssV1M9ptJxYYv4y2Da+592IN1S9\n" + + "v/E=\n" + + "-----END CERTIFICATE-----"; + + // the sub-ca + static String subCaCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICUDCCAbmgAwIBAgIBAzANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjRaFw0yOTAzMTUxMzMyMjRa\n" + + "MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz\n" + + "cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPFv24SK78VI0gWlyIrq/X\n" + + "srl1431K5hJJxMYZtaQunyPmrYg3oI9KvKFykxnR0N4XDPaIi75p9dXGppVu80BA\n" + + "+csvIPBwlBQoNmKDQWTziDOqfK4tE+IMuL/Y7pxnH6CDMY7VGpvatty2zcmH+m/v\n" + + "E/n+HPyeELJQT2rT/3T+7wIDAQABo4GJMIGGMB0GA1UdDgQWBBRidC8Dt3dBzYES\n" + + "KpR2tR560sZ0+zBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw\n" + + "HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw\n" + + "AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAMeMKqrMr5d3eTQsv\n" + + "MYOD15Dl3THQGLAa4ad5Eyq5/1eUeEOpztzCgDfi0iPD8YCubIEVasBTSqTiGXqb\n" + + "RpGuPHOwwfWvHrTeHSludiFBAUiKj7aEV+oQa0FBn4U4TT8HA62HQ93FhzTDI3jP\n" + + "iil34GktVl6gfMKGzUEW/Dh8OM4=\n" + + "-----END CERTIFICATE-----"; + + // a delegated CRL issuer, it's a self-issued certificate of trust anchor + static String topCrlIssuerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICPjCCAaegAwIBAgIBAjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjNaFw0yOTAzMTUxMzMyMjNa\n" + + "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" + + "AQUAA4GNADCBiQKBgQC99u93trf+WmpfiqunJy/P31ej1l4rESxft2JSGNjKuLFN\n" + + "/BO3SAugGJSkCARAwXjB0c8eeXhXWhVVWdNpbKepRJTxrjDfnFIavLgtUvmFwn/3\n" + + "hPXe+RQeA8+AJ99Y+o+10kY8JAZLa2j93C2FdmwOjUbo8aIz85yhbiV1tEDjLwID\n" + + "AQABo4GJMIGGMB0GA1UdDgQWBBSyFyA3XWLbdL6W6hksmBn7RKsQmDBHBgNVHSME\n" + + "QDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" + + "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw\n" + + "DQYJKoZIhvcNAQEEBQADgYEAHTm8aRTeakgCfEBCgSWK9wvMW1c18ANGMm8OFDBk\n" + + "xabVy9BT0MVFHlaneh89oIxTZN0FMTpg21GZMAvIzhEt7DGdO7HLsW7JniN7/OZ0\n" + + "rACmpK5frmZrLS03zUm8c+rTbazNfYLoZVG3/mDZbKIi+4y8IGnFcgLVsHsYoBNP\n" + + "G0c=\n" + + "-----END CERTIFICATE-----"; + + // a delegated CRL issuer, it's a self-issued certificate of sub-ca + static String subCrlIssuerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICUDCCAbmgAwIBAgIBBDANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjdaFw0yOTAzMTUxMzMyMjda\n" + + "MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz\n" + + "cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+8AcLJtGAVUWvv3ifcyQw\n" + + "OGqwzcPrBw/XCs6vTMlcdtFzcH1M+Z3/QHN9+5VT1gqeTIZ+b8g9005Og3XKy/HX\n" + + "obXZeLv20VZsr+jm52ySghEYOVCTJ9OyFOAp5adp6nf0cA66Feh3LsmVhpTEcDOG\n" + + "GnyntQm0DBYxRoOT/GBlvQIDAQABo4GJMIGGMB0GA1UdDgQWBBSRWhMuZLQoHSDN\n" + + "xhxr+vdDmfAY8jBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw\n" + + "HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw\n" + + "AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAMIDZLdOLFiPyS1bh\n" + + "Ch4eUYHT+K1WG93skbga3kVYg3GSe+gctwkKwKK13bwfi8zc7wwz6MtmQwEYhppc\n" + + "pKKKEwi5QirBCP54rihLCvRQaj6ZqUJ6VP+zPAqHYMDbzlBbHtVF/1lQUP30I6SV\n" + + "Fu987DvLmZ2GuQA9FKJsnlD9pbU=\n" + + "-----END CERTIFICATE-----"; + + // the target EE certificate + static String targetCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICNzCCAaCgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMTAeFw0wOTA2MjgxMzMy\n" + + "MzBaFw0yOTAzMTUxMzMyMzBaMEExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFt\n" + + "cGxlMRAwDgYDVQQLEwdDbGFzcy0xMQ4wDAYDVQQDEwVBbGljZTCBnzANBgkqhkiG\n" + + "9w0BAQEFAAOBjQAwgYkCgYEA7wnsvR4XEOfVznf40l8ClLod+7L0y2/+smVV+GM/\n" + + "T1/QF/stajAJxXNy08gK00WKZ6ruTHhR9vh/Z6+EQM2RZDCpU0A7LPa3kLE/XTmS\n" + + "1MLDu8ntkdlpURpvhdDWem+rl2HU5oZgzV8Jkcov9vXuSjqEDfr45FlPuV40T8+7\n" + + "cxsCAwEAAaNPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSBwsAhi6Z1kriOs3ty\n" + + "uSIujv9a3DAfBgNVHSMEGDAWgBRidC8Dt3dBzYESKpR2tR560sZ0+zANBgkqhkiG\n" + + "9w0BAQQFAAOBgQDEiBqd5AMy2SQopFaS3dYkzj8MHlwtbCSoNVYkOfDnewcatrbk\n" + + "yFcp6FX++PMdOQFHWvvnDdkCUAzZQp8kCkF9tGLVLBtOK7XxQ1us1LZym7kOPzsd\n" + + "G93Dcf0U1JRO77juc61Br5paAy8Bok18Y/MeG7uKgB2MAEJYKhGKbCrfMw==\n" + + "-----END CERTIFICATE-----"; + + private static Set generateTrustAnchors() + throws CertificateException { + // generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is = + new ByteArrayInputStream(selfSignedCertStr.getBytes()); + Certificate selfSignedCert = cf.generateCertificate(is); + + // generate a trust anchor + TrustAnchor anchor = + new TrustAnchor((X509Certificate)selfSignedCert, null); + + return Collections.singleton(anchor); + } + + private static CertStore generateCertificateStore() throws Exception { + Collection entries = new HashSet(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is; + + is = new ByteArrayInputStream(targetCertStr.getBytes()); + Certificate cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(selfSignedCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(topCrlIssuerCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + return CertStore.getInstance("Collection", + new CollectionCertStoreParameters(entries)); + } + + private static X509CertSelector generateSelector(String name) + throws Exception { + X509CertSelector selector = new X509CertSelector(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = null; + if (name.equals("subca")) { + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + } else if (name.equals("subci")) { + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + } else { + is = new ByteArrayInputStream(targetCertStr.getBytes()); + } + + X509Certificate target = (X509Certificate)cf.generateCertificate(is); + byte[] extVal = target.getExtensionValue("2.5.29.14"); + if (extVal != null) { + DerInputStream in = new DerInputStream(extVal); + byte[] subjectKID = in.getOctetString(); + selector.setSubjectKeyIdentifier(subjectKID); + } else { + // unlikely to happen. + throw new Exception("unexpected certificate: no SKID extension"); + } + + return selector; + } + + private static boolean match(String name, Certificate cert) + throws Exception { + X509CertSelector selector = new X509CertSelector(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = null; + if (name.equals("subca")) { + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + } else if (name.equals("subci")) { + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + } else { + is = new ByteArrayInputStream(targetCertStr.getBytes()); + } + X509Certificate target = (X509Certificate)cf.generateCertificate(is); + + return target.equals(cert); + } + + + public static void main(String[] args) throws Exception { + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); + + X509CertSelector selector = generateSelector(args[0]); + + Set anchors = generateTrustAnchors(); + CertStore certs = generateCertificateStore(); + + + PKIXBuilderParameters params = + new PKIXBuilderParameters(anchors, selector); + params.addCertStore(certs); + params.setRevocationEnabled(false); + params.setDate(new Date(109, 7, 1)); // 2009-07-01 + Security.setProperty("ocsp.enable", "false"); + System.setProperty("com.sun.security.enableCRLDP", "false"); + + PKIXCertPathBuilderResult result = + (PKIXCertPathBuilderResult)builder.build(params); + + if (!match(args[0], result.getCertPath().getCertificates().get(0))) { + throw new Exception("unexpected certificate"); + } + } +} diff --git a/jdk/test/java/security/cert/CertPathBuilder/selfIssued/KeyUsageMatters.java b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/KeyUsageMatters.java new file mode 100644 index 00000000000..af977c3d8d2 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/KeyUsageMatters.java @@ -0,0 +1,303 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6852744 + * @summary PIT b61: PKI test suite fails because self signed certificates + * are being rejected + * @run main/othervm KeyUsageMatters subca + * @run main/othervm KeyUsageMatters subci + * @run main/othervm KeyUsageMatters alice + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.SocketException; +import java.util.*; +import java.security.Security; +import java.security.cert.*; +import java.security.cert.CertPathValidatorException.BasicReason; +import sun.security.util.DerInputStream; + +/** + * KeyUsage extension plays a important rule during looking for the issuer + * of a certificate or CRL. A certificate issuer should have the keyCertSign + * bit set, and a CRL issuer should have the cRLSign bit set. + * + * Sometime, a delegated CRL issuer would also have the keyCertSign bit set, + * as would be troublesome to find the proper CRL issuer during certificate + * path build if the delegated CRL issuer is a self-issued certificate, for + * it is hard to identify it from its issuer by the "issuer" field only. + * + * The fix of 6852744 should addresses above issue, and allow a delegated CRL + * issuer to have keyCertSign bit set. + * + * In the test case, the delegated CRL issuers have cRLSign bit set only, and + * the CAs have the keyCertSign bit set only, it is expected to work before + * and after the bug fix of 6852744. + */ +public final class KeyUsageMatters { + + // the trust anchor + static String selfSignedCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICPjCCAaegAwIBAgIBADANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzJaFw0zMDA0MDcwMjI0MzJa\n" + + "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" + + "AQUAA4GNADCBiQKBgQC4OTag24sTxL2tXTNuvpmUEtdxrYAZoFsslFQ60T+WD9wQ\n" + + "Jeiw87FSPsR2vxRuv0j8DNm2a4h7LNNIFcLurfNldbz5pvgZ7VqdbbUMPE9qP85n\n" + + "jgDl4woyRTSUeRI4A7O0CO6NpES21dtbdhroWQrEkHxpnrDPxsxrz5gf2m3gqwID\n" + + "AQABo4GJMIGGMB0GA1UdDgQWBBSCJd0hpl5PdAD9IZS+Hzng4lXLGzBHBgNVHSME\n" + + "QDA+gBSCJd0hpl5PdAD9IZS+Hzng4lXLG6EjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" + + "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAgQw\n" + + "DQYJKoZIhvcNAQEEBQADgYEAluy6HIjWcq009lTLmhp+Np6dxU78pInBK8RZkza0\n" + + "484qGaxFGD3UGyZkI5uWmsH2XuMbuox5khfIq6781gmkPBHXBIEtJN8eLusOHEye\n" + + "iE8h7WI+N3qa6Pj56WionMrioqC/3X+b06o147bbhx8U0vkYv/HyPaITOFfMXTdz\n" + + "Vjw=\n" + + "-----END CERTIFICATE-----"; + + // the sub-ca + static String subCaCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICUDCCAbmgAwIBAgIBAzANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzRaFw0yOTAxMTIwMjI0MzRa\n" + + "MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz\n" + + "cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiAJnAQW2ad3ZMKUhSJVZj\n" + + "8pBqxTcHSTwAVguQkDglsN/OIwUpvR5Jgp3lpRWUEt6idEp0FZzORpvtjt3pr5MG\n" + + "Eg2CDptekC5BSPS+fIAIKlncB3HwOiFFhH6b3wTydDCdEd2fvsi4QMOSVrIYMeA8\n" + + "P/mCz6kRhfUQPE0CMmOUewIDAQABo4GJMIGGMB0GA1UdDgQWBBT0/nNP8WpyxmYr\n" + + "IBp4tN8y08jw2jBHBgNVHSMEQDA+gBSCJd0hpl5PdAD9IZS+Hzng4lXLG6EjpCEw\n" + + "HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw\n" + + "AwEB/zALBgNVHQ8EBAMCAgQwDQYJKoZIhvcNAQEEBQADgYEAS9PzI6B39R/U9fRj\n" + + "UExzN1FXNP5awnAPtiv34kSCL6n6MryqkfG+8aaAOdZsSjmTylNFaF7cW/Xp1VBF\n" + + "hq0bg/SbEAbK7+UwL8GSC3crhULHLbh+1iFdVTEwxCw5YmB8ji3BaZ/WKW/PkjCZ\n" + + "7cXP6VDeZMG6oRQ4hbOcixoFPXo=\n" + + "-----END CERTIFICATE-----"; + + // a delegated CRL issuer, it's a self-issued certificate of trust anchor + static String topCrlIssuerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICKzCCAZSgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzNaFw0yOTAxMTIwMjI0MzNa\n" + + "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" + + "AQUAA4GNADCBiQKBgQDMJeBMBybHykI/YpwUJ4O9euqDSLb1kpWpceBS8TVqvgBC\n" + + "SgUJWtFZL0i6bdvF6mMdlbuBkGzhXqHiVAi96/zRLbUC9F8SMEJ6MuD+YhQ0ZFTQ\n" + + "atKy8zf8O9XzztelLJ26Gqb7QPV133WY3haAqHtCXOhEKkCN16NOYNC37DTaJwID\n" + + "AQABo3cwdTAdBgNVHQ4EFgQULXSWzXzUOIpOJpzbSCpW42IJUugwRwYDVR0jBEAw\n" + + "PoAUgiXdIaZeT3QA/SGUvh854OJVyxuhI6QhMB8xCzAJBgNVBAYTAlVTMRAwDgYD\n" + + "VQQKEwdFeGFtcGxlggEAMAsGA1UdDwQEAwIBAjANBgkqhkiG9w0BAQQFAAOBgQAY\n" + + "eMnf5AHSNlyUlzXk8o2S0h4gCuvKX6C3kFfKuZcWvFAbx4yQOWLS2s15/nzR4+AP\n" + + "FGX3lgJjROyAh7fGedTQK+NFWwkM2ag1g3hXktnlnT1qHohi0w31nVBJxXEDO/Ck\n" + + "uJTpJGt8XxxbFaw5v7cHy7XuTAeU/sekvjEiNHW00Q==\n" + + "-----END CERTIFICATE-----"; + + // a delegated CRL issuer, it's a self-issued certificate of sub-ca + static String subCrlIssuerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICPTCCAaagAwIBAgIBBDANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA0MjcwMjI0MzRaFw0yOTAxMTIwMjI0MzRa\n" + + "MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz\n" + + "cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWUtDQx2MB/7arDiquMJyd\n" + + "LWwSg6p8sg5z6wKrC1v47MT4DBhFX+0RUgTMUdQgYpgxGpczn+6y4zfV76064S0N\n" + + "4L/IQ+SunTW1w4yRGjB+xkyyJmWAqijG1nr+Dgkv5nxPI+9Er5lHcoVWVMEcvvRm\n" + + "6jIBQdldVlSgv+VgUnFm5wIDAQABo3cwdTAdBgNVHQ4EFgQUkV3Qqtk7gIot9n60\n" + + "jX6dloxrfMEwRwYDVR0jBEAwPoAUgiXdIaZeT3QA/SGUvh854OJVyxuhI6QhMB8x\n" + + "CzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlggEAMAsGA1UdDwQEAwIBAjAN\n" + + "BgkqhkiG9w0BAQQFAAOBgQADu4GM8EdmIKhC7FRvk5jF90zfvZ38wbXBzCjKI4jX\n" + + "QJrhne1bfyeNNm5c1w+VKidT+XzBzBGH7ZqYzoZmzRIfcbLKX2brEBKiukeeAyL3\n" + + "bctQtbp19tX+uu2dQberD188AAysKTkHcJUV+rRsTwVJ9vcYKxoRxKk8DhH7ZS3M\n" + + "rg==\n" + + "-----END CERTIFICATE-----"; + + // the target EE certificate + static String targetCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICNzCCAaCgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMTAeFw0wOTA0MjcwMjI0\n" + + "MzZaFw0yOTAxMTIwMjI0MzZaMEExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFt\n" + + "cGxlMRAwDgYDVQQLEwdDbGFzcy0xMQ4wDAYDVQQDEwVBbGljZTCBnzANBgkqhkiG\n" + + "9w0BAQEFAAOBjQAwgYkCgYEAvYSaU3oiE4Pxp/aUIXwMqOwSiWkZ+O3aTu13hRtK\n" + + "ZyR+Wtj63IuvaigAC4uC+zBypF93ThjwCzVR2qKDQaQzV8CLleO96gStt7Y+i3G2\n" + + "V3IUGgrVCqeK7N6nNYu0wW84sibcPqG/TIy0UoaQMqgB21xtRF+1DUVlFh4Z89X/\n" + + "pskCAwEAAaNPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSynMEdcal/e9TmvlNE\n" + + "4suXGA4+hjAfBgNVHSMEGDAWgBT0/nNP8WpyxmYrIBp4tN8y08jw2jANBgkqhkiG\n" + + "9w0BAQQFAAOBgQB/jru7E/+piSmUwByw5qbZsoQZVcgR97pd2TErNJpJMAX2oIHR\n" + + "wJH6w4NuYs27+fEAX7wK4whc6EUH/w1SI6o28F2rG6HqYQPPZ2E2WqwbBQL9nYE3\n" + + "Vfzu/G9axTUQXFbf90h80UErA+mZVxqc2xtymLuH0YEaMZImtRZ2MXHfXg==\n" + + "-----END CERTIFICATE-----"; + + // CRL issued by the delegated CRL issuer, topCrlIssuerCertStr + static String topCrlStr = + "-----BEGIN X509 CRL-----\n" + + "MIIBGzCBhQIBATANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQMA4GA1UE\n" + + "ChMHRXhhbXBsZRcNMDkwNDI3MDIzODA0WhcNMjgwNjI2MDIzODA0WjAiMCACAQUX\n" + + "DTA5MDQyNzAyMzgwMFowDDAKBgNVHRUEAwoBBKAOMAwwCgYDVR0UBAMCAQIwDQYJ\n" + + "KoZIhvcNAQEEBQADgYEAoarfzXEtw3ZDi4f9U8eSvRIipHSyxOrJC7HR/hM5VhmY\n" + + "CErChny6x9lBVg9s57tfD/P9PSzBLusCcHwHMAbMOEcTltVVKUWZnnbumpywlYyg\n" + + "oKLrE9+yCOkYUOpiRlz43/3vkEL5hjIKMcDSZnPKBZi1h16Yj2hPe9GMibNip54=\n" + + "-----END X509 CRL-----"; + + // CRL issued by the delegated CRL issuer, subCrlIssuerCertStr + static String subCrlStr = + "-----BEGIN X509 CRL-----\n" + + "MIIBLTCBlwIBATANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQMA4GA1UE\n" + + "ChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMRcNMDkwNDI3MDIzODA0WhcNMjgw\n" + + "NjI2MDIzODA0WjAiMCACAQQXDTA5MDQyNzAyMzgwMVowDDAKBgNVHRUEAwoBBKAO\n" + + "MAwwCgYDVR0UBAMCAQIwDQYJKoZIhvcNAQEEBQADgYEAeS+POqYEIHIIJcsLxuUr\n" + + "aJFzQ/ujH0QmnyMNEL3Uavyq4VQuAahF+w6aTPb5UBzms0uX8NAvD2vNoUJvmJOX\n" + + "nGKuq4Q1DFj82E7/9d25nXdWGOmFvFCRVO+St2Xe5n8CJuZNBiz388FDSIOiFSCa\n" + + "ARGr6Qu68MYGtLMC6ZqP3u0=\n" + + "-----END X509 CRL-----"; + + private static Set generateTrustAnchors() + throws CertificateException { + // generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is = + new ByteArrayInputStream(selfSignedCertStr.getBytes()); + Certificate selfSignedCert = cf.generateCertificate(is); + + // generate a trust anchor + TrustAnchor anchor = + new TrustAnchor((X509Certificate)selfSignedCert, null); + + return Collections.singleton(anchor); + } + + private static CertStore generateCertificateStore() throws Exception { + Collection entries = new HashSet(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is; + + is = new ByteArrayInputStream(targetCertStr.getBytes()); + Certificate cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(selfSignedCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(topCrlIssuerCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + // generate CRL from CRL string + is = new ByteArrayInputStream(topCrlStr.getBytes()); + Collection mixes = cf.generateCRLs(is); + entries.addAll(mixes); + + is = new ByteArrayInputStream(subCrlStr.getBytes()); + mixes = cf.generateCRLs(is); + entries.addAll(mixes); + + return CertStore.getInstance("Collection", + new CollectionCertStoreParameters(entries)); + } + + private static X509CertSelector generateSelector(String name) + throws Exception { + X509CertSelector selector = new X509CertSelector(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = null; + if (name.equals("subca")) { + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + } else if (name.equals("subci")) { + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + } else { + is = new ByteArrayInputStream(targetCertStr.getBytes()); + } + + X509Certificate target = (X509Certificate)cf.generateCertificate(is); + byte[] extVal = target.getExtensionValue("2.5.29.14"); + if (extVal != null) { + DerInputStream in = new DerInputStream(extVal); + byte[] subjectKID = in.getOctetString(); + selector.setSubjectKeyIdentifier(subjectKID); + } else { + // unlikely to happen. + throw new Exception("unexpected certificate: no SKID extension"); + } + + return selector; + } + + private static boolean match(String name, Certificate cert) + throws Exception { + X509CertSelector selector = new X509CertSelector(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = null; + if (name.equals("subca")) { + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + } else if (name.equals("subci")) { + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + } else { + is = new ByteArrayInputStream(targetCertStr.getBytes()); + } + X509Certificate target = (X509Certificate)cf.generateCertificate(is); + + return target.equals(cert); + } + + + public static void main(String[] args) throws Exception { + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); + + X509CertSelector selector = generateSelector(args[0]); + + Set anchors = generateTrustAnchors(); + CertStore certs = generateCertificateStore(); + + + PKIXBuilderParameters params = + new PKIXBuilderParameters(anchors, selector); + params.addCertStore(certs); + params.setRevocationEnabled(true); + params.setDate(new Date(109, 5, 1)); // 2009-05-01 + Security.setProperty("ocsp.enable", "false"); + System.setProperty("com.sun.security.enableCRLDP", "true"); + + PKIXCertPathBuilderResult result = + (PKIXCertPathBuilderResult)builder.build(params); + + if (!match(args[0], result.getCertPath().getCertificates().get(0))) { + throw new Exception("unexpected certificate"); + } + } +} diff --git a/jdk/test/java/security/cert/CertPathBuilder/selfIssued/README b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/README new file mode 100644 index 00000000000..b0c1d6e0255 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/README @@ -0,0 +1,382 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + Certificates and CRLs + +The certificates and CRLs used by KeyUsageMatters.java are copied from +test/java/security/cert/CertPathValidator/indirectCRL. + +Here lists the local generated certificates and CRLs used in the test cases. + +The generate.sh depends on openssl, and it should be run under ksh. The +script will create many directories and files, please run it in a +directory outside of JDK workspace. + +1. root certifiate and key +-----BEGIN CERTIFICATE----- +MIICPjCCAaegAwIBAgIBADANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMThaFw0zMDA2MDgxMzMyMTha +MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDInJhXi0655bPXAVkz1n5I6fAcZejzPnOPuwq3hU3OxFw8 +81Uf6o9oKI1h4w4XAD8u1cUNOgiX+wPwojronlp68bIfO6FVhNf287pLtLhNJo+7 +m6Qxw3ymFvEKy+PVj20CHSggdKHxUa4MBZBmHMFNBuxfYmjwzn+yTMmCCXOvSwID +AQABo4GJMIGGMB0GA1UdDgQWBBSQ52Dpau+gtL+Kc31dusYnKj16ZTBHBgNVHSME +QDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEwHzELMAkGA1UEBhMCVVMxEDAO +BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw +DQYJKoZIhvcNAQEEBQADgYEAjBt6ea65HCqbGsS2rs/HhlGusYXtThRVC5vwXSey +ZFYwSgukuq1KDzckqZFu1meNImEwdZjwxdN0e2p/nVREPC42rZliSj6V1ThayKXj +DWEZW1U5aR8T+3NYfDrdKcJGx4Hzfz0qKz1j4ssV1M9ptJxYYv4y2Da+592IN1S9 +v/E= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,46F13CECA9B38323 + +AVNWPH7jiPyJVq9KfL3IlGVCwD41KVapg12yJR2t/WWlLaKr19/0oWNvimcrd040 +txFKvcFO9TFLxmaco33+actCoL0K/XbrCBICThZLybzcFTuYFMum8eqL61avQgBe +Kt4CCjcupWLzKWkKTMV/bP6nPnPUSB9U8QeGwutjJYnLDi0TuYx8YSqZo/36vM98 +r3OvtcSA5XEN4guxxHusZJnhbclVb/Z1WtLVb4v2d5yBtPM2p3R0hK17L4Dnusjl +n56z6Z0AIYmfAggM/Fpge2uT3D/5n//l1lZRNoSvsX5UZipKswZKLpvx7IJ+AqgA +UO9lcmNLGnIXME3IS3smd83wPi7nxH3NCYWHbGAKLm6mkFMs5LOhofUMOBS3Rxmm +2RjCGtuzDxBPKveo9/Y80B//6sEce2gdi7fCKgWwtR4VFuJd0hWODD6CarK3edHH +rUG62Kt2aqiI/y/NLEbfHCHbyM37c9/OzS5Zy695dDl22r5EirVFsVgejQR1JGtP +ANdc6kkkJW+s6GiqimShssMTp1x0L8twT/+wEa38LafiaPKk4OweleBuyz7k2FxA +Rr2u9IOvGU3eKAeH8HSFWvaNE9S2lYFPiWWZ6O/LzVvnb847+gungQ7SPRzOkt4k +L4PtHIoKmLWFr5tzML1Q8wiaKcTWMb5LZbRbo+2XYGoIpilxkBBuhX7cMJFwOHEf +YJJRixBI97doPsnIQ3GkA8xY+INzQ4LWNQbnEtS7L7t26NA9tDlg4ILU/UfMoQIp +Ol4EZY1U7gD8BeMwo2vX3x/WA+a7R2N95klBFNqn9jSkm6a5yoeCZw== +-----END RSA PRIVATE KEY----- + + +2. root crl issuer and key +-----BEGIN CERTIFICATE----- +MIICPjCCAaegAwIBAgIBAjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjNaFw0yOTAzMTUxMzMyMjNa +MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQC99u93trf+WmpfiqunJy/P31ej1l4rESxft2JSGNjKuLFN +/BO3SAugGJSkCARAwXjB0c8eeXhXWhVVWdNpbKepRJTxrjDfnFIavLgtUvmFwn/3 +hPXe+RQeA8+AJ99Y+o+10kY8JAZLa2j93C2FdmwOjUbo8aIz85yhbiV1tEDjLwID +AQABo4GJMIGGMB0GA1UdDgQWBBSyFyA3XWLbdL6W6hksmBn7RKsQmDBHBgNVHSME +QDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEwHzELMAkGA1UEBhMCVVMxEDAO +BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw +DQYJKoZIhvcNAQEEBQADgYEAHTm8aRTeakgCfEBCgSWK9wvMW1c18ANGMm8OFDBk +xabVy9BT0MVFHlaneh89oIxTZN0FMTpg21GZMAvIzhEt7DGdO7HLsW7JniN7/OZ0 +rACmpK5frmZrLS03zUm8c+rTbazNfYLoZVG3/mDZbKIi+4y8IGnFcgLVsHsYoBNP +G0c= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,3881A5676C1AD5E5 + +KgaAtGlIQXVnsoifcd1oTi4hS1J+InHISFcZepI1h1hrU9KVAJAlwD1GIeM2qAkG +P1ABsA0TE0yRJpd3qHih2IPtD42osfc3HmNTw17nh4Trd3ESilrs4w/rrH8e6bR5 +WlqG0OKsw8x57t44m9yX94+pP3tdPaJwnFk5M7pDCO44IZskmy10S0NHBn7wMwM/ +mqlZ15mK6YZTwOuLzpdSDJqYPLiv77KpfeiqSN++ISXoNhIcNYHRVyErAS/DcBlx +mbrmBaGexhuagQYqVikEDIvg8kBDWD92EjOFbz94Z6eTvliauJ/+E1/Ffefe2cN5 +LaVwuUsiyW9GjarWwBJDFrXesTikklshC9V35j/ACHVdh5CuO8FGfVijIwlbZ14N +xKWJdSlZlJgEjkwUlWfi1KmrFrob+yK20fGMWr3oY1rTKWZdYkrqnnKEYcMQV/TH +XNY77D5idJ3FLtvJyziqIFuohdatQsu6xFP5UEOeUi6OhptJDjjS+zDhiBlL4cqA +klThzvuycxjZT+5xno0f8GEnZkQNcC6xxPoP6vstNMKLz1rI1CVUSXZBHc5nfMaF +m75rrLbvf6F2NLUspaNXnW8TUMHxcu8nNCnM4/u6hkqebQo/N8X1/v1HImsewwWO +P5uJwqmqfuRz0vZyMKAk3FzQIfrjJouxDfkNV2YHM9VP/grPlDgzmgiN0+6bCbn+ +RW2K8kvkSFZehQ1Ygdst9KYH3NEcEYVYY9pH1N1xRNAylcIDJNwrFwf9vfwjt9/q +AVsyDxUBT/KVCcqr15LNNq9HmmcP6IZZMRjdyf2BR+/cobxxDRZq1Q== +-----END RSA PRIVATE KEY----- + + +3. root CRL issued by root crl issuer. +-----BEGIN X509 CRL----- +MIIBGzCBhQIBATANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQMA4GA1UE +ChMHRXhhbXBsZRcNMDkwNjI4MTMzMjM4WhcNMjgwODI3MTMzMjM4WjAiMCACAQUX +DTA5MDYyODEzMzIzN1owDDAKBgNVHRUEAwoBBKAOMAwwCgYDVR0UBAMCAQEwDQYJ +KoZIhvcNAQEEBQADgYEAVUIeu2x7ZwsliafoCBOg+u8Q4S/VFfTe/SQnRyTM3/V1 +v+Vn5Acc7eo8Rh4AHcnFFbLNk38n6lllov/CaVR0IPZ6hnrNHVa7VYkNlRAwV2aN +GUUhkMMOLVLnN25UOrN9J637SHmRE6pB+TRMaEQ73V7UNlWxuSMK4KofWen0A34= +-----END X509 CRL----- + + +4. subca certificate and key +-----BEGIN CERTIFICATE----- +MIICUDCCAbmgAwIBAgIBAzANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjRaFw0yOTAzMTUxMzMyMjRa +MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz +cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPFv24SK78VI0gWlyIrq/X +srl1431K5hJJxMYZtaQunyPmrYg3oI9KvKFykxnR0N4XDPaIi75p9dXGppVu80BA ++csvIPBwlBQoNmKDQWTziDOqfK4tE+IMuL/Y7pxnH6CDMY7VGpvatty2zcmH+m/v +E/n+HPyeELJQT2rT/3T+7wIDAQABo4GJMIGGMB0GA1UdDgQWBBRidC8Dt3dBzYES +KpR2tR560sZ0+zBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw +HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw +AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAMeMKqrMr5d3eTQsv +MYOD15Dl3THQGLAa4ad5Eyq5/1eUeEOpztzCgDfi0iPD8YCubIEVasBTSqTiGXqb +RpGuPHOwwfWvHrTeHSludiFBAUiKj7aEV+oQa0FBn4U4TT8HA62HQ93FhzTDI3jP +iil34GktVl6gfMKGzUEW/Dh8OM4= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,35408AD3018F0049 + +4t6WfpFNqpOr47Wc/OAt8+KZK0+WX7d3nlJn47W+QN7AkPfBlLBpcQJkImhP4/eh +aJyk8fPOdUhT/4rgc5ORuKk4d9boD36KK5Iz/+/oNBxzuld6TybVb+Hvw41cIZTW +CtkvADQpR8XWbPre+3ZH2eAKoTeWX0xR7pYg1JsFk9vxee6U82iqsAYRdUOdot8D +9zdDbbeaLWs78UbZkxFtuXREuyNVX880Q17t8qszJL2KmmtMQpUvxTlW04Ope1Ug +uIuOxeannzpKRD+37fj+oacM3GRqVFOP47/NVaziOexDBn4b5nlW6OMro6t0qiHt +1GLJcw1oLXoFe8ycexfzYWUiHymSz5Vh3wIflsQY+Ik6dopL+fpk2cVD0bncKJlf +Ie9PvL04RwannRjgtPl9X05tzcgeyznp2Ix1/rsriZQQpdPTLGA6w6kUhQeK6TwT +eX7pXn3iLTGK+VoHRfbxBQR2Fvq1nRJbvsmJFhPOcJU5CYSaDPGGdA6NorbdVgbc +14DlkhzojhEpZ7DaUeFNUXUMlQOR5UUTZB+wL3zQoY/FzHci3JD1Gj4NlbC9mMEg +ncWZcpZWOnP2kHSz2o/UOxQM80gerukI7NOr020iJ+ZZRb/gyAAzLPnD+mCZ7/e2 +JJ3x6yHOtVA6WzZiQH1d9/bm79rtcWaRH83X/idG1lHuKXQJFAaw5f7Z2n2/yuF1 +9pZf7el1M7UoBf74oc68klAl46f4inroy8anAtc/qjSTXUYQrNvKZsWU9AZVS7oH +iEuYMVW4KiZh3SHsIg5TZdMbdVYtZpcTsl/Kh6XuY0o0Xsi+rTK5AA== +-----END RSA PRIVATE KEY----- + + +5. crl issuer of subca, the certificate and key +-----BEGIN CERTIFICATE----- +MIICUDCCAbmgAwIBAgIBBDANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjdaFw0yOTAzMTUxMzMyMjda +MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz +cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+8AcLJtGAVUWvv3ifcyQw +OGqwzcPrBw/XCs6vTMlcdtFzcH1M+Z3/QHN9+5VT1gqeTIZ+b8g9005Og3XKy/HX +obXZeLv20VZsr+jm52ySghEYOVCTJ9OyFOAp5adp6nf0cA66Feh3LsmVhpTEcDOG +GnyntQm0DBYxRoOT/GBlvQIDAQABo4GJMIGGMB0GA1UdDgQWBBSRWhMuZLQoHSDN +xhxr+vdDmfAY8jBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw +HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw +AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAMIDZLdOLFiPyS1bh +Ch4eUYHT+K1WG93skbga3kVYg3GSe+gctwkKwKK13bwfi8zc7wwz6MtmQwEYhppc +pKKKEwi5QirBCP54rihLCvRQaj6ZqUJ6VP+zPAqHYMDbzlBbHtVF/1lQUP30I6SV +Fu987DvLmZ2GuQA9FKJsnlD9pbU= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,4CD10EAA24AF8C25 + +6pTRc9jsn6CJ2EMYhuGX3aWrDThhacnqdtsKIqUzX8Ga7Jz9kq6HseTRlqPkzBfb +rCl+eVIkgugrPbf93375mP/ozY8LkEgD9TRAL1uXqha2N6TRLC2ozQJQSoIc441e +UZ9XkB6tPGRfPNvi1xE0WTP7bjOUkvkPU9wM9QFuBW6B7mRf3tG2nqkFiTpY6nz8 +5X5+h9jafcCvMwYhfJm0JFTGWmX4WJWubs8QeYndvIriDDw2zpVNcno45sClSQCb +YVekMLgGlKPmNGub5iRfXsozykE3jbMnXRokxrvzk20jjo0XYPVGfCRe9IhJh8Ud +iCG/kPaJspbUkUlKXfvIOdp2pnoDFZI5hbfc75YrFYJ8x8dwRYBUl6yRtBkw5Yo/ +VQDuNq3d7YpxiGxVTwFox6HQ5+rs6jwSGzOilgOCxPSs41fYcdAlogNqLzjvhn+e +0GU1XTVyMJbO0Ae6Sgm4PmxU7QM2bdzESuZWbYRFbH2ywwmoR8SahB3ICBhuIA/l +lsCrBbq+jL/K2IL1VXBKuaKBN1ShKUPZD/ABWNv4uENNg2AFq1XQ6kvTU8Glfhd9 +tyK8YnJ0ViY4VLGhdf0s2eEPmbfxOv0HCW0sz/57eASoQSTJTdVApYopWHBOwaNq +8qQUEPDMTKaPNqCjA2m/NwGrLPHhU0d5dHmp+9gTbCTmWy4sVenhBPbOy6wvFpNA +F+35tJVaZQOOurm/KC2dLOYkKyAvqnB7D2q4zducpWkiyCweg7uYL14Mo5JQmGuq +2DwfRiMxdqqoqHFKEOxsoAMrKSwJlYojUknfz/LEaqxtMePQtNwhjw== +-----END RSA PRIVATE KEY----- + + +6. CLR issued by subca CRL issuer +-----BEGIN X509 CRL----- +MIIBLTCBlwIBATANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQMA4GA1UE +ChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMRcNMDkwNjI4MTMzMjQzWhcNMjgw +ODI3MTMzMjQzWjAiMCACAQQXDTA5MDYyODEzMzIzOFowDDAKBgNVHRUEAwoBBKAO +MAwwCgYDVR0UBAMCAQEwDQYJKoZIhvcNAQEEBQADgYEACQZEf6ydb3fKTMPJ8DBO +oo630MsrT3P0x0AC4+aQOueCBaGpNqW/H379uZxXAad7yr+aXUBwaeBMYVKUbwOe +5TrN5QWPe2eCkU+MSQvh1SHASDDMH4jhWFMRdO3aPMDKKPlO/Q3s0G72eD7Zo5dr +N9AvUXxGxU4DruoJuFPcrCI= +-----END X509 CRL----- + + +7. dumca certificate and key +-----BEGIN CERTIFICATE----- +MIICUDCCAbmgAwIBAgIBBTANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjhaFw0yOTAzMTUxMzMyMjha +MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz +cy1EMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDeWn+ulgls9+dK3KzzfC1b +a9RMSf+gjv/Olw5386Vw6pJOVngR11RytWJoLiKbjYPyGhP1cms2FoUKuAEO31gD +3AoUCa+nXgaMLiDtmdC5ATqVv3Oap5aNgAqq0mxMxOylKgcUhfuH2icEnfBtHzEe +ST11S69zQr5GGfa/XslbDQIDAQABo4GJMIGGMB0GA1UdDgQWBBRCmXIsp4G3iP7Z +Qv4gS19W8W/cLzBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw +HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw +AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAkRiLpJesXyNQ34ZP +Oc4d0gvCl4pyNHx5gsV0yHtxP7oYoIa7Bw4setplQ9Y2YcH5xuXK84xvAby9csWp +cod1QOkFzZfb9qj10PXfD8bMoLOyrZfr5nsNAl2scvOtnM1TFL/ll5/S2PVcPthx +Z5t128UNQYMu93OmVjZANL5L6Jw= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,11485599004D2482 + +R+TgUoQo1Ksqpnwh1B1x3u7jxd1qJsfG5st7WJaeJzSY3v+ZnmTS4O008eKgw6Z1 +eGJevsNW8Z8ButjChzlesCm+90jpKpOqA6MlvzeknAxtGdEfe8rUEytfNOorjJTy +1Mu9T8Tlk6tmmmXNTDX1lQytYaHA4e4VVEbYGNceMNcPonT1Y0SyebJwtfd4XKkG +Ty40kMnb+qrFr1ZxVRG+LWKDR/bS0S2K2zY6Ha45d8yoYZlgLZ7yVAlrp0T0PF4B +UWvSyNK9VOBLrvqXSofK5gNGkR/C63x8FU2V25ISicBQBXLNo9OgIsbrryHF330T +2TxhnOpFU1AwgTSfp4Fy/Htkvgo7/jmFRa3r4xelTdEUKvRrwaZeMjg0fT+24529 +8o8MMOF0YWNtIDNUVRFg9/DgAsD/LoXbOGc/E2ryJdq1D4N914s4m/D5Sox27iu4 +3op/dt+WMoA0g/YbjhWn2cAfWcH9P8p8/n/FUO8APmGI3aHbtOhJQ8qwxcalp6kO +fICWsW4ygWtdpnyJWzAY0Udtsl8mglTppGTl59OYZmlDQTLhJ1hWiXLeNKj0pGPz +bAJ5jGQN8zXAk83j019rI5WveAdWp+w1XRGvmPxLL3heojHrkutuYLQ0LOcFwNvg +OqmPvZneRBoy6Yshp0XyYy+qioxDm+Vd/NV1/aCWgQXJA3vFqUg3AURLFHHTh+7h +fa3DDCLtdg/wJkRtOWjFhq0hgx5sb9zVv8HCuMERbZJbWwDOfSrHJwXj4KaTHVqY +OWfBE9vzeAxRpdpe69SZWYg3tyu7uSf6a5Rp55iMI3kjuQMCanvsNA== +-----END RSA PRIVATE KEY----- + + +8. crl issuer for dumca, the certificate and key +-----BEGIN CERTIFICATE----- +MIICUDCCAbmgAwIBAgIBBjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjlaFw0yOTAzMTUxMzMyMjla +MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz +cy1EMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDF7NjUUWji4pPmFg3qx4HB +kjtInwe7i2lPjRUN0ZwTcWob2RaD1+fhc7seeNmnypjERTa9TXF5cs2PgSHWNISC +QbQpbobOUcSsV/6Lr0kvrHJuVowcX13VsApGSJavVs2oJqUiFGNpnch8yR/pMHJf +hsd/Go+nUXMOl2xN31DMFQIDAQABo4GJMIGGMB0GA1UdDgQWBBS1XVE2CYKHgO7t +1koYVTu2w7xgNTBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw +HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw +AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAHYraYtdetZFOiTUR +dhvUi556el1WT25O8pF21YAzRI7KI4yzl6deD29DtcIPiBc8H1A4U6OhwXSQsqTd +taOHHdZxnU+m078mb231OPVvo48uZwpnX35g/qItW+Nb/dIEb08537oQKoGgL0hV +sKZPWod70JBkJabDuUirorhlk4A= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,1E0E5983F90A10E0 + +KdPTRmJjeKXFTgdVIgP0eu+m0evwVD2QFMkT3pPI9HELRxtkgIQzjK8F0KIHK9vi +Ur0CMgJkX0zs2v7HIG7jvfQ2fREidRTk1g3xCjHXVbpwjWN2dbo+mR0J2zzxNILy +mSs13PlDPdV81Vkn1WkMY0lhdrEpR6senQ4KIiMJTMsWZabG3lyFM6d7ag7CDVC+ +jnsUFg2XW5dYP/kb09p14+CdiQwruNVeVEWhWPG1pAjl7hXCEM5ssz9fNk6Gyh2X +OXB2mMysqTkt+qB+OIqLKj3NTUs2ovVQZnaCaynsnMYTcIEFmv3lC0gJHYAZtBXf +IkySb+VaB7wmk1CI1+texDU8+B2sq7wmqX0SLY7dMwkbxP1kydn9U5i4Gqmdxpw5 +4+jn7dB6oKfVFlXIZTZzhmN44cIdai48qVmse1BRDxUdfmlgd9C2W1mw4N60BXbt +DeNr8ua5UtcUOXBGJk6VEJapDU/dnnANhVR4R48Y9t+g1qlhwHB4zbSrAIJ5Rsbg +6pvdt7BQmFXtm4flZbf21Lr8awWkNFdc/k/3uXA6xemgsFNxPZXlpXO26KpIP+nz +lt9Q82WxIkzE+BvO+qd5wMqQ/GC/ztO8GJeGdRIo6un7KkNKs2AZDoCELo2lO53B +EBWHeABtJpB1Fw3lW3iJn0A6YbYzK1omztoNMkesBIi0QI5L/e0tq4Mp+LUjLm+Y +ywdrofTiYTu8R7mgS1b5q3eFtwUR9MZuKJGvhsBcSfS41vH2hDezYHg8vW55UIE3 +h7EhOUnTkHY43OKZnmXHwh3pTEmHv1TfMpeaktiU/w0= +-----END RSA PRIVATE KEY----- + +9. end entity certificate issued by subca, Alice +-----BEGIN CERTIFICATE----- +MIICNzCCAaCgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMTAeFw0wOTA2MjgxMzMy +MzBaFw0yOTAzMTUxMzMyMzBaMEExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFt +cGxlMRAwDgYDVQQLEwdDbGFzcy0xMQ4wDAYDVQQDEwVBbGljZTCBnzANBgkqhkiG +9w0BAQEFAAOBjQAwgYkCgYEA7wnsvR4XEOfVznf40l8ClLod+7L0y2/+smVV+GM/ +T1/QF/stajAJxXNy08gK00WKZ6ruTHhR9vh/Z6+EQM2RZDCpU0A7LPa3kLE/XTmS +1MLDu8ntkdlpURpvhdDWem+rl2HU5oZgzV8Jkcov9vXuSjqEDfr45FlPuV40T8+7 +cxsCAwEAAaNPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSBwsAhi6Z1kriOs3ty +uSIujv9a3DAfBgNVHSMEGDAWgBRidC8Dt3dBzYESKpR2tR560sZ0+zANBgkqhkiG +9w0BAQQFAAOBgQDEiBqd5AMy2SQopFaS3dYkzj8MHlwtbCSoNVYkOfDnewcatrbk +yFcp6FX++PMdOQFHWvvnDdkCUAzZQp8kCkF9tGLVLBtOK7XxQ1us1LZym7kOPzsd +G93Dcf0U1JRO77juc61Br5paAy8Bok18Y/MeG7uKgB2MAEJYKhGKbCrfMw== +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,9E29E1901B338431 + +796Bj4/MwwHdy6+yZQcq3pS12EZPlEm7qsCCTl787y+DYEnnj+9W4WX4+1zWsUGV +1+39oe/KOUfi5O9ytMuKiroIrklmkskWHDoW6sr4VcDprnLYL+75AhTfgpOtY+gK +q+++N7P2o9V6YF7PiGxaBqGy/3bt0nTu0sjctfzbo4g0PniiId9sus2Y+iRHKebJ +r9V0b0jB8USuIsZ+4IQJFZ+/zeKuqqqPM/4v5VKNUahER8oykhRd4L9UactnVH5t +dsfowtHmOmKE6ObJX3m+HgJMvauMMf7zJVdqJquU2vy0bUk9ufCrA7t5ws7JDRzd +SG5gt7EVQzd5x/yXsQdKbDew5mXsYPB8vz4moTgj4YJU+m6k0t1PH00pz7LUrDHl +E8ZAmXIKLEBIih1AWkdASR/YZsfB3URIC8mLyDSZJN5iEVJxl/JWm6pbJlP3Xn3J +fraVEXP6uerf29CNhizq520AfGdsSqga6atdx6PXBVm67V0TZ+zmBMUQJrWmJUUC +NFGAac+M58lYX9uwsrO9x/x6GSZvhQQu1kfD1m8DHN3IV5m3uHxsEvhmuHaqFEMJ +uH336HbqWYENXwZfDHZvOU1o2FejsLZ7QmFjB72iAxhVNQt53pCXed2gF/bERGSn +qi0PsYtjyzfEUefqlVRSWVulbQfGwkvl8dX9s6BxmOG1q0BzlDu+cQLYXPS+XOww +H8GgkGp6XTd04qT/qCm8gcuxAvdkYkj2zgAIKaqeJ53S3Ua9lrIKnA3L3btiEG5F +JTYutSdRqB4liukkB1TciiDVSmOisszjrMHhRRYPfgeLfnRFdX9U9g== +-----END RSA PRIVATE KEY----- + +10. end entity certificate issued by subca, Bob +-----BEGIN CERTIFICATE----- +MIICNTCCAZ6gAwIBAgIBAzANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMTAeFw0wOTA2MjgxMzMy +MzVaFw0yOTAzMTUxMzMyMzVaMD8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFt +cGxlMRAwDgYDVQQLEwdDbGFzcy0xMQwwCgYDVQQDEwNCb2IwgZ8wDQYJKoZIhvcN +AQEBBQADgY0AMIGJAoGBALLrxd3DpXuH7yiAoyi/Rc1F7WsyyeNE1Ra2ymHpcee/ +3sbldekcgPl6lGQF/JJ5ARBbfeDtaf6ZtAK3j6aXqxVFxDKKu86r96v74gWJB7Vv +CHcUPvmE/EGESq3VNFI998DbmvqICLC97nFLUIrKWDH1rRFZjjkmouln40UxQXvV +AgMBAAGjTzBNMAsGA1UdDwQEAwID6DAdBgNVHQ4EFgQUTXz1J2viNSKvRHIRVhD6 +cJE4lgYwHwYDVR0jBBgwFoAUYnQvA7d3Qc2BEiqUdrUeetLGdPswDQYJKoZIhvcN +AQEEBQADgYEApsKyLf4FbXb26KsQrxgFn/w0d/7ck4cE8a6oXQqi5OLheNSWfD3S +fgD1dR28mGmhBiyOkdLmrhA1+6BuEr4FsuyLgrFnEqKL0ZhVhiqvwKLGqvasWxfU +Edaw4WXvRcfRWXfgjtwB6PSj/3nqGKSGRPif/OFIjO6UqHwEM7JEWO4= +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,4A820975D251613F + +GseD8MIztC0oYMxwpxeBO4/YPs9ZFFjgncXXcy+1oYZdlEsrS1xw87unjeHigL8m +QPIn8Guv3DiOsBdvweuMAgPPaA1zlophPClbGZMk7BB3T2acEfjBQH1DZz7kd7Bf +OmI2DrqcEg1yDi7l7YutBuTQPiy3nj3d7pbScuFd5YVMu6yH0YpS7JsPvviabFk2 +eYVlkaiejtQwV+4rUb7sH/0iyqX2uqvnpnGAwVzGp+tfSOl71SByz240nOODBRgY +3Uvxkrw6XhCBAayJE0t7rkPMEe1KgZaGO2IU2jsJJbyHVjvNPSugdbsT28prZHN1 +5M1J1NSOssq/kAq6S3f9sC5j7OzP7oUlx8uMUUSaz09/Ttq22tUoqmTue2IqqxAt +lDaeR8duHP5VV1wWnDsW/XaVYlBFQ4eFPJcXqmWsNAkDQVJp327GrcT6ngevP8fD +BcIxyX6J0rETPruAE+1+PAGjqy+C+oB0ssyZvKcjzdajHcNxSlRpCuOO2ekDvNPO +h+mVukNpHCEBsh3jYmk3z9i7VPLCM0BI+vheJ1TbM+homWP6bXyTQxtLfaKzXZJH +jRJ+zGTMBNJoPVKkou03uXFpT6hdWr9nYwbMT6G9hmC0If3wEl8nRjDKbmyMS29B +p3im1kPxVJA0DjhghC+7tACy42ffw6KZPALwaVDKHGeitrQBc3xTGfrjOGQOTTcm +hZ8icYCY0cjl5KQ2kq2GpXa2zQMujNV/Oj7D4sE0xcASMRXl3tst77R/j0eowx1M +niCTRphxx4iTPkieIbjWWeFTpVmSzUBrm4hSw3tiRapVWf6Zo3aAIg== +-----END RSA PRIVATE KEY----- + +11. end entity certificate issued by subca, Susan +-----BEGIN CERTIFICATE----- +MIICNzCCAaCgAwIBAgIBBDANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMTAeFw0wOTA2MjgxMzMy +MzZaFw0yOTAzMTUxMzMyMzZaMEExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFt +cGxlMRAwDgYDVQQLEwdDbGFzcy0xMQ4wDAYDVQQDEwVTdXNhbjCBnzANBgkqhkiG +9w0BAQEFAAOBjQAwgYkCgYEAr2u6mdjqAVtfcgPze+9OUFZu3pi+HqoNBoygm2gq +qRAe+FVNSUeNAMQesQBo/eB0F1Iv/BjnYJ/7pYMLaf90MLoYr0Q5vNKYlBdcyUee +Jn1WmfN2Qk+UoUaiM4HAKHNJnZk13vWpZW54mcW1q09oj0oMjAZtaZsqpY6CtW6/ ++J8CAwEAAaNPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBQVK9naug5W9pQlBqD2 +fVaCXooa1TAfBgNVHSMEGDAWgBRidC8Dt3dBzYESKpR2tR560sZ0+zANBgkqhkiG +9w0BAQQFAAOBgQDKYoM8EbP78ucjtsdvw4ywyo21hhSeP9PmRnNz/U3F9sQATmn+ +QBl6sBsrmbML2yrhkM1ctZTVUVp0S72fAbLgVjNk86p/CF+a2tmi0+lJh1aR7zQi +opt+68Nec2/52kgWi64ruF7YITmGHBxS/RDooFbscZbdrPgcow/Jw+5HnQ== +-----END CERTIFICATE----- + +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,9025CDB2AB43B0DE + +q4hvYnqkhDSDCsbXfxtMjPvzT38ql5wscOsGwDM/xMANSyPk9h/aqAxvB8G+8v6E +63x9Q5jRi2YY6z2sOpvu0utu7Xn6KA/H1YrpYFURTEjBbK2Qd41vPQ/NYcIO3nQd +PR2Qm3kpNumBSZomyNfJk9oegGxfw+P0af2GIb6YqmTDot+LLCLwpqxrGyQQ1LYp +zc4A9D/b19Y0eD+TU9S2KEYszvfUo7RBxRFSZ6QN1rT2SEa7IJN9wb6TvgeB2lRB +Ds90tmLtkbuwLTZre+aqbM8mU40+RI9GHh+mPw0Qz55Kw2CUe+PnGsLQnOTm7p/I +mLiPTNMJKvwaR18Z88IE9UwL0zE/ND7vZfrhqTn9bHRnzHU4NtBCBsS8zloI+rXZ +EIWKMDyzMH3wpbNYq/AemSvvUz1wGOxit5TjG2QwwCNt8hPLl0Es6Q5aWdAPPrLM +EfX/6gL7bLTHNyLPz/U32o0H4hz5J7FQ7SuYUPLI3ybiPC2qL11jbtrZMesAYEAX +mvRnqO+6dPEpwGmKz8kUj2mC8X8FPKCCiy4kbc8NjLTMao+/vOgD+wBuIePaC3yE +vpuZrsUSFZWRJ824sDMmmZFoi2DKsp1zqCV1kXozaPGigaOxtkdp890nBcGkPijQ +8F+jCGwSFda6UfuJHCQ/eJB+8LQUWa8u1TeJ9zo98oD2OBfQ5maZU0Vfv1EXvwbp +pz2R6HXFaPrQDeGO0xVzD453AbY/fZCGnhIwrEYvPAbwpIKde397MP66gYFMNFhA +IaMimFnBv7IHL08Ka0KtqbVhLpEKWFpZ6LsOnyispeB4KF0md+lpGg== +-----END RSA PRIVATE KEY----- diff --git a/jdk/test/java/security/cert/CertPathBuilder/selfIssued/StatusLoopDependency.java b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/StatusLoopDependency.java new file mode 100644 index 00000000000..ed0cf53ace1 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/StatusLoopDependency.java @@ -0,0 +1,309 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6852744 + * @summary PIT b61: PKI test suite fails because self signed certificates + * are being rejected + * @run main/othervm StatusLoopDependency subca + * @run main/othervm StatusLoopDependency subci + * @run main/othervm StatusLoopDependency alice + * @author Xuelei Fan + */ + +import java.io.*; +import java.net.SocketException; +import java.util.*; +import java.security.Security; +import java.security.cert.*; +import java.security.cert.CertPathValidatorException.BasicReason; +import sun.security.util.DerInputStream; + +/** + * KeyUsage extension plays a important rule during looking for the issuer + * of a certificate or CRL. A certificate issuer should have the keyCertSign + * bit set, and a CRL issuer should have the cRLSign bit set. + * + * Sometime, a delegated CRL issuer would also have the keyCertSign bit set, + * as would be troublesome to find the proper CRL issuer during certificate + * path build if the delegated CRL issuer is a self-issued certificate, for + * it is hard to identify it from its issuer by the "issuer" field only. + * + * In the test case, the delegated CRL issuers have keyCertSign bit set, and + * the CAs have the cRLSign bit set also. If we cannot identify the delegated + * CRL issuer from its issuer, there is a potential loop to find the correct + * CRL. + * + * And when revocation enabled, needs to check the status of the delegated + * CRL issuers. If the delegated CRL issuer issues itself status, there is + * a potential loop to verify the CRL and check the status of delegated CRL + * issuer. + * + * The fix of 6852744 should addresses above issues. + */ +public final class StatusLoopDependency { + + // the trust anchor + static String selfSignedCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICPjCCAaegAwIBAgIBADANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMThaFw0zMDA2MDgxMzMyMTha\n" + + "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" + + "AQUAA4GNADCBiQKBgQDInJhXi0655bPXAVkz1n5I6fAcZejzPnOPuwq3hU3OxFw8\n" + + "81Uf6o9oKI1h4w4XAD8u1cUNOgiX+wPwojronlp68bIfO6FVhNf287pLtLhNJo+7\n" + + "m6Qxw3ymFvEKy+PVj20CHSggdKHxUa4MBZBmHMFNBuxfYmjwzn+yTMmCCXOvSwID\n" + + "AQABo4GJMIGGMB0GA1UdDgQWBBSQ52Dpau+gtL+Kc31dusYnKj16ZTBHBgNVHSME\n" + + "QDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" + + "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw\n" + + "DQYJKoZIhvcNAQEEBQADgYEAjBt6ea65HCqbGsS2rs/HhlGusYXtThRVC5vwXSey\n" + + "ZFYwSgukuq1KDzckqZFu1meNImEwdZjwxdN0e2p/nVREPC42rZliSj6V1ThayKXj\n" + + "DWEZW1U5aR8T+3NYfDrdKcJGx4Hzfz0qKz1j4ssV1M9ptJxYYv4y2Da+592IN1S9\n" + + "v/E=\n" + + "-----END CERTIFICATE-----"; + + // the sub-ca + static String subCaCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICUDCCAbmgAwIBAgIBAzANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjRaFw0yOTAzMTUxMzMyMjRa\n" + + "MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz\n" + + "cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPFv24SK78VI0gWlyIrq/X\n" + + "srl1431K5hJJxMYZtaQunyPmrYg3oI9KvKFykxnR0N4XDPaIi75p9dXGppVu80BA\n" + + "+csvIPBwlBQoNmKDQWTziDOqfK4tE+IMuL/Y7pxnH6CDMY7VGpvatty2zcmH+m/v\n" + + "E/n+HPyeELJQT2rT/3T+7wIDAQABo4GJMIGGMB0GA1UdDgQWBBRidC8Dt3dBzYES\n" + + "KpR2tR560sZ0+zBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw\n" + + "HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw\n" + + "AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAMeMKqrMr5d3eTQsv\n" + + "MYOD15Dl3THQGLAa4ad5Eyq5/1eUeEOpztzCgDfi0iPD8YCubIEVasBTSqTiGXqb\n" + + "RpGuPHOwwfWvHrTeHSludiFBAUiKj7aEV+oQa0FBn4U4TT8HA62HQ93FhzTDI3jP\n" + + "iil34GktVl6gfMKGzUEW/Dh8OM4=\n" + + "-----END CERTIFICATE-----"; + + // a delegated CRL issuer, it's a self-issued certificate of trust anchor + static String topCrlIssuerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICPjCCAaegAwIBAgIBAjANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjNaFw0yOTAzMTUxMzMyMjNa\n" + + "MB8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMIGfMA0GCSqGSIb3DQEB\n" + + "AQUAA4GNADCBiQKBgQC99u93trf+WmpfiqunJy/P31ej1l4rESxft2JSGNjKuLFN\n" + + "/BO3SAugGJSkCARAwXjB0c8eeXhXWhVVWdNpbKepRJTxrjDfnFIavLgtUvmFwn/3\n" + + "hPXe+RQeA8+AJ99Y+o+10kY8JAZLa2j93C2FdmwOjUbo8aIz85yhbiV1tEDjLwID\n" + + "AQABo4GJMIGGMB0GA1UdDgQWBBSyFyA3XWLbdL6W6hksmBn7RKsQmDBHBgNVHSME\n" + + "QDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEwHzELMAkGA1UEBhMCVVMxEDAO\n" + + "BgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYw\n" + + "DQYJKoZIhvcNAQEEBQADgYEAHTm8aRTeakgCfEBCgSWK9wvMW1c18ANGMm8OFDBk\n" + + "xabVy9BT0MVFHlaneh89oIxTZN0FMTpg21GZMAvIzhEt7DGdO7HLsW7JniN7/OZ0\n" + + "rACmpK5frmZrLS03zUm8c+rTbazNfYLoZVG3/mDZbKIi+4y8IGnFcgLVsHsYoBNP\n" + + "G0c=\n" + + "-----END CERTIFICATE-----"; + + // a delegated CRL issuer, it's a self-issued certificate of sub-ca + static String subCrlIssuerCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICUDCCAbmgAwIBAgIBBDANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTAeFw0wOTA2MjgxMzMyMjdaFw0yOTAzMTUxMzMyMjda\n" + + "MDExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFtcGxlMRAwDgYDVQQLEwdDbGFz\n" + + "cy0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+8AcLJtGAVUWvv3ifcyQw\n" + + "OGqwzcPrBw/XCs6vTMlcdtFzcH1M+Z3/QHN9+5VT1gqeTIZ+b8g9005Og3XKy/HX\n" + + "obXZeLv20VZsr+jm52ySghEYOVCTJ9OyFOAp5adp6nf0cA66Feh3LsmVhpTEcDOG\n" + + "GnyntQm0DBYxRoOT/GBlvQIDAQABo4GJMIGGMB0GA1UdDgQWBBSRWhMuZLQoHSDN\n" + + "xhxr+vdDmfAY8jBHBgNVHSMEQDA+gBSQ52Dpau+gtL+Kc31dusYnKj16ZaEjpCEw\n" + + "HzELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0V4YW1wbGWCAQAwDwYDVR0TAQH/BAUw\n" + + "AwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEEBQADgYEAMIDZLdOLFiPyS1bh\n" + + "Ch4eUYHT+K1WG93skbga3kVYg3GSe+gctwkKwKK13bwfi8zc7wwz6MtmQwEYhppc\n" + + "pKKKEwi5QirBCP54rihLCvRQaj6ZqUJ6VP+zPAqHYMDbzlBbHtVF/1lQUP30I6SV\n" + + "Fu987DvLmZ2GuQA9FKJsnlD9pbU=\n" + + "-----END CERTIFICATE-----"; + + // the target EE certificate + static String targetCertStr = + "-----BEGIN CERTIFICATE-----\n" + + "MIICNzCCAaCgAwIBAgIBAjANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQ\n" + + "MA4GA1UEChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMTAeFw0wOTA2MjgxMzMy\n" + + "MzBaFw0yOTAzMTUxMzMyMzBaMEExCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFeGFt\n" + + "cGxlMRAwDgYDVQQLEwdDbGFzcy0xMQ4wDAYDVQQDEwVBbGljZTCBnzANBgkqhkiG\n" + + "9w0BAQEFAAOBjQAwgYkCgYEA7wnsvR4XEOfVznf40l8ClLod+7L0y2/+smVV+GM/\n" + + "T1/QF/stajAJxXNy08gK00WKZ6ruTHhR9vh/Z6+EQM2RZDCpU0A7LPa3kLE/XTmS\n" + + "1MLDu8ntkdlpURpvhdDWem+rl2HU5oZgzV8Jkcov9vXuSjqEDfr45FlPuV40T8+7\n" + + "cxsCAwEAAaNPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSBwsAhi6Z1kriOs3ty\n" + + "uSIujv9a3DAfBgNVHSMEGDAWgBRidC8Dt3dBzYESKpR2tR560sZ0+zANBgkqhkiG\n" + + "9w0BAQQFAAOBgQDEiBqd5AMy2SQopFaS3dYkzj8MHlwtbCSoNVYkOfDnewcatrbk\n" + + "yFcp6FX++PMdOQFHWvvnDdkCUAzZQp8kCkF9tGLVLBtOK7XxQ1us1LZym7kOPzsd\n" + + "G93Dcf0U1JRO77juc61Br5paAy8Bok18Y/MeG7uKgB2MAEJYKhGKbCrfMw==\n" + + "-----END CERTIFICATE-----"; + + // CRL issued by the delegated CRL issuer, topCrlIssuerCertStr + static String topCrlStr = + "-----BEGIN X509 CRL-----\n" + + "MIIBGzCBhQIBATANBgkqhkiG9w0BAQQFADAfMQswCQYDVQQGEwJVUzEQMA4GA1UE\n" + + "ChMHRXhhbXBsZRcNMDkwNjI4MTMzMjM4WhcNMjgwODI3MTMzMjM4WjAiMCACAQUX\n" + + "DTA5MDYyODEzMzIzN1owDDAKBgNVHRUEAwoBBKAOMAwwCgYDVR0UBAMCAQEwDQYJ\n" + + "KoZIhvcNAQEEBQADgYEAVUIeu2x7ZwsliafoCBOg+u8Q4S/VFfTe/SQnRyTM3/V1\n" + + "v+Vn5Acc7eo8Rh4AHcnFFbLNk38n6lllov/CaVR0IPZ6hnrNHVa7VYkNlRAwV2aN\n" + + "GUUhkMMOLVLnN25UOrN9J637SHmRE6pB+TRMaEQ73V7UNlWxuSMK4KofWen0A34=\n" + + "-----END X509 CRL-----"; + + // CRL issued by the delegated CRL issuer, subCrlIssuerCertStr + static String subCrlStr = + "-----BEGIN X509 CRL-----\n" + + "MIIBLTCBlwIBATANBgkqhkiG9w0BAQQFADAxMQswCQYDVQQGEwJVUzEQMA4GA1UE\n" + + "ChMHRXhhbXBsZTEQMA4GA1UECxMHQ2xhc3MtMRcNMDkwNjI4MTMzMjQzWhcNMjgw\n" + + "ODI3MTMzMjQzWjAiMCACAQQXDTA5MDYyODEzMzIzOFowDDAKBgNVHRUEAwoBBKAO\n" + + "MAwwCgYDVR0UBAMCAQEwDQYJKoZIhvcNAQEEBQADgYEACQZEf6ydb3fKTMPJ8DBO\n" + + "oo630MsrT3P0x0AC4+aQOueCBaGpNqW/H379uZxXAad7yr+aXUBwaeBMYVKUbwOe\n" + + "5TrN5QWPe2eCkU+MSQvh1SHASDDMH4jhWFMRdO3aPMDKKPlO/Q3s0G72eD7Zo5dr\n" + + "N9AvUXxGxU4DruoJuFPcrCI=\n" + + "-----END X509 CRL-----"; + + private static Set generateTrustAnchors() + throws CertificateException { + // generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is = + new ByteArrayInputStream(selfSignedCertStr.getBytes()); + Certificate selfSignedCert = cf.generateCertificate(is); + + // generate a trust anchor + TrustAnchor anchor = + new TrustAnchor((X509Certificate)selfSignedCert, null); + + return Collections.singleton(anchor); + } + + private static CertStore generateCertificateStore() throws Exception { + Collection entries = new HashSet(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + ByteArrayInputStream is; + + is = new ByteArrayInputStream(targetCertStr.getBytes()); + Certificate cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(selfSignedCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(topCrlIssuerCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + cert = cf.generateCertificate(is); + entries.add(cert); + + // generate CRL from CRL string + is = new ByteArrayInputStream(topCrlStr.getBytes()); + Collection mixes = cf.generateCRLs(is); + entries.addAll(mixes); + + is = new ByteArrayInputStream(subCrlStr.getBytes()); + mixes = cf.generateCRLs(is); + entries.addAll(mixes); + + return CertStore.getInstance("Collection", + new CollectionCertStoreParameters(entries)); + } + + private static X509CertSelector generateSelector(String name) + throws Exception { + X509CertSelector selector = new X509CertSelector(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = null; + if (name.equals("subca")) { + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + } else if (name.equals("subci")) { + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + } else { + is = new ByteArrayInputStream(targetCertStr.getBytes()); + } + + X509Certificate target = (X509Certificate)cf.generateCertificate(is); + byte[] extVal = target.getExtensionValue("2.5.29.14"); + if (extVal != null) { + DerInputStream in = new DerInputStream(extVal); + byte[] subjectKID = in.getOctetString(); + selector.setSubjectKeyIdentifier(subjectKID); + } else { + // unlikely to happen. + throw new Exception("unexpected certificate: no SKID extension"); + } + + return selector; + } + + private static boolean match(String name, Certificate cert) + throws Exception { + X509CertSelector selector = new X509CertSelector(); + + // generate certificate from certificate string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is = null; + if (name.equals("subca")) { + is = new ByteArrayInputStream(subCaCertStr.getBytes()); + } else if (name.equals("subci")) { + is = new ByteArrayInputStream(subCrlIssuerCertStr.getBytes()); + } else { + is = new ByteArrayInputStream(targetCertStr.getBytes()); + } + X509Certificate target = (X509Certificate)cf.generateCertificate(is); + + return target.equals(cert); + } + + + public static void main(String[] args) throws Exception { + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); + + X509CertSelector selector = generateSelector(args[0]); + + Set anchors = generateTrustAnchors(); + CertStore certs = generateCertificateStore(); + + + PKIXBuilderParameters params = + new PKIXBuilderParameters(anchors, selector); + params.addCertStore(certs); + params.setRevocationEnabled(true); + params.setDate(new Date(109, 7, 1)); // 2009-07-01 + Security.setProperty("ocsp.enable", "false"); + System.setProperty("com.sun.security.enableCRLDP", "true"); + + PKIXCertPathBuilderResult result = + (PKIXCertPathBuilderResult)builder.build(params); + + if (!match(args[0], result.getCertPath().getCertificates().get(0))) { + throw new Exception("unexpected certificate"); + } + } +} diff --git a/jdk/test/java/security/cert/CertPathBuilder/selfIssued/generate.sh b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/generate.sh new file mode 100644 index 00000000000..06429d63ffa --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/generate.sh @@ -0,0 +1,221 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +#!/bin/ksh +# +# needs ksh to run the script. + +# generate a self-signed root certificate +if [ ! -f root/root_cert.pem ]; then + if [ ! -d root ]; then + mkdir root + fi + + openssl req -x509 -newkey rsa:1024 -keyout root/root_key.pem \ + -out root/root_cert.pem -subj "/C=US/O=Example" \ + -config openssl.cnf -reqexts cert_issuer -days 7650 \ + -passin pass:passphrase -passout pass:passphrase +fi + +# generate a sele-issued root crl issuer certificate +if [ ! -f root/top_crlissuer_cert.pem ]; then + if [ ! -d root ]; then + mkdir root + fi + + openssl req -newkey rsa:1024 -keyout root/top_crlissuer_key.pem \ + -out root/top_crlissuer_req.pem -subj "/C=US/O=Example" -days 7650 \ + -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in root/top_crlissuer_req.pem -extfile openssl.cnf \ + -extensions crl_issuer -CA root/root_cert.pem \ + -CAkey root/root_key.pem -out root/top_crlissuer_cert.pem \ + -CAcreateserial -CAserial root/root_cert.srl -days 7200 \ + -passin pass:passphrase +fi + +# generate subca cert issuer and crl iuuser certificates +if [ ! -f subca/subca_cert.pem ]; then + if [ ! -d subca ]; then + mkdir subca + fi + + openssl req -newkey rsa:1024 -keyout subca/subca_key.pem \ + -out subca/subca_req.pem -subj "/C=US/O=Example/OU=Class-1" \ + -days 7650 -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in subca/subca_req.pem -extfile openssl.cnf \ + -extensions cert_issuer -CA root/root_cert.pem \ + -CAkey root/root_key.pem -out subca/subca_cert.pem -CAcreateserial \ + -CAserial root/root_cert.srl -days 7200 -passin pass:passphrase + + openssl req -newkey rsa:1024 -keyout subca/subca_crlissuer_key.pem \ + -out subca/subca_crlissuer_req.pem -subj "/C=US/O=Example/OU=Class-1" \ + -days 7650 -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in subca/subca_crlissuer_req.pem -extfile openssl.cnf \ + -extensions crl_issuer -CA root/root_cert.pem \ + -CAkey root/root_key.pem -out subca/subca_crlissuer_cert.pem \ + -CAcreateserial -CAserial root/root_cert.srl -days 7200 \ + -passin pass:passphrase +fi + +# generate dumca cert issuer and crl iuuser certificates +if [ ! -f dumca/dumca_cert.pem ]; then + if [ ! -d sumca ]; then + mkdir dumca + fi + + openssl req -newkey rsa:1024 -keyout dumca/dumca_key.pem \ + -out dumca/dumca_req.pem -subj "/C=US/O=Example/OU=Class-D" \ + -days 7650 -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in dumca/dumca_req.pem -extfile openssl.cnf \ + -extensions cert_issuer -CA root/root_cert.pem \ + -CAkey root/root_key.pem -out dumca/dumca_cert.pem \ + -CAcreateserial -CAserial root/root_cert.srl -days 7200 \ + -passin pass:passphrase + + openssl req -newkey rsa:1024 -keyout dumca/dumca_crlissuer_key.pem \ + -out dumca/dumca_crlissuer_req.pem -subj "/C=US/O=Example/OU=Class-D" \ + -days 7650 -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in dumca/dumca_crlissuer_req.pem \ + -extfile openssl.cnf -extensions crl_issuer -CA root/root_cert.pem \ + -CAkey root/root_key.pem -out dumca/dumca_crlissuer_cert.pem \ + -CAcreateserial -CAserial root/root_cert.srl -days 7200 \ + -passin pass:passphrase +fi + +# generate certifiacte for Alice +if [ ! -f subca/alice/alice_cert.pem ]; then + if [ ! -d subca/alice ]; then + mkdir -p subca/alice + fi + + openssl req -newkey rsa:1024 -keyout subca/alice/alice_key.pem \ + -out subca/alice/alice_req.pem \ + -subj "/C=US/O=Example/OU=Class-1/CN=Alice" -days 7650 \ + -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in subca/alice/alice_req.pem \ + -extfile openssl.cnf -extensions ee_of_subca \ + -CA subca/subca_cert.pem -CAkey subca/subca_key.pem \ + -out subca/alice/alice_cert.pem -CAcreateserial \ + -CAserial subca/subca_cert.srl -days 7200 -passin pass:passphrase +fi + +# generate certifiacte for Bob +if [ ! -f subca/bob/bob_cert.pem ]; then + if [ ! -d subca/bob ]; then + mkdir -p subca/bob + fi + + openssl req -newkey rsa:1024 -keyout subca/bob/bob_key.pem \ + -out subca/bob/bob_req.pem \ + -subj "/C=US/O=Example/OU=Class-1/CN=Bob" -days 7650 \ + -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in subca/bob/bob_req.pem \ + -extfile openssl.cnf -extensions ee_of_subca \ + -CA subca/subca_cert.pem -CAkey subca/subca_key.pem \ + -out subca/bob/bob_cert.pem -CAcreateserial \ + -CAserial subca/subca_cert.srl -days 7200 -passin pass:passphrase +fi + +# generate certifiacte for Susan +if [ ! -f subca/susan/susan_cert.pem ]; then + if [ ! -d subca/susan ]; then + mkdir -p subca/susan + fi + + openssl req -newkey rsa:1024 -keyout subca/susan/susan_key.pem \ + -out subca/susan/susan_req.pem \ + -subj "/C=US/O=Example/OU=Class-1/CN=Susan" -days 7650 \ + -passin pass:passphrase -passout pass:passphrase + + openssl x509 -req -in subca/susan/susan_req.pem -extfile openssl.cnf \ + -extensions ee_of_subca -CA subca/subca_cert.pem \ + -CAkey subca/subca_key.pem -out subca/susan/susan_cert.pem \ + -CAcreateserial -CAserial subca/subca_cert.srl -days 7200 \ + -passin pass:passphrase +fi + + +# generate the top CRL +if [ ! -f root/top_crl.pem ]; then + if [ ! -d root ]; then + mkdir root + fi + + if [ ! -f root/index.txt ]; then + touch root/index.txt + echo 00 > root/crlnumber + fi + + openssl ca -gencrl -config openssl.cnf -name ca_top -crldays 7000 \ + -crl_reason superseded -keyfile root/top_crlissuer_key.pem \ + -cert root/top_crlissuer_cert.pem -out root/top_crl.pem \ + -passin pass:passphrase +fi + +# revoke dumca +openssl ca -revoke dumca/dumca_cert.pem -config openssl.cnf \ + -name ca_top -crl_reason superseded \ + -keyfile root/top_crlissuer_key.pem -cert root/top_crlissuer_cert.pem \ + -passin pass:passphrase + +openssl ca -gencrl -config openssl.cnf -name ca_top -crldays 7000 \ + -crl_reason superseded -keyfile root/top_crlissuer_key.pem \ + -cert root/top_crlissuer_cert.pem -out root/top_crl.pem \ + -passin pass:passphrase + +# revoke for subca +if [ ! -f subca/subca_crl.pem ]; then + if [ ! -d subca ]; then + mkdir subca + fi + + if [ ! -f subca/index.txt ]; then + touch subca/index.txt + echo 00 > subca/crlnumber + fi + + openssl ca -gencrl -config openssl.cnf -name ca_subca -crldays 7000 \ + -crl_reason superseded -keyfile subca/subca_crlissuer_key.pem \ + -cert subca/subca_crlissuer_cert.pem -out subca/subca_crl.pem \ + -passin pass:passphrase +fi + +# revoke susan +openssl ca -revoke subca/susan/susan_cert.pem -config openssl.cnf \ + -name ca_subca -crl_reason superseded \ + -keyfile subca/subca_crlissuer_key.pem \ + -cert subca/subca_crlissuer_cert.pem -passin pass:passphrase + +openssl ca -gencrl -config openssl.cnf -name ca_subca -crldays 7000 \ + -crl_reason superseded -keyfile subca/subca_crlissuer_key.pem \ + -cert subca/subca_crlissuer_cert.pem -out subca/subca_crl.pem \ + -passin pass:passphrase diff --git a/jdk/test/java/security/cert/CertPathBuilder/selfIssued/openssl.cnf b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/openssl.cnf new file mode 100644 index 00000000000..f9fca998b72 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/selfIssued/openssl.cnf @@ -0,0 +1,205 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# OpenSSL configuration file. +# + +HOME = . +RANDFILE = $ENV::HOME/.rnd + +[ ca ] +default_ca = CA_default + +[ CA_default ] +dir = ./top +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +unique_subject = no +new_certs_dir = $dir/newcerts +certificate = $dir/cacert.pem +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = $dir/private/cakey.pem +RANDFILE = $dir/private/.rand +x509_extensions = v3_ca + +name_opt = ca_default +cert_opt = ca_default + +default_days = 7650 +default_crl_days = 30 +default_md = sha1 +preserve = no + +policy = policy_anything + +[ ca_top ] +dir = ./root +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +unique_subject = no +new_certs_dir = $dir/newcerts +certificate = $dir/cacert.pem +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = $dir/private/cakey.pem +RANDFILE = $dir/private/.rand + +x509_extensions = v3_ca + +name_opt = ca_default +cert_opt = ca_default + +default_days = 7650 +default_crl_days = 30 +default_md = sha1 +preserve = no + +policy = policy_anything + +[ ca_subca ] +dir = ./subca +certs = $dir/certs +crl_dir = $dir/crl +database = $dir/index.txt +unique_subject = no +new_certs_dir = $dir/newcerts + +certificate = $dir/cacert.pem +serial = $dir/serial +crlnumber = $dir/crlnumber +crl = $dir/crl.pem +private_key = $dir/private/cakey.pem +RANDFILE = $dir/private/.rand + +x509_extensions = usr_cert + +name_opt = ca_default +cert_opt = ca_default + +default_days = 7650 +default_crl_days = 30 +default_md = sha1 +preserve = no + +policy = policy_anything + +[ policy_match ] +countryName = match +stateOrProvinceName = match +organizationName = match +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +[ policy_anything ] +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional + +[ req ] +default_bits = 1024 +default_keyfile = privkey.pem +distinguished_name = req_distinguished_name +attributes = req_attributes +x509_extensions = v3_ca + +string_mask = nombstr + +[ req_distinguished_name ] +countryName = Country Name (2 letter code) +countryName_default = NO +countryName_min = 2 +countryName_max = 2 + +stateOrProvinceName = State or Province Name (full name) +stateOrProvinceName_default = A-State + +localityName = Locality Name (eg, city) + +0.organizationName = Organization Name (eg, company) +0.organizationName_default = Internet Widgits Pty Ltd + +organizationalUnitName = Organizational Unit Name (eg, section) + +commonName = Common Name (eg, YOUR name) +commonName_max = 64 + +emailAddress = Email Address +emailAddress_max = 64 + +[ req_attributes ] +challengePassword = A challenge password +challengePassword_min = 4 +challengePassword_max = 20 +unstructuredName = An optional company name + +[ usr_cert ] +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid,issuer + +[ v3_req ] +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment +subjectAltName = email:example@openjdk.net, RID:1.2.3.4:true + +[ v3_ca ] +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always +basicConstraints = critical,CA:true +keyUsage = keyCertSign, cRLSign + +[ cert_issuer ] +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always +basicConstraints = critical,CA:true +keyUsage = keyCertSign, cRLSign + +[ crl_issuer ] +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always +basicConstraints = critical,CA:true +keyUsage = keyCertSign, cRLSign + + +[ crl_ext ] +authorityKeyIdentifier = keyid:always,issuer:always + +[ ee_of_subca ] +keyUsage = nonRepudiation, digitalSignature, keyEncipherment, keyAgreement + +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid,issuer From 6480dd7357cb2354ff9bd6d39a8dd9d83844b008 Mon Sep 17 00:00:00 2001 From: Erik Trimble Date: Fri, 10 Jul 2009 19:10:02 -0700 Subject: [PATCH 41/91] 6859411: Bump the HS16 build number to 06 Update the HS16 build number to 06 Reviewed-by: jcoomes --- hotspot/make/hotspot_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index 6635ba6afd7..cdac48030fa 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2009 HS_MAJOR_VER=16 HS_MINOR_VER=0 -HS_BUILD_NUMBER=05 +HS_BUILD_NUMBER=06 JDK_MAJOR_VER=1 JDK_MINOR_VER=7 From 1b9d35f50c366a761ef753f55662bb3d43502d1b Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Sat, 11 Jul 2009 16:43:08 +0100 Subject: [PATCH 42/91] 6562614: Compiler warnings for gettimeofday in Inet4/Inet6AddressImpl.c Add missing header to remove compiler warnings. Reviewed-by: martin --- jdk/src/solaris/native/java/net/Inet4AddressImpl.c | 1 + jdk/src/solaris/native/java/net/Inet6AddressImpl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c index 9e3cca486db..4e43c9d5a3a 100644 --- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c @@ -24,6 +24,7 @@ */ #include +#include #include #include #include diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index 5ecedbc6c4f..246585abcc3 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -24,6 +24,7 @@ */ #include +#include #include #include #include From cbb1a71a104f7b0166c211bf2eb10cd305b8771a Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Mon, 13 Jul 2009 23:01:03 +0800 Subject: [PATCH 43/91] 6453837: PartialCompositeContext.allEmpty is buggy Reviewed-by: weijun --- .../com/sun/jndi/toolkit/ctx/PartialCompositeContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java index 5e7e0e3adce..c7bfcfaae4c 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/PartialCompositeContext.java @@ -493,9 +493,9 @@ public abstract class PartialCompositeContext implements Context, Resolver { * Tests whether a name contains a nonempty component. */ protected static boolean allEmpty(Name name) { - Enumeration enum_ = name.getAll(); + Enumeration enum_ = name.getAll(); while (enum_.hasMoreElements()) { - if (!enum_.equals("")) { + if (!enum_.nextElement().isEmpty()) { return false; } } From 1783cb93300f9b2eddb7d4eb52a6db745017b85d Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:47:31 -0700 Subject: [PATCH 44/91] Added tag jdk7-b64 for changeset 752e62a9e600 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index fab0cb001ae..6b4351ee95a 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -38,3 +38,4 @@ ffd09e767dfa6d21466183a400f72cf62d53297f jdk7-b57 472c21584cfd7e9c0229ad6a100366a5c03d2976 jdk7-b61 c7ed15ab92ce36a09d264a5e34025884b2d7607f jdk7-b62 57f7e028c7ad1806500ae89eb3f4cd9a51b10e18 jdk7-b63 +269c1ec4435dfb7b452ae6e3bdde005d55c5c830 jdk7-b64 From 9c68af3ff5d74f01a96f872f715b35d3792e81b2 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:47:33 -0700 Subject: [PATCH 45/91] Added tag jdk7-b64 for changeset 444fd06c5063 --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 79ae00977ca..0bb9b5fe667 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -38,3 +38,4 @@ f1e1cccbd13aa96d2d8bd872782ff764010bc22c jdk7-b60 e906b16a12a9a63b615898afa5d9673cbd1c5ab8 jdk7-b61 65b66117dbd70a493e9644aeb4033cf95a4e3c99 jdk7-b62 d20e45cd539f20405ff843652069cfd7550c5ab3 jdk7-b63 +047dd27fddb607f8135296b3754131f6e13cb8c7 jdk7-b64 From 068ac9fe23275f6470aa3a7d48c37b017dd713d7 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:47:36 -0700 Subject: [PATCH 46/91] Added tag jdk7-b64 for changeset 4905b291b676 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 60de6119b89..0e026969a54 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -38,3 +38,4 @@ a77eddcd510c3972717c025cfcef9a60bfa4ecac jdk7-b60 27b728fd1281ab62e9d7e4424f8bbb6ca438d803 jdk7-b61 a88386380bdaaa5ab4ffbedf22c57bac5dbec034 jdk7-b62 32c83fb84370a35344676991a48440378e6b6c8a jdk7-b63 +ba36394eb84b949b31212bdb32a518a8f92bab5b jdk7-b64 From 18605d75a20b130b020b0777abfd6e74554c8ae2 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:47:42 -0700 Subject: [PATCH 47/91] Added tag jdk7-b64 for changeset 5b8a9427ecc5 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index e476b1d9b26..67a0b9e2e17 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -38,3 +38,4 @@ e4851e9f7be26fc52a628be06ffa8aaea0919bd7 jdk7-b57 f1ac756616eaaad795f77f7f5e7f7c7bfdc9c1de jdk7-b61 a97dd57a62604c35c79bc2fa77a612ed547f6135 jdk7-b62 ae449e9c04c1fe651bd30f0f4d4cc24ba794e0c4 jdk7-b63 +a10eec7a1edf536f39b5828d8623054dbc62c2b7 jdk7-b64 From 636adcfc264a5374ca969b49173ca0fecc140d0b Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:47:43 -0700 Subject: [PATCH 48/91] Added tag jdk7-b64 for changeset 9bd8eb50ad5a --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 48104000603..3645edaf091 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -38,3 +38,4 @@ f64566bf4c2bc92e65ab2b9fab51b119f0d493d1 jdk7-b59 aeabf802f2a1ca72b87d7397c5ece58058e000a9 jdk7-b61 75c801c13ea1ddebc58b1a8c8da9318d72750e62 jdk7-b62 b8a6e883c0a6708f6d818815040525d472262495 jdk7-b63 +aaa25dfd3de68c6f1a1d3ef8c45fd99f76bca6dd jdk7-b64 From 5c5306394203e0e4ad9d6a338e193e1fdc1dca94 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:47:51 -0700 Subject: [PATCH 49/91] Added tag jdk7-b64 for changeset 2bd0e908f480 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 78053b178ae..4b9e6d23082 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -38,3 +38,4 @@ d5a1223e961891564de25c39fba6f2442d0fb045 jdk7-b57 f72c0dc047b9b2e797beee68ae0b50decb1f020d jdk7-b61 12e11fab9a839a9666a996a8f9a02fd8fa03aab6 jdk7-b62 2ed6ed6b5bfc7dd724925b90dbb31223df59c25d jdk7-b63 +a50217eb3ee10b9f9547e0708e5c9625405083ef jdk7-b64 From d42a7a68182e4684f8350d85f03bd3da765b5a9c Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Mon, 13 Jul 2009 14:48:01 -0700 Subject: [PATCH 50/91] Added tag jdk7-b64 for changeset 186b38713174 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index ef64c5e5ca5..0bb6612a24f 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -38,3 +38,4 @@ dbdeb4a7581b2a8699644b91cae6793cb01953f7 jdk7-b53 522520757dd34321b27a7145ecbd24ac4fb64f34 jdk7-b61 6855e5aa3348f185fe5b443ee43a1b00ec5d390e jdk7-b62 5c2c8112055565b4980b6756e001e45eb7b88d6e jdk7-b63 +d8f23a81d46f47a4186f1044dd9e44841bbeab84 jdk7-b64 From 5a409d142f945f06bb87ed4c1e6140c59d9f6760 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Mon, 13 Jul 2009 14:58:17 -0700 Subject: [PATCH 51/91] 6859338: amd64 native unverified entry point pushes values before implicit null check Reviewed-by: kvn, twisti --- .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 9 ++-- .../test/compiler/6859338/Test6859338.java | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 hotspot/test/compiler/6859338/Test6859338.java diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 57fa4a480ca..68cb61979db 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1302,22 +1302,19 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, const Register ic_reg = rax; const Register receiver = j_rarg0; - const Register tmp = rdx; Label ok; Label exception_pending; + assert_different_registers(ic_reg, receiver, rscratch1); __ verify_oop(receiver); - __ push(tmp); // spill (any other registers free here???) - __ load_klass(tmp, receiver); - __ cmpq(ic_reg, tmp); + __ load_klass(rscratch1, receiver); + __ cmpq(ic_reg, rscratch1); __ jcc(Assembler::equal, ok); - __ pop(tmp); __ jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub())); __ bind(ok); - __ pop(tmp); // Verified entry point must be aligned __ align(8); diff --git a/hotspot/test/compiler/6859338/Test6859338.java b/hotspot/test/compiler/6859338/Test6859338.java new file mode 100644 index 00000000000..f54e4222a0f --- /dev/null +++ b/hotspot/test/compiler/6859338/Test6859338.java @@ -0,0 +1,51 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +/** + * @test + * @bug 6859338 + * @summary Assertion failure in sharedRuntime.cpp + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter Test6859338 + */ + +public class Test6859338 { + static Object[] o = new Object[] { new Object(), null }; + public static void main(String[] args) { + int total = 0; + try { + // Exercise the implicit null check in the unverified entry point + for (int i = 0; i < 40000; i++) { + int limit = o.length; + if (i < 20000) limit = 1; + for (int j = 0; j < limit; j++) { + total += o[j].hashCode(); + } + } + + } catch (NullPointerException e) { + // this is expected. A true failure causes a crash + } + } +} From fa45d4b2e5bfebd0d1b42e29d599cd7b6fe6abb1 Mon Sep 17 00:00:00 2001 From: Valerie Peng Date: Mon, 13 Jul 2009 15:14:17 -0700 Subject: [PATCH 52/91] 6832540: IllegalArgumentException in ClassLoader.definePackage when classes are loaded in parallel Modified to handle race condition for parallel-capable classloaders by re-trying/re-verifying package Reviewed-by: alanb --- .../classes/java/net/URLClassLoader.java | 64 ++++++++++++------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/jdk/src/share/classes/java/net/URLClassLoader.java b/jdk/src/share/classes/java/net/URLClassLoader.java index 601601a5652..22be20b7ecd 100644 --- a/jdk/src/share/classes/java/net/URLClassLoader.java +++ b/jdk/src/share/classes/java/net/URLClassLoader.java @@ -305,6 +305,35 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { } } + /* + * Retrieve the package using the specified package name. + * If non-null, verify the package using the specified code + * source and manifest. + */ + private Package getAndVerifyPackage(String pkgname, + Manifest man, URL url) { + Package pkg = getPackage(pkgname); + if (pkg != null) { + // Package found, so check package sealing. + if (pkg.isSealed()) { + // Verify that code source URL is the same. + if (!pkg.isSealed(url)) { + throw new SecurityException( + "sealing violation: package " + pkgname + " is sealed"); + } + } else { + // Make sure we are not attempting to seal the package + // at this code source URL. + if ((man != null) && isSealed(pkgname, man)) { + throw new SecurityException( + "sealing violation: can't seal package " + pkgname + + ": already loaded"); + } + } + } + return pkg; + } + /* * Defines a Class using the class bytes obtained from the specified * Resource. The resulting Class must be resolved before it can be @@ -316,32 +345,23 @@ public class URLClassLoader extends SecureClassLoader implements Closeable { if (i != -1) { String pkgname = name.substring(0, i); // Check if package already loaded. - Package pkg = getPackage(pkgname); Manifest man = res.getManifest(); - if (pkg != null) { - // Package found, so check package sealing. - if (pkg.isSealed()) { - // Verify that code source URL is the same. - if (!pkg.isSealed(url)) { - throw new SecurityException( - "sealing violation: package " + pkgname + " is sealed"); + if (getAndVerifyPackage(pkgname, man, url) == null) { + try { + if (man != null) { + definePackage(pkgname, man, url); + } else { + definePackage(pkgname, null, null, null, null, null, null, null); } - - } else { - // Make sure we are not attempting to seal the package - // at this code source URL. - if ((man != null) && isSealed(pkgname, man)) { - throw new SecurityException( - "sealing violation: can't seal package " + pkgname + - ": already loaded"); + } catch (IllegalArgumentException iae) { + // parallel-capable class loaders: re-verify in case of a + // race condition + if (getAndVerifyPackage(pkgname, man, url) == null) { + // Should never happen + throw new AssertionError("Cannot find package " + + pkgname); } } - } else { - if (man != null) { - definePackage(pkgname, man, url); - } else { - definePackage(pkgname, null, null, null, null, null, null, null); - } } } // Now read the class bytes and define the class From 565f4998b5bedcac70e93aa7a893c1baac8bff03 Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Tue, 14 Jul 2009 14:08:47 +0400 Subject: [PATCH 53/91] 6837446: Introduce Window.isOpaque() method Reviewed-by: art, alexp --- .../classes/com/sun/awt/AWTUtilities.java | 2 +- jdk/src/share/classes/java/awt/Component.java | 6 ++-- .../classes/java/awt/GraphicsDevice.java | 4 +-- jdk/src/share/classes/java/awt/Window.java | 30 ++++++++++++++----- .../javax/swing/DefaultDesktopManager.java | 2 +- .../classes/javax/swing/RepaintManager.java | 6 ++-- .../share/classes/sun/awt/AWTAccessor.java | 5 ---- jdk/src/share/classes/sun/awt/SunToolkit.java | 3 +- .../classes/sun/awt/windows/WWindowPeer.java | 3 +- 9 files changed, 34 insertions(+), 27 deletions(-) diff --git a/jdk/src/share/classes/com/sun/awt/AWTUtilities.java b/jdk/src/share/classes/com/sun/awt/AWTUtilities.java index bf0628b4712..6dd292c865e 100644 --- a/jdk/src/share/classes/com/sun/awt/AWTUtilities.java +++ b/jdk/src/share/classes/com/sun/awt/AWTUtilities.java @@ -374,7 +374,7 @@ public final class AWTUtilities { "The window argument should not be null."); } - return AWTAccessor.getWindowAccessor().isOpaque(window); + return window.isOpaque(); } /** diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index e07fbe7c5c7..91347ad1b18 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -2370,12 +2370,10 @@ public abstract class Component implements ImageObserver, MenuContainer, * rectangular region. A non-opaque component paints only some of * its pixels, allowing the pixels underneath it to "show through". * A component that does not fully paint its pixels therefore - * provides a degree of transparency. Only lightweight - * components can be transparent. + * provides a degree of transparency. *

    * Subclasses that guarantee to always completely paint their - * contents should override this method and return true. All - * of the "heavyweight" AWT components are opaque. + * contents should override this method and return true. * * @return true if this component is completely opaque * @see #isLightweight diff --git a/jdk/src/share/classes/java/awt/GraphicsDevice.java b/jdk/src/share/classes/java/awt/GraphicsDevice.java index 3ad45e223aa..58061c6bc66 100644 --- a/jdk/src/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java @@ -281,8 +281,8 @@ public abstract class GraphicsDevice { if (w.getOpacity() < 1.0f) { w.setOpacity(1.0f); } - Color bgColor = w.getBackground(); - if ((bgColor != null) && (bgColor.getAlpha() < 255)) { + if (!w.isOpaque()) { + Color bgColor = w.getBackground(); bgColor = new Color(bgColor.getRed(), bgColor.getGreen(), bgColor.getBlue(), 255); w.setBackground(bgColor); diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 31c94ca77e5..b419c437c9e 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -3521,6 +3521,7 @@ public class Window extends Container implements Accessible { * @return this component's background color * * @see Window#setBackground + * @see Window#isOpaque * @see GraphicsDevice.WindowTranslucency */ @Override @@ -3583,6 +3584,7 @@ public class Window extends Container implements Accessible { * PERPIXEL_TRANSLUCENT} translucency is not supported * * @see Window#getBackground + * @see Window#isOpaque * @see Window#setOpacity() * @see Window#setShape() * @see GraphicsDevice.WindowTranslucency @@ -3623,6 +3625,25 @@ public class Window extends Container implements Accessible { } } + /** + * Indicates if the window is currently opaque. + *

    + * The method returns {@code false} if the background color of the window + * is not {@code null} and the alpha component of the color is less than + * 1.0f. The method returns {@code true} otherwise. + * + * @return {@code true} if the window is opaque, {@code false} otherwise + * + * @see Window#getBackground + * @see Window#setBackground + * @since 1.7 + */ + @Override + public boolean isOpaque() { + Color bg = getBackground(); + return bg != null ? bg.getAlpha() == 255 : true; + } + private void updateWindow() { synchronized (getTreeLock()) { WindowPeer peer = (WindowPeer)getPeer(); @@ -3639,12 +3660,11 @@ public class Window extends Container implements Accessible { */ @Override public void paint(Graphics g) { - Color bgColor = getBackground(); - if ((bgColor != null) && (bgColor.getAlpha() < 255)) { + if (!isOpaque()) { Graphics gg = g.create(); try { if (gg instanceof Graphics2D) { - gg.setColor(bgColor); + gg.setColor(getBackground()); ((Graphics2D)gg).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC)); gg.fillRect(0, 0, getWidth(), getHeight()); } @@ -3749,10 +3769,6 @@ public class Window extends Container implements Accessible { public void setShape(Window window, Shape shape) { window.setShape(shape); } - public boolean isOpaque(Window window) { - Color bg = window.getBackground(); - return (bg != null) ? bg.getAlpha() == 255 : true; - } public void setOpaque(Window window, boolean opaque) { Color bg = window.getBackground(); if (bg == null) { diff --git a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java index 4bf7da1ca23..fc7977df641 100644 --- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java @@ -708,7 +708,7 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab // update window if it's non-opaque Window topLevel = SwingUtilities.getWindowAncestor(f); Toolkit tk = Toolkit.getDefaultToolkit(); - if (!AWTAccessor.getWindowAccessor().isOpaque(topLevel) && + if (!topLevel.isOpaque() && (tk instanceof SunToolkit) && ((SunToolkit)tk).needUpdateWindow()) { diff --git a/jdk/src/share/classes/javax/swing/RepaintManager.java b/jdk/src/share/classes/javax/swing/RepaintManager.java index 618288bd3a0..a988b99fbd3 100644 --- a/jdk/src/share/classes/javax/swing/RepaintManager.java +++ b/jdk/src/share/classes/javax/swing/RepaintManager.java @@ -732,7 +732,7 @@ public class RepaintManager (Window)dirty : SwingUtilities.getWindowAncestor(dirty); if (window != null && - !AWTAccessor.getWindowAccessor().isOpaque(window)) + !window.isOpaque()) { windows.add(window); } @@ -996,7 +996,7 @@ public class RepaintManager // If the window is non-opaque, it's double-buffered at peer's level Window w = (c instanceof Window) ? (Window)c : SwingUtilities.getWindowAncestor(c); - if (!AWTAccessor.getWindowAccessor().isOpaque(w)) { + if (!w.isOpaque()) { Toolkit tk = Toolkit.getDefaultToolkit(); if ((tk instanceof SunToolkit) && (((SunToolkit)tk).needUpdateWindow())) { return null; @@ -1032,7 +1032,7 @@ public class RepaintManager // If the window is non-opaque, it's double-buffered at peer's level Window w = (c instanceof Window) ? (Window)c : SwingUtilities.getWindowAncestor(c); - if (!AWTAccessor.getWindowAccessor().isOpaque(w)) { + if (!w.isOpaque()) { Toolkit tk = Toolkit.getDefaultToolkit(); if ((tk instanceof SunToolkit) && (((SunToolkit)tk).needUpdateWindow())) { return null; diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java index e427b892517..c8bbc860877 100644 --- a/jdk/src/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java @@ -136,11 +136,6 @@ public final class AWTAccessor { * Set a shape to the given window. */ void setShape(Window window, Shape shape); - /* - * Identify whether the given window is opaque (true) - * or translucent (false). - */ - boolean isOpaque(Window window); /* * Set the opaque preoperty to the given window. */ diff --git a/jdk/src/share/classes/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java index 7f0ac590fa0..b4dd06a445c 100644 --- a/jdk/src/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/share/classes/sun/awt/SunToolkit.java @@ -1985,8 +1985,7 @@ public abstract class SunToolkit extends Toolkit */ public static boolean isContainingTopLevelOpaque(Component c) { Window w = getContainingWindow(c); - return w != null && ((Window)w).getBackground() != null && - ((Window)w).getBackground().getAlpha() == 255; + return w != null && w.isOpaque(); } /** diff --git a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java index 165acac4e93..fbb7442ba7d 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -194,8 +194,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, // default value of a boolean field is 'false', so set isOpaque to // true here explicitly this.isOpaque = true; - Color bgColor = ((Window)target).getBackground(); - setOpaque((bgColor == null) || (bgColor.getAlpha() == 255)); + setOpaque(((Window)target).isOpaque()); } } From 075c1335cb63e77ab302f7c6b620bd6eb68a8b4f Mon Sep 17 00:00:00 2001 From: "Y. Srinivas Ramakrishna" Date: Tue, 14 Jul 2009 15:40:39 -0700 Subject: [PATCH 54/91] 6700789: G1: Enable use of compressed oops with G1 heaps Modifications to G1 so as to allow the use of compressed oops. Reviewed-by: apetrusenko, coleenp, jmasa, kvn, never, phh, tonyp --- hotspot/src/cpu/sparc/vm/assembler_sparc.cpp | 7 +- hotspot/src/cpu/x86/vm/assembler_x86.cpp | 13 +- hotspot/src/cpu/x86/vm/methodHandles_x86.cpp | 4 +- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 3 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 10 +- .../g1/bufferingOopClosure.hpp | 90 +- .../gc_implementation/g1/concurrentMark.cpp | 134 +-- .../gc_implementation/g1/concurrentMark.hpp | 1 + .../g1/g1BlockOffsetTable.cpp | 4 +- .../g1/g1BlockOffsetTable.inline.hpp | 6 +- .../gc_implementation/g1/g1CollectedHeap.cpp | 820 +++--------------- .../gc_implementation/g1/g1CollectedHeap.hpp | 556 +++++++++++- .../g1/g1CollectorPolicy.cpp | 4 - .../vm/gc_implementation/g1/g1OopClosures.hpp | 81 +- .../g1/g1OopClosures.inline.hpp | 92 +- .../vm/gc_implementation/g1/g1RemSet.cpp | 56 +- .../vm/gc_implementation/g1/g1RemSet.hpp | 60 +- .../gc_implementation/g1/g1RemSet.inline.hpp | 20 +- .../g1/g1SATBCardTableModRefBS.cpp | 34 +- .../g1/g1SATBCardTableModRefBS.hpp | 34 +- .../vm/gc_implementation/g1/g1_globals.hpp | 3 - .../g1/g1_specialized_oop_closures.hpp | 7 +- .../vm/gc_implementation/g1/heapRegion.cpp | 33 +- .../gc_implementation/g1/heapRegionRemSet.cpp | 61 +- .../gc_implementation/g1/heapRegionRemSet.hpp | 24 +- .../vm/gc_implementation/g1/satbQueue.cpp | 15 +- .../vm/gc_implementation/g1/satbQueue.hpp | 1 + .../vm/gc_implementation/includeDB_gc_g1 | 8 +- .../parNew/parCardTableModRefBS.cpp | 7 +- .../parallelScavenge/parallelScavengeHeap.cpp | 2 +- .../parallelScavenge/parallelScavengeHeap.hpp | 2 +- .../psPromotionManager.inline.hpp | 1 + .../share/vm/gc_interface/collectedHeap.hpp | 2 +- hotspot/src/share/vm/includeDB_core | 14 +- hotspot/src/share/vm/includeDB_features | 6 +- hotspot/src/share/vm/memory/barrierSet.cpp | 23 +- hotspot/src/share/vm/memory/barrierSet.hpp | 15 +- .../src/share/vm/memory/barrierSet.inline.hpp | 4 +- .../src/share/vm/memory/cardTableModRefBS.hpp | 8 +- .../src/share/vm/memory/genCollectedHeap.cpp | 2 +- .../src/share/vm/memory/genCollectedHeap.hpp | 2 +- .../src/share/vm/memory/genOopClosures.hpp | 2 +- .../share/vm/memory/genOopClosures.inline.hpp | 12 +- .../share/vm/memory/referenceProcessor.cpp | 27 +- hotspot/src/share/vm/memory/space.hpp | 1 + hotspot/src/share/vm/memory/universe.cpp | 4 +- hotspot/src/share/vm/memory/universe.hpp | 2 +- .../src/share/vm/oops/instanceRefKlass.cpp | 15 +- hotspot/src/share/vm/oops/objArrayKlass.cpp | 8 +- hotspot/src/share/vm/oops/oop.inline.hpp | 10 +- hotspot/src/share/vm/oops/oopsHierarchy.hpp | 1 + hotspot/src/share/vm/opto/cfgnode.cpp | 2 +- hotspot/src/share/vm/prims/unsafe.cpp | 6 +- hotspot/src/share/vm/runtime/arguments.cpp | 29 +- hotspot/src/share/vm/runtime/safepoint.cpp | 4 +- .../src/share/vm/runtime/sharedRuntime.cpp | 1 + hotspot/src/share/vm/utilities/taskqueue.cpp | 5 + hotspot/src/share/vm/utilities/taskqueue.hpp | 10 +- 58 files changed, 1233 insertions(+), 1175 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp index f2d58782aab..b53cc4f737a 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp @@ -4208,6 +4208,7 @@ void MacroAssembler::g1_write_barrier_pre(Register obj, Register index, int offs PtrQueue::byte_offset_of_active()), tmp); } + // Check on whether to annul. br_on_reg_cond(rc_z, /*annul*/false, Assembler::pt, tmp, filtered); delayed() -> nop(); @@ -4215,13 +4216,13 @@ void MacroAssembler::g1_write_barrier_pre(Register obj, Register index, int offs // satb_log_barrier_work1(tmp, offset); if (index == noreg) { if (Assembler::is_simm13(offset)) { - ld_ptr(obj, offset, tmp); + load_heap_oop(obj, offset, tmp); } else { set(offset, tmp); - ld_ptr(obj, tmp, tmp); + load_heap_oop(obj, tmp, tmp); } } else { - ld_ptr(obj, index, tmp); + load_heap_oop(obj, index, tmp); } // satb_log_barrier_work2(obj, tmp, offset); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 174e542e396..4a67b42b2d1 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -6805,14 +6805,18 @@ void MacroAssembler::g1_write_barrier_pre(Register obj, jcc(Assembler::equal, done); // if (x.f == NULL) goto done; - cmpptr(Address(obj, 0), NULL_WORD); +#ifdef _LP64 + load_heap_oop(tmp2, Address(obj, 0)); +#else + movptr(tmp2, Address(obj, 0)); +#endif + cmpptr(tmp2, (int32_t) NULL_WORD); jcc(Assembler::equal, done); // Can we store original value in the thread's buffer? - LP64_ONLY(movslq(tmp, index);) - movptr(tmp2, Address(obj, 0)); #ifdef _LP64 + movslq(tmp, index); cmpq(tmp, 0); #else cmpl(index, 0); @@ -6834,8 +6838,7 @@ void MacroAssembler::g1_write_barrier_pre(Register obj, if(tosca_live) push(rax); push(obj); #ifdef _LP64 - movq(c_rarg0, Address(obj, 0)); - call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), c_rarg0, r15_thread); + call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), tmp2, r15_thread); #else push(thread); call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), tmp2, thread); diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index 24210bf5dfe..a45af4ad321 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -269,11 +269,11 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, #ifndef PRODUCT void trace_method_handle_stub(const char* adaptername, - oop mh, + oopDesc* mh, intptr_t* entry_sp, intptr_t* saved_sp) { // called as a leaf from native code: do not block the JVM! - printf("MH %s "PTR_FORMAT" "PTR_FORMAT" "INTX_FORMAT"\n", adaptername, mh, entry_sp, entry_sp - saved_sp); + printf("MH %s "PTR_FORMAT" "PTR_FORMAT" "INTX_FORMAT"\n", adaptername, (void*)mh, entry_sp, entry_sp - saved_sp); } #endif //PRODUCT diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index e38fc1d0f1d..3d6ca91a0ea 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -709,7 +709,7 @@ class StubGenerator: public StubCodeGenerator { // // Input: // start - starting address - // end - element count + // count - element count void gen_write_ref_array_pre_barrier(Register start, Register count) { assert_different_registers(start, count); BarrierSet* bs = Universe::heap()->barrier_set(); @@ -757,7 +757,6 @@ class StubGenerator: public StubCodeGenerator { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); __ addptr(rsp, 2*wordSize); __ popa(); - } break; diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index ec322b527d1..6b0731490fd 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -1207,9 +1207,9 @@ class StubGenerator: public StubCodeGenerator { __ pusha(); // push registers (overkill) // must compute element count unless barrier set interface is changed (other platforms supply count) assert_different_registers(start, end, scratch); - __ lea(scratch, Address(end, wordSize)); - __ subptr(scratch, start); - __ shrptr(scratch, LogBytesPerWord); + __ lea(scratch, Address(end, BytesPerHeapOop)); + __ subptr(scratch, start); // subtract start to get #bytes + __ shrptr(scratch, LogBytesPerHeapOop); // convert to element count __ mov(c_rarg0, start); __ mov(c_rarg1, scratch); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); @@ -1225,6 +1225,7 @@ class StubGenerator: public StubCodeGenerator { Label L_loop; __ shrptr(start, CardTableModRefBS::card_shift); + __ addptr(end, BytesPerHeapOop); __ shrptr(end, CardTableModRefBS::card_shift); __ subptr(end, start); // number of bytes to copy @@ -2251,6 +2252,7 @@ class StubGenerator: public StubCodeGenerator { // and report their number to the caller. assert_different_registers(rax, r14_length, count, to, end_to, rcx); __ lea(end_to, to_element_addr); + __ addptr(end_to, -heapOopSize); // make an inclusive end pointer gen_write_ref_array_post_barrier(to, end_to, rscratch1); __ movptr(rax, r14_length); // original oops __ addptr(rax, count); // K = (original - remaining) oops @@ -2259,7 +2261,7 @@ class StubGenerator: public StubCodeGenerator { // Come here on success only. __ BIND(L_do_card_marks); - __ addptr(end_to, -wordSize); // make an inclusive end pointer + __ addptr(end_to, -heapOopSize); // make an inclusive end pointer gen_write_ref_array_post_barrier(to, end_to, rscratch1); __ xorptr(rax, rax); // return 0 on success diff --git a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp index 1124e5d799f..b9283bd57db 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp @@ -42,35 +42,40 @@ protected: BufferLength = 1024 }; - oop *_buffer[BufferLength]; - oop **_buffer_top; - oop **_buffer_curr; + StarTask _buffer[BufferLength]; + StarTask* _buffer_top; + StarTask* _buffer_curr; - OopClosure *_oc; - double _closure_app_seconds; + OopClosure* _oc; + double _closure_app_seconds; void process_buffer () { - double start = os::elapsedTime(); - for (oop **curr = _buffer; curr < _buffer_curr; ++curr) { - _oc->do_oop(*curr); + for (StarTask* curr = _buffer; curr < _buffer_curr; ++curr) { + if (curr->is_narrow()) { + assert(UseCompressedOops, "Error"); + _oc->do_oop((narrowOop*)(*curr)); + } else { + _oc->do_oop((oop*)(*curr)); + } } _buffer_curr = _buffer; _closure_app_seconds += (os::elapsedTime() - start); } -public: - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - virtual void do_oop(oop *p) { + template inline void do_oop_work(T* p) { if (_buffer_curr == _buffer_top) { process_buffer(); } - - *_buffer_curr = p; + StarTask new_ref(p); + *_buffer_curr = new_ref; ++_buffer_curr; } + +public: + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } + void done () { if (_buffer_curr > _buffer) { process_buffer(); @@ -88,18 +93,17 @@ public: class BufferingOopsInGenClosure: public OopsInGenClosure { BufferingOopClosure _boc; OopsInGenClosure* _oc; -public: + protected: + template inline void do_oop_work(T* p) { + assert(generation()->is_in_reserved((void*)p), "Must be in!"); + _boc.do_oop(p); + } + public: BufferingOopsInGenClosure(OopsInGenClosure *oc) : _boc(oc), _oc(oc) {} - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - - virtual void do_oop(oop* p) { - assert(generation()->is_in_reserved(p), "Must be in!"); - _boc.do_oop(p); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } void done() { _boc.done(); @@ -130,14 +134,14 @@ private: BufferLength = 1024 }; - oop *_buffer[BufferLength]; - oop **_buffer_top; - oop **_buffer_curr; + StarTask _buffer[BufferLength]; + StarTask* _buffer_top; + StarTask* _buffer_curr; - HeapRegion *_hr_buffer[BufferLength]; - HeapRegion **_hr_curr; + HeapRegion* _hr_buffer[BufferLength]; + HeapRegion** _hr_curr; - OopsInHeapRegionClosure *_oc; + OopsInHeapRegionClosure* _oc; double _closure_app_seconds; void process_buffer () { @@ -146,15 +150,20 @@ private: "the two lengths should be the same"); double start = os::elapsedTime(); - HeapRegion **hr_curr = _hr_buffer; - HeapRegion *hr_prev = NULL; - for (oop **curr = _buffer; curr < _buffer_curr; ++curr) { - HeapRegion *region = *hr_curr; + HeapRegion** hr_curr = _hr_buffer; + HeapRegion* hr_prev = NULL; + for (StarTask* curr = _buffer; curr < _buffer_curr; ++curr) { + HeapRegion* region = *hr_curr; if (region != hr_prev) { _oc->set_region(region); hr_prev = region; } - _oc->do_oop(*curr); + if (curr->is_narrow()) { + assert(UseCompressedOops, "Error"); + _oc->do_oop((narrowOop*)(*curr)); + } else { + _oc->do_oop((oop*)(*curr)); + } ++hr_curr; } _buffer_curr = _buffer; @@ -163,17 +172,16 @@ private: } public: - virtual void do_oop(narrowOop *p) { - guarantee(false, "NYI"); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } - virtual void do_oop(oop *p) { + template void do_oop_work(T* p) { if (_buffer_curr == _buffer_top) { assert(_hr_curr > _hr_buffer, "_hr_curr should be consistent with _buffer_curr"); process_buffer(); } - - *_buffer_curr = p; + StarTask new_ref(p); + *_buffer_curr = new_ref; ++_buffer_curr; *_hr_curr = _from; ++_hr_curr; diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 20f001d7758..b19b457d0a3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -452,13 +452,10 @@ ConcurrentMark::ConcurrentMark(ReservedSpace rs, _regionStack.allocate(G1MarkRegionStackSize); // Create & start a ConcurrentMark thread. - if (G1ConcMark) { - _cmThread = new ConcurrentMarkThread(this); - assert(cmThread() != NULL, "CM Thread should have been created"); - assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm"); - } else { - _cmThread = NULL; - } + _cmThread = new ConcurrentMarkThread(this); + assert(cmThread() != NULL, "CM Thread should have been created"); + assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm"); + _g1h = G1CollectedHeap::heap(); assert(CGC_lock != NULL, "Where's the CGC_lock?"); assert(_markBitMap1.covers(rs), "_markBitMap1 inconsistency"); @@ -783,18 +780,18 @@ public: bool do_barrier) : _cm(cm), _g1h(g1h), _do_barrier(do_barrier) { } - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { - oop thisOop = *p; - if (thisOop != NULL) { - assert(thisOop->is_oop() || thisOop->mark() == NULL, + template void do_oop_work(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(obj->is_oop() || obj->mark() == NULL, "expected an oop, possibly with mark word displaced"); - HeapWord* addr = (HeapWord*)thisOop; + HeapWord* addr = (HeapWord*)obj; if (_g1h->is_in_g1_reserved(addr)) { - _cm->grayRoot(thisOop); + _cm->grayRoot(obj); } } if (_do_barrier) { @@ -850,16 +847,6 @@ void ConcurrentMark::checkpointRootsInitial() { double start = os::elapsedTime(); GCOverheadReporter::recordSTWStart(start); - // If there has not been a GC[n-1] since last GC[n] cycle completed, - // precede our marking with a collection of all - // younger generations to keep floating garbage to a minimum. - // YSR: we won't do this for now -- it's an optimization to be - // done post-beta. - - // YSR: ignoring weak refs for now; will do at bug fixing stage - // EVM: assert(discoveredRefsAreClear()); - - G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy(); g1p->record_concurrent_mark_init_start(); checkpointRootsInitialPre(); @@ -1135,6 +1122,13 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { return; } + if (VerifyDuringGC) { + HandleMark hm; // handle scope + gclog_or_tty->print(" VerifyDuringGC:(before)"); + Universe::heap()->prepare_for_verify(); + Universe::verify(true, false, true); + } + G1CollectorPolicy* g1p = g1h->g1_policy(); g1p->record_concurrent_mark_remark_start(); @@ -1159,10 +1153,12 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { JavaThread::satb_mark_queue_set().set_active_all_threads(false); if (VerifyDuringGC) { - g1h->prepare_for_verify(); - g1h->verify(/* allow_dirty */ true, - /* silent */ false, - /* use_prev_marking */ false); + HandleMark hm; // handle scope + gclog_or_tty->print(" VerifyDuringGC:(after)"); + Universe::heap()->prepare_for_verify(); + Universe::heap()->verify(/* allow_dirty */ true, + /* silent */ false, + /* use_prev_marking */ false); } } @@ -1658,6 +1654,15 @@ void ConcurrentMark::cleanup() { return; } + if (VerifyDuringGC) { + HandleMark hm; // handle scope + gclog_or_tty->print(" VerifyDuringGC:(before)"); + Universe::heap()->prepare_for_verify(); + Universe::verify(/* allow dirty */ true, + /* silent */ false, + /* prev marking */ true); + } + _cleanup_co_tracker.disable(); G1CollectorPolicy* g1p = G1CollectedHeap::heap()->g1_policy(); @@ -1790,10 +1795,12 @@ void ConcurrentMark::cleanup() { g1h->increment_total_collections(); if (VerifyDuringGC) { - g1h->prepare_for_verify(); - g1h->verify(/* allow_dirty */ true, - /* silent */ false, - /* use_prev_marking */ true); + HandleMark hm; // handle scope + gclog_or_tty->print(" VerifyDuringGC:(after)"); + Universe::heap()->prepare_for_verify(); + Universe::verify(/* allow dirty */ true, + /* silent */ false, + /* prev marking */ true); } } @@ -1852,12 +1859,11 @@ class G1CMKeepAliveClosure: public OopClosure { _g1(g1), _cm(cm), _bitMap(bitMap) {} - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } - void do_oop(oop* p) { - oop thisOop = *p; + template void do_oop_work(T* p) { + oop thisOop = oopDesc::load_decode_heap_oop(p); HeapWord* addr = (HeapWord*)thisOop; if (_g1->is_in_g1_reserved(addr) && _g1->is_obj_ill(thisOop)) { _bitMap->mark(addr); @@ -2016,12 +2022,11 @@ public: ReachablePrinterOopClosure(CMBitMapRO* bitmap, outputStream* out) : _bitmap(bitmap), _g1h(G1CollectedHeap::heap()), _out(out) { } - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } + void do_oop(narrowOop* p) { do_oop_work(p); } + void do_oop( oop* p) { do_oop_work(p); } - void do_oop(oop* p) { - oop obj = *p; + template void do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); const char* str = NULL; const char* str2 = ""; @@ -2163,6 +2168,7 @@ void ConcurrentMark::deal_with_reference(oop obj) { HeapWord* objAddr = (HeapWord*) obj; + assert(obj->is_oop_or_null(true /* ignore mark word */), "Error"); if (_g1h->is_in_g1_reserved(objAddr)) { tmp_guarantee_CM( obj != NULL, "is_in_g1_reserved should ensure this" ); HeapRegion* hr = _g1h->heap_region_containing(obj); @@ -2380,7 +2386,7 @@ class CSMarkOopClosure: public OopClosure { } } - bool drain() { + template bool drain() { while (_ms_ind > 0) { oop obj = pop(); assert(obj != NULL, "Since index was non-zero."); @@ -2394,9 +2400,8 @@ class CSMarkOopClosure: public OopClosure { } // Now process this portion of this one. int lim = MIN2(next_arr_ind, len); - assert(!UseCompressedOops, "This needs to be fixed"); for (int j = arr_ind; j < lim; j++) { - do_oop(aobj->obj_at_addr(j)); + do_oop(aobj->obj_at_addr(j)); } } else { @@ -2423,13 +2428,13 @@ public: FREE_C_HEAP_ARRAY(jint, _array_ind_stack); } - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } - void do_oop(oop* p) { - oop obj = *p; - if (obj == NULL) return; + template void do_oop_work(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (oopDesc::is_null(heap_oop)) return; + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (obj->is_forwarded()) { // If the object has already been forwarded, we have to make sure // that it's marked. So follow the forwarding pointer. Note that @@ -2478,7 +2483,11 @@ public: oop obj = oop(addr); if (!obj->is_forwarded()) { if (!_oop_cl.push(obj)) return false; - if (!_oop_cl.drain()) return false; + if (UseCompressedOops) { + if (!_oop_cl.drain()) return false; + } else { + if (!_oop_cl.drain()) return false; + } } // Otherwise... return true; @@ -2636,9 +2645,6 @@ void ConcurrentMark::disable_co_trackers() { // abandon current marking iteration due to a Full GC void ConcurrentMark::abort() { - // If we're not marking, nothing to do. - if (!G1ConcMark) return; - // Clear all marks to force marking thread to do nothing _nextMarkBitMap->clearAll(); // Empty mark stack @@ -2814,14 +2820,14 @@ private: CMTask* _task; public: - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } - void do_oop(oop* p) { + template void do_oop_work(T* p) { tmp_guarantee_CM( _g1h->is_in_g1_reserved((HeapWord*) p), "invariant" ); + tmp_guarantee_CM( !_g1h->heap_region_containing((HeapWord*) p)->is_on_free_list(), "invariant" ); - oop obj = *p; + oop obj = oopDesc::load_decode_heap_oop(p); if (_cm->verbose_high()) gclog_or_tty->print_cr("[%d] we're looking at location " "*"PTR_FORMAT" = "PTR_FORMAT, @@ -2967,6 +2973,7 @@ void CMTask::deal_with_reference(oop obj) { ++_refs_reached; HeapWord* objAddr = (HeapWord*) obj; + assert(obj->is_oop_or_null(true /* ignore mark word */), "Error"); if (_g1h->is_in_g1_reserved(objAddr)) { tmp_guarantee_CM( obj != NULL, "is_in_g1_reserved should ensure this" ); HeapRegion* hr = _g1h->heap_region_containing(obj); @@ -3030,6 +3037,7 @@ void CMTask::deal_with_reference(oop obj) { void CMTask::push(oop obj) { HeapWord* objAddr = (HeapWord*) obj; tmp_guarantee_CM( _g1h->is_in_g1_reserved(objAddr), "invariant" ); + tmp_guarantee_CM( !_g1h->heap_region_containing(objAddr)->is_on_free_list(), "invariant" ); tmp_guarantee_CM( !_g1h->is_obj_ill(obj), "invariant" ); tmp_guarantee_CM( _nextMarkBitMap->isMarked(objAddr), "invariant" ); @@ -3275,6 +3283,8 @@ void CMTask::drain_local_queue(bool partially) { tmp_guarantee_CM( _g1h->is_in_g1_reserved((HeapWord*) obj), "invariant" ); + tmp_guarantee_CM( !_g1h->heap_region_containing(obj)->is_on_free_list(), + "invariant" ); scan_object(obj); diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp index 274f8c19e6e..85477175ff7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp @@ -763,6 +763,7 @@ private: CMBitMap* _nextMarkBitMap; // the task queue of this task CMTaskQueue* _task_queue; +private: // the task queue set---needed for stealing CMTaskQueueSet* _task_queues; // indicates whether the task has been claimed---this is only for diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp index eddbf86d999..978367af7ae 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp @@ -424,7 +424,7 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, while (n <= next_boundary) { q = n; oop obj = oop(q); - if (obj->klass() == NULL) return q; + if (obj->klass_or_null() == NULL) return q; n += obj->size(); } assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); @@ -436,7 +436,7 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, while (n <= next_boundary) { q = n; oop obj = oop(q); - if (obj->klass() == NULL) return q; + if (obj->klass_or_null() == NULL) return q; n += _sp->block_size(q); } assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp index 45e148532c4..23f75e66aba 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp @@ -96,14 +96,14 @@ forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, while (n <= addr) { q = n; oop obj = oop(q); - if (obj->klass() == NULL) return q; + if (obj->klass_or_null() == NULL) return q; n += obj->size(); } } else { while (n <= addr) { q = n; oop obj = oop(q); - if (obj->klass() == NULL) return q; + if (obj->klass_or_null() == NULL) return q; n += _sp->block_size(q); } } @@ -115,7 +115,7 @@ forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, inline HeapWord* G1BlockOffsetArray::forward_to_block_containing_addr(HeapWord* q, const void* addr) { - if (oop(q)->klass() == NULL) return q; + if (oop(q)->klass_or_null() == NULL) return q; HeapWord* n = q + _sp->block_size(q); // In the normal case, where the query "addr" is a card boundary, and the // offset table chunks are the same size as cards, the block starting at diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index a42ace5ecac..f7c53a71873 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -1655,11 +1655,14 @@ void G1CollectedHeap::iterate_dirty_card_closure(bool concurrent, // Computes the sum of the storage used by the various regions. size_t G1CollectedHeap::used() const { - assert(Heap_lock->owner() != NULL, - "Should be owned on this thread's behalf."); + // Temporarily, until 6859911 is fixed. XXX + // assert(Heap_lock->owner() != NULL, + // "Should be owned on this thread's behalf."); size_t result = _summary_bytes_used; - if (_cur_alloc_region != NULL) - result += _cur_alloc_region->used(); + // Read only once in case it is set to NULL concurrently + HeapRegion* hr = _cur_alloc_region; + if (hr != NULL) + result += hr->used(); return result; } @@ -2133,13 +2136,13 @@ public: VerifyLivenessOopClosure(G1CollectedHeap* _g1h) { g1h = _g1h; } - void do_oop(narrowOop *p) { - guarantee(false, "NYI"); - } - void do_oop(oop *p) { - oop obj = *p; - assert(obj == NULL || !g1h->is_obj_dead(obj), - "Dead object referenced by a not dead object"); + void do_oop(narrowOop *p) { do_oop_work(p); } + void do_oop( oop *p) { do_oop_work(p); } + + template void do_oop_work(T *p) { + oop obj = oopDesc::load_decode_heap_oop(p); + guarantee(obj == NULL || !g1h->is_obj_dead(obj), + "Dead object referenced by a not dead object"); } }; @@ -2206,8 +2209,10 @@ public: // use_prev_marking == true -> use "prev" marking information, // use_prev_marking == false -> use "next" marking information VerifyRegionClosure(bool allow_dirty, bool par, bool use_prev_marking) - : _allow_dirty(allow_dirty), _par(par), + : _allow_dirty(allow_dirty), + _par(par), _use_prev_marking(use_prev_marking) {} + bool doHeapRegion(HeapRegion* r) { guarantee(_par || r->claim_value() == HeapRegion::InitialClaimValue, "Should be unclaimed at verify points."); @@ -2231,18 +2236,16 @@ public: // use_prev_marking == true -> use "prev" marking information, // use_prev_marking == false -> use "next" marking information VerifyRootsClosure(bool use_prev_marking) : - _g1h(G1CollectedHeap::heap()), _failures(false), + _g1h(G1CollectedHeap::heap()), + _failures(false), _use_prev_marking(use_prev_marking) { } bool failures() { return _failures; } - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - - void do_oop(oop* p) { - oop obj = *p; - if (obj != NULL) { + template void do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (_g1h->is_obj_dead_cond(obj, _use_prev_marking)) { gclog_or_tty->print_cr("Root location "PTR_FORMAT" " "points to dead obj "PTR_FORMAT, p, (void*) obj); @@ -2251,6 +2254,9 @@ public: } } } + + void do_oop(oop* p) { do_oop_nv(p); } + void do_oop(narrowOop* p) { do_oop_nv(p); } }; // This is the task used for parallel heap verification. @@ -2267,7 +2273,8 @@ public: G1ParVerifyTask(G1CollectedHeap* g1h, bool allow_dirty, bool use_prev_marking) : AbstractGangTask("Parallel verify task"), - _g1h(g1h), _allow_dirty(allow_dirty), + _g1h(g1h), + _allow_dirty(allow_dirty), _use_prev_marking(use_prev_marking) { } void work(int worker_i) { @@ -2479,12 +2486,10 @@ void G1CollectedHeap::do_collection_pause() { void G1CollectedHeap::doConcurrentMark() { - if (G1ConcMark) { - MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); - if (!_cmThread->in_progress()) { - _cmThread->set_started(); - CGC_lock->notify(); - } + MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); + if (!_cmThread->in_progress()) { + _cmThread->set_started(); + CGC_lock->notify(); } } @@ -2561,9 +2566,11 @@ G1CollectedHeap::setup_surviving_young_words() { "Not enough space for young surv words summary."); } memset(_surviving_young_words, 0, array_length * sizeof(size_t)); +#ifdef ASSERT for (size_t i = 0; i < array_length; ++i) { - guarantee( _surviving_young_words[i] == 0, "invariant" ); + assert( _surviving_young_words[i] == 0, "memset above" ); } +#endif // !ASSERT } void @@ -2649,7 +2656,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { COMPILER2_PRESENT(DerivedPointerTable::clear()); // We want to turn off ref discovery, if necessary, and turn it back on - // on again later if we do. + // on again later if we do. XXX Dubious: why is discovery disabled? bool was_enabled = ref_processor()->discovery_enabled(); if (was_enabled) ref_processor()->disable_discovery(); @@ -2662,9 +2669,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { double start_time_sec = os::elapsedTime(); GCOverheadReporter::recordSTWStart(start_time_sec); size_t start_used_bytes = used(); - if (!G1ConcMark) { - do_sync_mark(); - } g1_policy()->record_collection_pause_start(start_time_sec, start_used_bytes); @@ -2775,6 +2779,13 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { g1_policy()->should_initiate_conc_mark()) { concurrent_mark()->checkpointRootsInitialPost(); set_marking_started(); + // CAUTION: after the doConcurrentMark() call below, + // the concurrent marking thread(s) could be running + // concurrently with us. Make sure that anything after + // this point does not assume that we are the only GC thread + // running. Note: of course, the actual marking work will + // not start until the safepoint itself is released in + // ConcurrentGCThread::safepoint_desynchronize(). doConcurrentMark(); } @@ -3123,10 +3134,8 @@ class G1KeepAliveClosure: public OopClosure { G1CollectedHeap* _g1; public: G1KeepAliveClosure(G1CollectedHeap* g1) : _g1(g1) {} - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - void do_oop(oop* p) { + void do_oop(narrowOop* p) { guarantee(false, "Not needed"); } + void do_oop( oop* p) { oop obj = *p; #ifdef G1_DEBUG if (PrintGC && Verbose) { @@ -3138,7 +3147,6 @@ public: if (_g1->obj_in_cs(obj)) { assert( obj->is_forwarded(), "invariant" ); *p = obj->forwardee(); - #ifdef G1_DEBUG gclog_or_tty->print_cr(" in CSet: moved "PTR_FORMAT" -> "PTR_FORMAT, (void*) obj, (void*) *p); @@ -3155,12 +3163,12 @@ public: UpdateRSetImmediate(G1CollectedHeap* g1) : _g1(g1), _g1_rem_set(g1->g1_rem_set()) {} - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - void do_oop(oop* p) { + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } + template void do_oop_work(T* p) { assert(_from->is_in_reserved(p), "paranoia"); - if (*p != NULL && !_from->is_survivor()) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop) && !_from->is_survivor()) { _g1_rem_set->par_write_ref(_from, p, 0); } } @@ -3176,12 +3184,12 @@ public: UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) : _g1(g1), _ct_bs((CardTableModRefBS*)_g1->barrier_set()), _dcq(dcq) {} - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - void do_oop(oop* p) { + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } + template void do_oop_work(T* p) { assert(_from->is_in_reserved(p), "paranoia"); - if (!_from->is_in_reserved(*p) && !_from->is_survivor()) { + if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && + !_from->is_survivor()) { size_t card_index = _ct_bs->index_for(p); if (_ct_bs->mark_card_deferred(card_index)) { _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index)); @@ -3536,614 +3544,66 @@ void G1CollectedHeap::par_allocate_remaining_space(HeapRegion* r) { fill_with_object(block, free_words); } -#define use_local_bitmaps 1 -#define verify_local_bitmaps 0 - #ifndef PRODUCT - -class GCLabBitMap; -class GCLabBitMapClosure: public BitMapClosure { -private: - ConcurrentMark* _cm; - GCLabBitMap* _bitmap; - -public: - GCLabBitMapClosure(ConcurrentMark* cm, - GCLabBitMap* bitmap) { - _cm = cm; - _bitmap = bitmap; - } - - virtual bool do_bit(size_t offset); -}; - -#endif // PRODUCT - -#define oop_buffer_length 256 - -class GCLabBitMap: public BitMap { -private: - ConcurrentMark* _cm; - - int _shifter; - size_t _bitmap_word_covers_words; - - // beginning of the heap - HeapWord* _heap_start; - - // this is the actual start of the GCLab - HeapWord* _real_start_word; - - // this is the actual end of the GCLab - HeapWord* _real_end_word; - - // this is the first word, possibly located before the actual start - // of the GCLab, that corresponds to the first bit of the bitmap - HeapWord* _start_word; - - // size of a GCLab in words - size_t _gclab_word_size; - - static int shifter() { - return MinObjAlignment - 1; - } - - // how many heap words does a single bitmap word corresponds to? - static size_t bitmap_word_covers_words() { - return BitsPerWord << shifter(); - } - - static size_t gclab_word_size() { - return G1ParallelGCAllocBufferSize / HeapWordSize; - } - - static size_t bitmap_size_in_bits() { - size_t bits_in_bitmap = gclab_word_size() >> shifter(); - // We are going to ensure that the beginning of a word in this - // bitmap also corresponds to the beginning of a word in the - // global marking bitmap. To handle the case where a GCLab - // starts from the middle of the bitmap, we need to add enough - // space (i.e. up to a bitmap word) to ensure that we have - // enough bits in the bitmap. - return bits_in_bitmap + BitsPerWord - 1; - } -public: - GCLabBitMap(HeapWord* heap_start) - : BitMap(bitmap_size_in_bits()), - _cm(G1CollectedHeap::heap()->concurrent_mark()), - _shifter(shifter()), - _bitmap_word_covers_words(bitmap_word_covers_words()), - _heap_start(heap_start), - _gclab_word_size(gclab_word_size()), - _real_start_word(NULL), - _real_end_word(NULL), - _start_word(NULL) - { - guarantee( size_in_words() >= bitmap_size_in_words(), - "just making sure"); - } - - inline unsigned heapWordToOffset(HeapWord* addr) { - unsigned offset = (unsigned) pointer_delta(addr, _start_word) >> _shifter; - assert(offset < size(), "offset should be within bounds"); - return offset; - } - - inline HeapWord* offsetToHeapWord(size_t offset) { - HeapWord* addr = _start_word + (offset << _shifter); - assert(_real_start_word <= addr && addr < _real_end_word, "invariant"); - return addr; - } - - bool fields_well_formed() { - bool ret1 = (_real_start_word == NULL) && - (_real_end_word == NULL) && - (_start_word == NULL); - if (ret1) - return true; - - bool ret2 = _real_start_word >= _start_word && - _start_word < _real_end_word && - (_real_start_word + _gclab_word_size) == _real_end_word && - (_start_word + _gclab_word_size + _bitmap_word_covers_words) - > _real_end_word; - return ret2; - } - - inline bool mark(HeapWord* addr) { - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - if (addr >= _real_start_word && addr < _real_end_word) { - assert(!isMarked(addr), "should not have already been marked"); - - // first mark it on the bitmap - at_put(heapWordToOffset(addr), true); - - return true; - } else { - return false; - } - } - - inline bool isMarked(HeapWord* addr) { - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - return at(heapWordToOffset(addr)); - } - - void set_buffer(HeapWord* start) { - guarantee(use_local_bitmaps, "invariant"); - clear(); - - assert(start != NULL, "invariant"); - _real_start_word = start; - _real_end_word = start + _gclab_word_size; - - size_t diff = - pointer_delta(start, _heap_start) % _bitmap_word_covers_words; - _start_word = start - diff; - - assert(fields_well_formed(), "invariant"); - } - -#ifndef PRODUCT - void verify() { - // verify that the marks have been propagated - GCLabBitMapClosure cl(_cm, this); - iterate(&cl); - } -#endif // PRODUCT - - void retire() { - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - if (_start_word != NULL) { - CMBitMap* mark_bitmap = _cm->nextMarkBitMap(); - - // this means that the bitmap was set up for the GCLab - assert(_real_start_word != NULL && _real_end_word != NULL, "invariant"); - - mark_bitmap->mostly_disjoint_range_union(this, - 0, // always start from the start of the bitmap - _start_word, - size_in_words()); - _cm->grayRegionIfNecessary(MemRegion(_real_start_word, _real_end_word)); - -#ifndef PRODUCT - if (use_local_bitmaps && verify_local_bitmaps) - verify(); -#endif // PRODUCT - } else { - assert(_real_start_word == NULL && _real_end_word == NULL, "invariant"); - } - } - - static size_t bitmap_size_in_words() { - return (bitmap_size_in_bits() + BitsPerWord - 1) / BitsPerWord; - } -}; - -#ifndef PRODUCT - bool GCLabBitMapClosure::do_bit(size_t offset) { HeapWord* addr = _bitmap->offsetToHeapWord(offset); guarantee(_cm->isMarked(oop(addr)), "it should be!"); return true; } - #endif // PRODUCT -class G1ParGCAllocBuffer: public ParGCAllocBuffer { -private: - bool _retired; - bool _during_marking; - GCLabBitMap _bitmap; - -public: - G1ParGCAllocBuffer() : - ParGCAllocBuffer(G1ParallelGCAllocBufferSize / HeapWordSize), - _during_marking(G1CollectedHeap::heap()->mark_in_progress()), - _bitmap(G1CollectedHeap::heap()->reserved_region().start()), - _retired(false) - { } - - inline bool mark(HeapWord* addr) { - guarantee(use_local_bitmaps, "invariant"); - assert(_during_marking, "invariant"); - return _bitmap.mark(addr); - } - - inline void set_buf(HeapWord* buf) { - if (use_local_bitmaps && _during_marking) - _bitmap.set_buffer(buf); - ParGCAllocBuffer::set_buf(buf); - _retired = false; - } - - inline void retire(bool end_of_gc, bool retain) { - if (_retired) - return; - if (use_local_bitmaps && _during_marking) { - _bitmap.retire(); - } - ParGCAllocBuffer::retire(end_of_gc, retain); - _retired = true; - } -}; - - -class G1ParScanThreadState : public StackObj { -protected: - G1CollectedHeap* _g1h; - RefToScanQueue* _refs; - DirtyCardQueue _dcq; - CardTableModRefBS* _ct_bs; - G1RemSet* _g1_rem; - - typedef GrowableArray OverflowQueue; - OverflowQueue* _overflowed_refs; - - G1ParGCAllocBuffer _alloc_buffers[GCAllocPurposeCount]; - ageTable _age_table; - - size_t _alloc_buffer_waste; - size_t _undo_waste; - - OopsInHeapRegionClosure* _evac_failure_cl; - G1ParScanHeapEvacClosure* _evac_cl; - G1ParScanPartialArrayClosure* _partial_scan_cl; - - int _hash_seed; - int _queue_num; - - int _term_attempts; +G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, int queue_num) + : _g1h(g1h), + _refs(g1h->task_queue(queue_num)), + _dcq(&g1h->dirty_card_queue_set()), + _ct_bs((CardTableModRefBS*)_g1h->barrier_set()), + _g1_rem(g1h->g1_rem_set()), + _hash_seed(17), _queue_num(queue_num), + _term_attempts(0), + _age_table(false), #if G1_DETAILED_STATS - int _pushes, _pops, _steals, _steal_attempts; - int _overflow_pushes; + _pushes(0), _pops(0), _steals(0), + _steal_attempts(0), _overflow_pushes(0), #endif + _strong_roots_time(0), _term_time(0), + _alloc_buffer_waste(0), _undo_waste(0) +{ + // we allocate G1YoungSurvRateNumRegions plus one entries, since + // we "sacrifice" entry 0 to keep track of surviving bytes for + // non-young regions (where the age is -1) + // We also add a few elements at the beginning and at the end in + // an attempt to eliminate cache contention + size_t real_length = 1 + _g1h->g1_policy()->young_cset_length(); + size_t array_length = PADDING_ELEM_NUM + + real_length + + PADDING_ELEM_NUM; + _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length); + if (_surviving_young_words_base == NULL) + vm_exit_out_of_memory(array_length * sizeof(size_t), + "Not enough space for young surv histo."); + _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; + memset(_surviving_young_words, 0, real_length * sizeof(size_t)); - double _start; - double _start_strong_roots; - double _strong_roots_time; - double _start_term; - double _term_time; + _overflowed_refs = new OverflowQueue(10); - // Map from young-age-index (0 == not young, 1 is youngest) to - // surviving words. base is what we get back from the malloc call - size_t* _surviving_young_words_base; - // this points into the array, as we use the first few entries for padding - size_t* _surviving_young_words; - -#define PADDING_ELEM_NUM (64 / sizeof(size_t)) - - void add_to_alloc_buffer_waste(size_t waste) { _alloc_buffer_waste += waste; } - - void add_to_undo_waste(size_t waste) { _undo_waste += waste; } - - DirtyCardQueue& dirty_card_queue() { return _dcq; } - CardTableModRefBS* ctbs() { return _ct_bs; } - - void immediate_rs_update(HeapRegion* from, oop* p, int tid) { - if (!from->is_survivor()) { - _g1_rem->par_write_ref(from, p, tid); - } - } - - void deferred_rs_update(HeapRegion* from, oop* p, int tid) { - // If the new value of the field points to the same region or - // is the to-space, we don't need to include it in the Rset updates. - if (!from->is_in_reserved(*p) && !from->is_survivor()) { - size_t card_index = ctbs()->index_for(p); - // If the card hasn't been added to the buffer, do it. - if (ctbs()->mark_card_deferred(card_index)) { - dirty_card_queue().enqueue((jbyte*)ctbs()->byte_for_index(card_index)); - } - } - } - -public: - G1ParScanThreadState(G1CollectedHeap* g1h, int queue_num) - : _g1h(g1h), - _refs(g1h->task_queue(queue_num)), - _dcq(&g1h->dirty_card_queue_set()), - _ct_bs((CardTableModRefBS*)_g1h->barrier_set()), - _g1_rem(g1h->g1_rem_set()), - _hash_seed(17), _queue_num(queue_num), - _term_attempts(0), - _age_table(false), -#if G1_DETAILED_STATS - _pushes(0), _pops(0), _steals(0), - _steal_attempts(0), _overflow_pushes(0), -#endif - _strong_roots_time(0), _term_time(0), - _alloc_buffer_waste(0), _undo_waste(0) - { - // we allocate G1YoungSurvRateNumRegions plus one entries, since - // we "sacrifice" entry 0 to keep track of surviving bytes for - // non-young regions (where the age is -1) - // We also add a few elements at the beginning and at the end in - // an attempt to eliminate cache contention - size_t real_length = 1 + _g1h->g1_policy()->young_cset_length(); - size_t array_length = PADDING_ELEM_NUM + - real_length + - PADDING_ELEM_NUM; - _surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length); - if (_surviving_young_words_base == NULL) - vm_exit_out_of_memory(array_length * sizeof(size_t), - "Not enough space for young surv histo."); - _surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM; - memset(_surviving_young_words, 0, real_length * sizeof(size_t)); - - _overflowed_refs = new OverflowQueue(10); - - _start = os::elapsedTime(); - } - - ~G1ParScanThreadState() { - FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base); - } - - RefToScanQueue* refs() { return _refs; } - OverflowQueue* overflowed_refs() { return _overflowed_refs; } - ageTable* age_table() { return &_age_table; } - - G1ParGCAllocBuffer* alloc_buffer(GCAllocPurpose purpose) { - return &_alloc_buffers[purpose]; - } - - size_t alloc_buffer_waste() { return _alloc_buffer_waste; } - size_t undo_waste() { return _undo_waste; } - - void push_on_queue(oop* ref) { - assert(ref != NULL, "invariant"); - assert(has_partial_array_mask(ref) || _g1h->obj_in_cs(*ref), "invariant"); - - if (!refs()->push(ref)) { - overflowed_refs()->push(ref); - IF_G1_DETAILED_STATS(note_overflow_push()); - } else { - IF_G1_DETAILED_STATS(note_push()); - } - } - - void pop_from_queue(oop*& ref) { - if (!refs()->pop_local(ref)) { - ref = NULL; - } else { - assert(ref != NULL, "invariant"); - assert(has_partial_array_mask(ref) || _g1h->obj_in_cs(*ref), - "invariant"); - - IF_G1_DETAILED_STATS(note_pop()); - } - } - - void pop_from_overflow_queue(oop*& ref) { - ref = overflowed_refs()->pop(); - } - - int refs_to_scan() { return refs()->size(); } - int overflowed_refs_to_scan() { return overflowed_refs()->length(); } - - void update_rs(HeapRegion* from, oop* p, int tid) { - if (G1DeferredRSUpdate) { - deferred_rs_update(from, p, tid); - } else { - immediate_rs_update(from, p, tid); - } - } - - HeapWord* allocate_slow(GCAllocPurpose purpose, size_t word_sz) { - - HeapWord* obj = NULL; - if (word_sz * 100 < - (size_t)(G1ParallelGCAllocBufferSize / HeapWordSize) * - ParallelGCBufferWastePct) { - G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose); - add_to_alloc_buffer_waste(alloc_buf->words_remaining()); - alloc_buf->retire(false, false); - - HeapWord* buf = - _g1h->par_allocate_during_gc(purpose, G1ParallelGCAllocBufferSize / HeapWordSize); - if (buf == NULL) return NULL; // Let caller handle allocation failure. - // Otherwise. - alloc_buf->set_buf(buf); - - obj = alloc_buf->allocate(word_sz); - assert(obj != NULL, "buffer was definitely big enough..."); - } else { - obj = _g1h->par_allocate_during_gc(purpose, word_sz); - } - return obj; - } - - HeapWord* allocate(GCAllocPurpose purpose, size_t word_sz) { - HeapWord* obj = alloc_buffer(purpose)->allocate(word_sz); - if (obj != NULL) return obj; - return allocate_slow(purpose, word_sz); - } - - void undo_allocation(GCAllocPurpose purpose, HeapWord* obj, size_t word_sz) { - if (alloc_buffer(purpose)->contains(obj)) { - guarantee(alloc_buffer(purpose)->contains(obj + word_sz - 1), - "should contain whole object"); - alloc_buffer(purpose)->undo_allocation(obj, word_sz); - } else { - CollectedHeap::fill_with_object(obj, word_sz); - add_to_undo_waste(word_sz); - } - } - - void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) { - _evac_failure_cl = evac_failure_cl; - } - OopsInHeapRegionClosure* evac_failure_closure() { - return _evac_failure_cl; - } - - void set_evac_closure(G1ParScanHeapEvacClosure* evac_cl) { - _evac_cl = evac_cl; - } - - void set_partial_scan_closure(G1ParScanPartialArrayClosure* partial_scan_cl) { - _partial_scan_cl = partial_scan_cl; - } - - int* hash_seed() { return &_hash_seed; } - int queue_num() { return _queue_num; } - - int term_attempts() { return _term_attempts; } - void note_term_attempt() { _term_attempts++; } - -#if G1_DETAILED_STATS - int pushes() { return _pushes; } - int pops() { return _pops; } - int steals() { return _steals; } - int steal_attempts() { return _steal_attempts; } - int overflow_pushes() { return _overflow_pushes; } - - void note_push() { _pushes++; } - void note_pop() { _pops++; } - void note_steal() { _steals++; } - void note_steal_attempt() { _steal_attempts++; } - void note_overflow_push() { _overflow_pushes++; } -#endif - - void start_strong_roots() { - _start_strong_roots = os::elapsedTime(); - } - void end_strong_roots() { - _strong_roots_time += (os::elapsedTime() - _start_strong_roots); - } - double strong_roots_time() { return _strong_roots_time; } - - void start_term_time() { - note_term_attempt(); - _start_term = os::elapsedTime(); - } - void end_term_time() { - _term_time += (os::elapsedTime() - _start_term); - } - double term_time() { return _term_time; } - - double elapsed() { - return os::elapsedTime() - _start; - } - - size_t* surviving_young_words() { - // We add on to hide entry 0 which accumulates surviving words for - // age -1 regions (i.e. non-young ones) - return _surviving_young_words; - } - - void retire_alloc_buffers() { - for (int ap = 0; ap < GCAllocPurposeCount; ++ap) { - size_t waste = _alloc_buffers[ap].words_remaining(); - add_to_alloc_buffer_waste(waste); - _alloc_buffers[ap].retire(true, false); - } - } - -private: - void deal_with_reference(oop* ref_to_scan) { - if (has_partial_array_mask(ref_to_scan)) { - _partial_scan_cl->do_oop_nv(ref_to_scan); - } else { - // Note: we can use "raw" versions of "region_containing" because - // "obj_to_scan" is definitely in the heap, and is not in a - // humongous region. - HeapRegion* r = _g1h->heap_region_containing_raw(ref_to_scan); - _evac_cl->set_region(r); - _evac_cl->do_oop_nv(ref_to_scan); - } - } - -public: - void trim_queue() { - // I've replicated the loop twice, first to drain the overflow - // queue, second to drain the task queue. This is better than - // having a single loop, which checks both conditions and, inside - // it, either pops the overflow queue or the task queue, as each - // loop is tighter. Also, the decision to drain the overflow queue - // first is not arbitrary, as the overflow queue is not visible - // to the other workers, whereas the task queue is. So, we want to - // drain the "invisible" entries first, while allowing the other - // workers to potentially steal the "visible" entries. - - while (refs_to_scan() > 0 || overflowed_refs_to_scan() > 0) { - while (overflowed_refs_to_scan() > 0) { - oop *ref_to_scan = NULL; - pop_from_overflow_queue(ref_to_scan); - assert(ref_to_scan != NULL, "invariant"); - // We shouldn't have pushed it on the queue if it was not - // pointing into the CSet. - assert(ref_to_scan != NULL, "sanity"); - assert(has_partial_array_mask(ref_to_scan) || - _g1h->obj_in_cs(*ref_to_scan), "sanity"); - - deal_with_reference(ref_to_scan); - } - - while (refs_to_scan() > 0) { - oop *ref_to_scan = NULL; - pop_from_queue(ref_to_scan); - - if (ref_to_scan != NULL) { - // We shouldn't have pushed it on the queue if it was not - // pointing into the CSet. - assert(has_partial_array_mask(ref_to_scan) || - _g1h->obj_in_cs(*ref_to_scan), "sanity"); - - deal_with_reference(ref_to_scan); - } - } - } - } -}; + _start = os::elapsedTime(); +} G1ParClosureSuper::G1ParClosureSuper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : _g1(g1), _g1_rem(_g1->g1_rem_set()), _cm(_g1->concurrent_mark()), _par_scan_state(par_scan_state) { } -// This closure is applied to the fields of the objects that have just been copied. -// Should probably be made inline and moved in g1OopClosures.inline.hpp. -void G1ParScanClosure::do_oop_nv(oop* p) { - oop obj = *p; - - if (obj != NULL) { - if (_g1->in_cset_fast_test(obj)) { - // We're not going to even bother checking whether the object is - // already forwarded or not, as this usually causes an immediate - // stall. We'll try to prefetch the object (for write, given that - // we might need to install the forwarding reference) and we'll - // get back to it when pop it from the queue - Prefetch::write(obj->mark_addr(), 0); - Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); - - // slightly paranoid test; I'm trying to catch potential - // problems before we go into push_on_queue to know where the - // problem is coming from - assert(obj == *p, "the value of *p should not have changed"); - _par_scan_state->push_on_queue(p); - } else { - _par_scan_state->update_rs(_from, p, _par_scan_state->queue_num()); - } - } -} - -void G1ParCopyHelper::mark_forwardee(oop* p) { +template void G1ParCopyHelper::mark_forwardee(T* p) { // This is called _after_ do_oop_work has been called, hence after // the object has been relocated to its new location and *p points // to its new location. - oop thisOop = *p; - if (thisOop != NULL) { - assert((_g1->evacuation_failed()) || (!_g1->obj_in_cs(thisOop)), + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop(heap_oop); + assert((_g1->evacuation_failed()) || (!_g1->obj_in_cs(obj)), "shouldn't still be in the CSet if evacuation didn't fail."); - HeapWord* addr = (HeapWord*)thisOop; + HeapWord* addr = (HeapWord*)obj; if (_g1->is_in_g1_reserved(addr)) _cm->grayRoot(oop(addr)); } @@ -4226,7 +3686,8 @@ oop G1ParCopyHelper::copy_to_survivor_space(oop old) { if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) { arrayOop(old)->set_length(0); - _par_scan_state->push_on_queue(set_partial_array_mask(old)); + oop* old_p = set_partial_array_mask(old); + _par_scan_state->push_on_queue(old_p); } else { // No point in using the slower heap_region_containing() method, // given that we know obj is in the heap. @@ -4240,11 +3701,11 @@ oop G1ParCopyHelper::copy_to_survivor_space(oop old) { return obj; } -template -void G1ParCopyClosure::do_oop_work(oop* p) { - oop obj = *p; +template +template +void G1ParCopyClosure +::do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); assert(barrier != G1BarrierRS || obj != NULL, "Precondition: G1BarrierRS implies obj is nonNull"); @@ -4261,9 +3722,10 @@ void G1ParCopyClosureis_forwarded()) { - *p = obj->forwardee(); + oopDesc::encode_store_heap_oop(p, obj->forwardee()); } else { - *p = copy_to_survivor_space(obj); + oop copy_oop = copy_to_survivor_space(obj); + oopDesc::encode_store_heap_oop(p, copy_oop); } // When scanning the RS, we only care about objs in CS. if (barrier == G1BarrierRS) { @@ -4282,21 +3744,9 @@ void G1ParCopyClosure::do_oop_work(oop* p); +template void G1ParCopyClosure::do_oop_work(narrowOop* p); -template void G1ParScanPartialArrayClosure::process_array_chunk( - oop obj, int start, int end) { - // process our set of indices (include header in first chunk) - assert(start < end, "invariant"); - T* const base = (T*)objArrayOop(obj)->base(); - T* const start_addr = (start == 0) ? (T*) obj : base + start; - T* const end_addr = base + end; - MemRegion mr((HeapWord*)start_addr, (HeapWord*)end_addr); - _scanner.set_region(_g1->heap_region_containing(obj)); - obj->oop_iterate(&_scanner, mr); -} - -void G1ParScanPartialArrayClosure::do_oop_nv(oop* p) { - assert(!UseCompressedOops, "Needs to be fixed to work with compressed oops"); +template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(has_partial_array_mask(p), "invariant"); oop old = clear_partial_array_mask(p); assert(old->is_objArray(), "must be obj array"); @@ -4316,19 +3766,19 @@ void G1ParScanPartialArrayClosure::do_oop_nv(oop* p) { end = start + ParGCArrayScanChunk; arrayOop(old)->set_length(end); // Push remainder. - _par_scan_state->push_on_queue(set_partial_array_mask(old)); + oop* old_p = set_partial_array_mask(old); + assert(arrayOop(old)->length() < obj->length(), "Empty push?"); + _par_scan_state->push_on_queue(old_p); } else { // Restore length so that the heap remains parsable in // case of evacuation failure. arrayOop(old)->set_length(end); } - + _scanner.set_region(_g1->heap_region_containing_raw(obj)); // process our set of indices (include header in first chunk) - process_array_chunk(obj, start, end); + obj->oop_iterate_range(&_scanner, start, end); } -int G1ScanAndBalanceClosure::_nq = 0; - class G1ParEvacuateFollowersClosure : public VoidClosure { protected: G1CollectedHeap* _g1h; @@ -4351,21 +3801,28 @@ public: void do_void() { G1ParScanThreadState* pss = par_scan_state(); while (true) { - oop* ref_to_scan; pss->trim_queue(); IF_G1_DETAILED_STATS(pss->note_steal_attempt()); - if (queues()->steal(pss->queue_num(), - pss->hash_seed(), - ref_to_scan)) { + + StarTask stolen_task; + if (queues()->steal(pss->queue_num(), pss->hash_seed(), stolen_task)) { IF_G1_DETAILED_STATS(pss->note_steal()); // slightly paranoid tests; I'm trying to catch potential // problems before we go into push_on_queue to know where the // problem is coming from - assert(ref_to_scan != NULL, "invariant"); - assert(has_partial_array_mask(ref_to_scan) || - _g1h->obj_in_cs(*ref_to_scan), "invariant"); - pss->push_on_queue(ref_to_scan); + assert((oop*)stolen_task != NULL, "Error"); + if (stolen_task.is_narrow()) { + assert(UseCompressedOops, "Error"); + narrowOop* p = (narrowOop*) stolen_task; + assert(has_partial_array_mask(p) || + _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "Error"); + pss->push_on_queue(p); + } else { + oop* p = (oop*) stolen_task; + assert(has_partial_array_mask(p) || _g1h->obj_in_cs(*p), "Error"); + pss->push_on_queue(p); + } continue; } pss->start_term_time(); @@ -4382,6 +3839,7 @@ protected: G1CollectedHeap* _g1h; RefToScanQueueSet *_queues; ParallelTaskTerminator _terminator; + int _n_workers; Mutex _stats_lock; Mutex* stats_lock() { return &_stats_lock; } @@ -4397,7 +3855,8 @@ public: _g1h(g1h), _queues(task_queues), _terminator(workers, _queues), - _stats_lock(Mutex::leaf, "parallel G1 stats lock", true) + _stats_lock(Mutex::leaf, "parallel G1 stats lock", true), + _n_workers(workers) {} RefToScanQueueSet* queues() { return _queues; } @@ -4407,6 +3866,7 @@ public: } void work(int i) { + if (i >= _n_workers) return; // no work needed this round ResourceMark rm; HandleMark hm; @@ -4504,23 +3964,6 @@ public: // *** Common G1 Evacuation Stuff -class G1CountClosure: public OopsInHeapRegionClosure { -public: - int n; - G1CountClosure() : n(0) {} - void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - void do_oop(oop* p) { - oop obj = *p; - assert(obj != NULL && G1CollectedHeap::heap()->obj_in_cs(obj), - "Rem set closure called on non-rem-set pointer."); - n++; - } -}; - -static G1CountClosure count_closure; - void G1CollectedHeap:: g1_process_strong_roots(bool collecting_perm_gen, @@ -5570,8 +5013,3 @@ bool G1CollectedHeap::is_in_closed_subset(const void* p) const { void G1CollectedHeap::g1_unimplemented() { // Unimplemented(); } - - -// Local Variables: *** -// c-indentation-style: gnu *** -// End: *** diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 82cfc8488f3..3dc60175986 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -56,8 +56,8 @@ class ConcurrentZFThread; # define IF_G1_DETAILED_STATS(code) #endif -typedef GenericTaskQueue RefToScanQueue; -typedef GenericTaskQueueSet RefToScanQueueSet; +typedef GenericTaskQueue RefToScanQueue; +typedef GenericTaskQueueSet RefToScanQueueSet; typedef int RegionIdx_t; // needs to hold [ 0..max_regions() ) typedef int CardIdx_t; // needs to hold [ 0..CardsPerRegion ) @@ -1271,6 +1271,552 @@ public: }; -// Local Variables: *** -// c-indentation-style: gnu *** -// End: *** +#define use_local_bitmaps 1 +#define verify_local_bitmaps 0 +#define oop_buffer_length 256 + +#ifndef PRODUCT +class GCLabBitMap; +class GCLabBitMapClosure: public BitMapClosure { +private: + ConcurrentMark* _cm; + GCLabBitMap* _bitmap; + +public: + GCLabBitMapClosure(ConcurrentMark* cm, + GCLabBitMap* bitmap) { + _cm = cm; + _bitmap = bitmap; + } + + virtual bool do_bit(size_t offset); +}; +#endif // !PRODUCT + +class GCLabBitMap: public BitMap { +private: + ConcurrentMark* _cm; + + int _shifter; + size_t _bitmap_word_covers_words; + + // beginning of the heap + HeapWord* _heap_start; + + // this is the actual start of the GCLab + HeapWord* _real_start_word; + + // this is the actual end of the GCLab + HeapWord* _real_end_word; + + // this is the first word, possibly located before the actual start + // of the GCLab, that corresponds to the first bit of the bitmap + HeapWord* _start_word; + + // size of a GCLab in words + size_t _gclab_word_size; + + static int shifter() { + return MinObjAlignment - 1; + } + + // how many heap words does a single bitmap word corresponds to? + static size_t bitmap_word_covers_words() { + return BitsPerWord << shifter(); + } + + static size_t gclab_word_size() { + return G1ParallelGCAllocBufferSize / HeapWordSize; + } + + static size_t bitmap_size_in_bits() { + size_t bits_in_bitmap = gclab_word_size() >> shifter(); + // We are going to ensure that the beginning of a word in this + // bitmap also corresponds to the beginning of a word in the + // global marking bitmap. To handle the case where a GCLab + // starts from the middle of the bitmap, we need to add enough + // space (i.e. up to a bitmap word) to ensure that we have + // enough bits in the bitmap. + return bits_in_bitmap + BitsPerWord - 1; + } +public: + GCLabBitMap(HeapWord* heap_start) + : BitMap(bitmap_size_in_bits()), + _cm(G1CollectedHeap::heap()->concurrent_mark()), + _shifter(shifter()), + _bitmap_word_covers_words(bitmap_word_covers_words()), + _heap_start(heap_start), + _gclab_word_size(gclab_word_size()), + _real_start_word(NULL), + _real_end_word(NULL), + _start_word(NULL) + { + guarantee( size_in_words() >= bitmap_size_in_words(), + "just making sure"); + } + + inline unsigned heapWordToOffset(HeapWord* addr) { + unsigned offset = (unsigned) pointer_delta(addr, _start_word) >> _shifter; + assert(offset < size(), "offset should be within bounds"); + return offset; + } + + inline HeapWord* offsetToHeapWord(size_t offset) { + HeapWord* addr = _start_word + (offset << _shifter); + assert(_real_start_word <= addr && addr < _real_end_word, "invariant"); + return addr; + } + + bool fields_well_formed() { + bool ret1 = (_real_start_word == NULL) && + (_real_end_word == NULL) && + (_start_word == NULL); + if (ret1) + return true; + + bool ret2 = _real_start_word >= _start_word && + _start_word < _real_end_word && + (_real_start_word + _gclab_word_size) == _real_end_word && + (_start_word + _gclab_word_size + _bitmap_word_covers_words) + > _real_end_word; + return ret2; + } + + inline bool mark(HeapWord* addr) { + guarantee(use_local_bitmaps, "invariant"); + assert(fields_well_formed(), "invariant"); + + if (addr >= _real_start_word && addr < _real_end_word) { + assert(!isMarked(addr), "should not have already been marked"); + + // first mark it on the bitmap + at_put(heapWordToOffset(addr), true); + + return true; + } else { + return false; + } + } + + inline bool isMarked(HeapWord* addr) { + guarantee(use_local_bitmaps, "invariant"); + assert(fields_well_formed(), "invariant"); + + return at(heapWordToOffset(addr)); + } + + void set_buffer(HeapWord* start) { + guarantee(use_local_bitmaps, "invariant"); + clear(); + + assert(start != NULL, "invariant"); + _real_start_word = start; + _real_end_word = start + _gclab_word_size; + + size_t diff = + pointer_delta(start, _heap_start) % _bitmap_word_covers_words; + _start_word = start - diff; + + assert(fields_well_formed(), "invariant"); + } + +#ifndef PRODUCT + void verify() { + // verify that the marks have been propagated + GCLabBitMapClosure cl(_cm, this); + iterate(&cl); + } +#endif // PRODUCT + + void retire() { + guarantee(use_local_bitmaps, "invariant"); + assert(fields_well_formed(), "invariant"); + + if (_start_word != NULL) { + CMBitMap* mark_bitmap = _cm->nextMarkBitMap(); + + // this means that the bitmap was set up for the GCLab + assert(_real_start_word != NULL && _real_end_word != NULL, "invariant"); + + mark_bitmap->mostly_disjoint_range_union(this, + 0, // always start from the start of the bitmap + _start_word, + size_in_words()); + _cm->grayRegionIfNecessary(MemRegion(_real_start_word, _real_end_word)); + +#ifndef PRODUCT + if (use_local_bitmaps && verify_local_bitmaps) + verify(); +#endif // PRODUCT + } else { + assert(_real_start_word == NULL && _real_end_word == NULL, "invariant"); + } + } + + static size_t bitmap_size_in_words() { + return (bitmap_size_in_bits() + BitsPerWord - 1) / BitsPerWord; + } +}; + +class G1ParGCAllocBuffer: public ParGCAllocBuffer { +private: + bool _retired; + bool _during_marking; + GCLabBitMap _bitmap; + +public: + G1ParGCAllocBuffer() : + ParGCAllocBuffer(G1ParallelGCAllocBufferSize / HeapWordSize), + _during_marking(G1CollectedHeap::heap()->mark_in_progress()), + _bitmap(G1CollectedHeap::heap()->reserved_region().start()), + _retired(false) + { } + + inline bool mark(HeapWord* addr) { + guarantee(use_local_bitmaps, "invariant"); + assert(_during_marking, "invariant"); + return _bitmap.mark(addr); + } + + inline void set_buf(HeapWord* buf) { + if (use_local_bitmaps && _during_marking) + _bitmap.set_buffer(buf); + ParGCAllocBuffer::set_buf(buf); + _retired = false; + } + + inline void retire(bool end_of_gc, bool retain) { + if (_retired) + return; + if (use_local_bitmaps && _during_marking) { + _bitmap.retire(); + } + ParGCAllocBuffer::retire(end_of_gc, retain); + _retired = true; + } +}; + +class G1ParScanThreadState : public StackObj { +protected: + G1CollectedHeap* _g1h; + RefToScanQueue* _refs; + DirtyCardQueue _dcq; + CardTableModRefBS* _ct_bs; + G1RemSet* _g1_rem; + + typedef GrowableArray OverflowQueue; + OverflowQueue* _overflowed_refs; + + G1ParGCAllocBuffer _alloc_buffers[GCAllocPurposeCount]; + ageTable _age_table; + + size_t _alloc_buffer_waste; + size_t _undo_waste; + + OopsInHeapRegionClosure* _evac_failure_cl; + G1ParScanHeapEvacClosure* _evac_cl; + G1ParScanPartialArrayClosure* _partial_scan_cl; + + int _hash_seed; + int _queue_num; + + int _term_attempts; +#if G1_DETAILED_STATS + int _pushes, _pops, _steals, _steal_attempts; + int _overflow_pushes; +#endif + + double _start; + double _start_strong_roots; + double _strong_roots_time; + double _start_term; + double _term_time; + + // Map from young-age-index (0 == not young, 1 is youngest) to + // surviving words. base is what we get back from the malloc call + size_t* _surviving_young_words_base; + // this points into the array, as we use the first few entries for padding + size_t* _surviving_young_words; + +#define PADDING_ELEM_NUM (64 / sizeof(size_t)) + + void add_to_alloc_buffer_waste(size_t waste) { _alloc_buffer_waste += waste; } + + void add_to_undo_waste(size_t waste) { _undo_waste += waste; } + + DirtyCardQueue& dirty_card_queue() { return _dcq; } + CardTableModRefBS* ctbs() { return _ct_bs; } + + template void immediate_rs_update(HeapRegion* from, T* p, int tid) { + if (!from->is_survivor()) { + _g1_rem->par_write_ref(from, p, tid); + } + } + + template void deferred_rs_update(HeapRegion* from, T* p, int tid) { + // If the new value of the field points to the same region or + // is the to-space, we don't need to include it in the Rset updates. + if (!from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && !from->is_survivor()) { + size_t card_index = ctbs()->index_for(p); + // If the card hasn't been added to the buffer, do it. + if (ctbs()->mark_card_deferred(card_index)) { + dirty_card_queue().enqueue((jbyte*)ctbs()->byte_for_index(card_index)); + } + } + } + +public: + G1ParScanThreadState(G1CollectedHeap* g1h, int queue_num); + + ~G1ParScanThreadState() { + FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_base); + } + + RefToScanQueue* refs() { return _refs; } + OverflowQueue* overflowed_refs() { return _overflowed_refs; } + ageTable* age_table() { return &_age_table; } + + G1ParGCAllocBuffer* alloc_buffer(GCAllocPurpose purpose) { + return &_alloc_buffers[purpose]; + } + + size_t alloc_buffer_waste() { return _alloc_buffer_waste; } + size_t undo_waste() { return _undo_waste; } + + template void push_on_queue(T* ref) { + assert(ref != NULL, "invariant"); + assert(has_partial_array_mask(ref) || + _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(ref)), "invariant"); +#ifdef ASSERT + if (has_partial_array_mask(ref)) { + oop p = clear_partial_array_mask(ref); + // Verify that we point into the CS + assert(_g1h->obj_in_cs(p), "Should be in CS"); + } +#endif + if (!refs()->push(ref)) { + overflowed_refs()->push(ref); + IF_G1_DETAILED_STATS(note_overflow_push()); + } else { + IF_G1_DETAILED_STATS(note_push()); + } + } + + void pop_from_queue(StarTask& ref) { + if (refs()->pop_local(ref)) { + assert((oop*)ref != NULL, "pop_local() returned true"); + assert(UseCompressedOops || !ref.is_narrow(), "Error"); + assert(has_partial_array_mask((oop*)ref) || + _g1h->obj_in_cs(ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)ref) + : oopDesc::load_decode_heap_oop((oop*)ref)), + "invariant"); + IF_G1_DETAILED_STATS(note_pop()); + } else { + StarTask null_task; + ref = null_task; + } + } + + void pop_from_overflow_queue(StarTask& ref) { + StarTask new_ref = overflowed_refs()->pop(); + assert((oop*)new_ref != NULL, "pop() from a local non-empty stack"); + assert(UseCompressedOops || !new_ref.is_narrow(), "Error"); + assert(has_partial_array_mask((oop*)new_ref) || + _g1h->obj_in_cs(new_ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)new_ref) + : oopDesc::load_decode_heap_oop((oop*)new_ref)), + "invariant"); + ref = new_ref; + } + + int refs_to_scan() { return refs()->size(); } + int overflowed_refs_to_scan() { return overflowed_refs()->length(); } + + template void update_rs(HeapRegion* from, T* p, int tid) { + if (G1DeferredRSUpdate) { + deferred_rs_update(from, p, tid); + } else { + immediate_rs_update(from, p, tid); + } + } + + HeapWord* allocate_slow(GCAllocPurpose purpose, size_t word_sz) { + + HeapWord* obj = NULL; + if (word_sz * 100 < + (size_t)(G1ParallelGCAllocBufferSize / HeapWordSize) * + ParallelGCBufferWastePct) { + G1ParGCAllocBuffer* alloc_buf = alloc_buffer(purpose); + add_to_alloc_buffer_waste(alloc_buf->words_remaining()); + alloc_buf->retire(false, false); + + HeapWord* buf = + _g1h->par_allocate_during_gc(purpose, G1ParallelGCAllocBufferSize / HeapWordSize); + if (buf == NULL) return NULL; // Let caller handle allocation failure. + // Otherwise. + alloc_buf->set_buf(buf); + + obj = alloc_buf->allocate(word_sz); + assert(obj != NULL, "buffer was definitely big enough..."); + } else { + obj = _g1h->par_allocate_during_gc(purpose, word_sz); + } + return obj; + } + + HeapWord* allocate(GCAllocPurpose purpose, size_t word_sz) { + HeapWord* obj = alloc_buffer(purpose)->allocate(word_sz); + if (obj != NULL) return obj; + return allocate_slow(purpose, word_sz); + } + + void undo_allocation(GCAllocPurpose purpose, HeapWord* obj, size_t word_sz) { + if (alloc_buffer(purpose)->contains(obj)) { + assert(alloc_buffer(purpose)->contains(obj + word_sz - 1), + "should contain whole object"); + alloc_buffer(purpose)->undo_allocation(obj, word_sz); + } else { + CollectedHeap::fill_with_object(obj, word_sz); + add_to_undo_waste(word_sz); + } + } + + void set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_cl) { + _evac_failure_cl = evac_failure_cl; + } + OopsInHeapRegionClosure* evac_failure_closure() { + return _evac_failure_cl; + } + + void set_evac_closure(G1ParScanHeapEvacClosure* evac_cl) { + _evac_cl = evac_cl; + } + + void set_partial_scan_closure(G1ParScanPartialArrayClosure* partial_scan_cl) { + _partial_scan_cl = partial_scan_cl; + } + + int* hash_seed() { return &_hash_seed; } + int queue_num() { return _queue_num; } + + int term_attempts() { return _term_attempts; } + void note_term_attempt() { _term_attempts++; } + +#if G1_DETAILED_STATS + int pushes() { return _pushes; } + int pops() { return _pops; } + int steals() { return _steals; } + int steal_attempts() { return _steal_attempts; } + int overflow_pushes() { return _overflow_pushes; } + + void note_push() { _pushes++; } + void note_pop() { _pops++; } + void note_steal() { _steals++; } + void note_steal_attempt() { _steal_attempts++; } + void note_overflow_push() { _overflow_pushes++; } +#endif + + void start_strong_roots() { + _start_strong_roots = os::elapsedTime(); + } + void end_strong_roots() { + _strong_roots_time += (os::elapsedTime() - _start_strong_roots); + } + double strong_roots_time() { return _strong_roots_time; } + + void start_term_time() { + note_term_attempt(); + _start_term = os::elapsedTime(); + } + void end_term_time() { + _term_time += (os::elapsedTime() - _start_term); + } + double term_time() { return _term_time; } + + double elapsed() { + return os::elapsedTime() - _start; + } + + size_t* surviving_young_words() { + // We add on to hide entry 0 which accumulates surviving words for + // age -1 regions (i.e. non-young ones) + return _surviving_young_words; + } + + void retire_alloc_buffers() { + for (int ap = 0; ap < GCAllocPurposeCount; ++ap) { + size_t waste = _alloc_buffers[ap].words_remaining(); + add_to_alloc_buffer_waste(waste); + _alloc_buffers[ap].retire(true, false); + } + } + +private: + template void deal_with_reference(T* ref_to_scan) { + if (has_partial_array_mask(ref_to_scan)) { + _partial_scan_cl->do_oop_nv(ref_to_scan); + } else { + // Note: we can use "raw" versions of "region_containing" because + // "obj_to_scan" is definitely in the heap, and is not in a + // humongous region. + HeapRegion* r = _g1h->heap_region_containing_raw(ref_to_scan); + _evac_cl->set_region(r); + _evac_cl->do_oop_nv(ref_to_scan); + } + } + +public: + void trim_queue() { + // I've replicated the loop twice, first to drain the overflow + // queue, second to drain the task queue. This is better than + // having a single loop, which checks both conditions and, inside + // it, either pops the overflow queue or the task queue, as each + // loop is tighter. Also, the decision to drain the overflow queue + // first is not arbitrary, as the overflow queue is not visible + // to the other workers, whereas the task queue is. So, we want to + // drain the "invisible" entries first, while allowing the other + // workers to potentially steal the "visible" entries. + + while (refs_to_scan() > 0 || overflowed_refs_to_scan() > 0) { + while (overflowed_refs_to_scan() > 0) { + StarTask ref_to_scan; + assert((oop*)ref_to_scan == NULL, "Constructed above"); + pop_from_overflow_queue(ref_to_scan); + // We shouldn't have pushed it on the queue if it was not + // pointing into the CSet. + assert((oop*)ref_to_scan != NULL, "Follows from inner loop invariant"); + if (ref_to_scan.is_narrow()) { + assert(UseCompressedOops, "Error"); + narrowOop* p = (narrowOop*)ref_to_scan; + assert(!has_partial_array_mask(p) && + _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + deal_with_reference(p); + } else { + oop* p = (oop*)ref_to_scan; + assert((has_partial_array_mask(p) && _g1h->obj_in_cs(clear_partial_array_mask(p))) || + _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + deal_with_reference(p); + } + } + + while (refs_to_scan() > 0) { + StarTask ref_to_scan; + assert((oop*)ref_to_scan == NULL, "Constructed above"); + pop_from_queue(ref_to_scan); + if ((oop*)ref_to_scan != NULL) { + if (ref_to_scan.is_narrow()) { + assert(UseCompressedOops, "Error"); + narrowOop* p = (narrowOop*)ref_to_scan; + assert(!has_partial_array_mask(p) && + _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + deal_with_reference(p); + } else { + oop* p = (oop*)ref_to_scan; + assert((has_partial_array_mask(p) && _g1h->obj_in_cs(clear_partial_array_mask(p))) || + _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + deal_with_reference(p); + } + } + } + } + } +}; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 2833cd704f0..bb219c59c28 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -293,10 +293,6 @@ void G1CollectorPolicy::init() { if (G1SteadyStateUsed < 50) { vm_exit_during_initialization("G1SteadyStateUsed must be at least 50%."); } - if (UseConcMarkSweepGC) { - vm_exit_during_initialization("-XX:+UseG1GC is incompatible with " - "-XX:+UseConcMarkSweepGC."); - } initialize_gc_policy_counters(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp index 1619770a663..f710203a1e9 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp @@ -42,18 +42,6 @@ public: virtual void set_region(HeapRegion* from) { _from = from; } }; - -class G1ScanAndBalanceClosure : public OopClosure { - G1CollectedHeap* _g1; - static int _nq; -public: - G1ScanAndBalanceClosure(G1CollectedHeap* g1) : _g1(g1) { } - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p) { guarantee(false, "NYI"); } -}; - class G1ParClosureSuper : public OopsInHeapRegionClosure { protected: G1CollectedHeap* _g1; @@ -69,34 +57,32 @@ class G1ParScanClosure : public G1ParClosureSuper { public: G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : G1ParClosureSuper(g1, par_scan_state) { } - void do_oop_nv(oop* p); // should be made inline - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_nv(T* p); virtual void do_oop(oop* p) { do_oop_nv(p); } virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -#define G1_PARTIAL_ARRAY_MASK 1 +#define G1_PARTIAL_ARRAY_MASK 0x2 -inline bool has_partial_array_mask(oop* ref) { - return (intptr_t) ref & G1_PARTIAL_ARRAY_MASK; +template inline bool has_partial_array_mask(T* ref) { + return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK; } -inline oop* set_partial_array_mask(oop obj) { - return (oop*) ((intptr_t) obj | G1_PARTIAL_ARRAY_MASK); +template inline T* set_partial_array_mask(T obj) { + assert(((uintptr_t)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!"); + return (T*) ((uintptr_t)obj | G1_PARTIAL_ARRAY_MASK); } -inline oop clear_partial_array_mask(oop* ref) { - return oop((intptr_t) ref & ~G1_PARTIAL_ARRAY_MASK); +template inline oop clear_partial_array_mask(T* ref) { + return oop((intptr_t)ref & ~G1_PARTIAL_ARRAY_MASK); } class G1ParScanPartialArrayClosure : public G1ParClosureSuper { G1ParScanClosure _scanner; - template void process_array_chunk(oop obj, int start, int end); public: G1ParScanPartialArrayClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : G1ParClosureSuper(g1, par_scan_state), _scanner(g1, par_scan_state) { } - void do_oop_nv(oop* p); - void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_nv(T* p); virtual void do_oop(oop* p) { do_oop_nv(p); } virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; @@ -105,7 +91,7 @@ public: class G1ParCopyHelper : public G1ParClosureSuper { G1ParScanClosure *_scanner; protected: - void mark_forwardee(oop* p); + template void mark_forwardee(T* p); oop copy_to_survivor_space(oop obj); public: G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state, @@ -117,36 +103,35 @@ template class G1ParCopyClosure : public G1ParCopyHelper { G1ParScanClosure _scanner; - void do_oop_work(oop* p); - void do_oop_work(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_work(T* p); public: G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : _scanner(g1, par_scan_state), G1ParCopyHelper(g1, par_scan_state, &_scanner) { } - inline void do_oop_nv(oop* p) { + template void do_oop_nv(T* p) { do_oop_work(p); if (do_mark_forwardee) mark_forwardee(p); } - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } virtual void do_oop(oop* p) { do_oop_nv(p); } virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; typedef G1ParCopyClosure G1ParScanExtRootClosure; typedef G1ParCopyClosure G1ParScanPermClosure; +typedef G1ParCopyClosure G1ParScanHeapRSClosure; typedef G1ParCopyClosure G1ParScanAndMarkExtRootClosure; typedef G1ParCopyClosure G1ParScanAndMarkPermClosure; -typedef G1ParCopyClosure G1ParScanHeapRSClosure; typedef G1ParCopyClosure G1ParScanAndMarkHeapRSClosure; // This is the only case when we set skip_cset_test. Basically, this // closure is (should?) only be called directly while we're draining // the overflow and task queues. In that case we know that the // reference in question points into the collection set, otherwise we -// would not have pushed it on the queue. -typedef G1ParCopyClosure G1ParScanHeapEvacClosure; +// would not have pushed it on the queue. The following is defined in +// g1_specialized_oop_closures.hpp. +// typedef G1ParCopyClosure G1ParScanHeapEvacClosure; // We need a separate closure to handle references during evacuation -// failure processing, as it cannot asume that the reference already - // points to the collection set (like G1ParScanHeapEvacClosure does). +// failure processing, as we cannot asume that the reference already +// points into the collection set (like G1ParScanHeapEvacClosure does). typedef G1ParCopyClosure G1ParScanHeapEvacFailureClosure; class FilterIntoCSClosure: public OopClosure { @@ -158,10 +143,9 @@ public: G1CollectedHeap* g1, OopClosure* oc) : _dcto_cl(dcto_cl), _g1(g1), _oc(oc) {} - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_nv(T* p); + virtual void do_oop(oop* p) { do_oop_nv(p); } + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } bool apply_to_weak_ref_discovered_field() { return true; } bool do_header() { return false; } }; @@ -174,10 +158,9 @@ public: OopsInHeapRegionClosure* oc) : _g1(g1), _oc(oc) {} - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_nv(T* p); + virtual void do_oop(oop* p) { do_oop_nv(p); } + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } bool apply_to_weak_ref_discovered_field() { return true; } bool do_header() { return false; } void set_region(HeapRegion* from) { @@ -195,10 +178,9 @@ public: ConcurrentMark* cm) : _g1(g1), _oc(oc), _cm(cm) { } - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_nv(T* p); + virtual void do_oop(oop* p) { do_oop_nv(p); } + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } bool apply_to_weak_ref_discovered_field() { return true; } bool do_header() { return false; } void set_region(HeapRegion* from) { @@ -213,10 +195,9 @@ class FilterOutOfRegionClosure: public OopClosure { int _out_of_region; public: FilterOutOfRegionClosure(HeapRegion* r, OopClosure* oc); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p) { guarantee(false, "NYI"); } - virtual void do_oop(oop* p); - virtual void do_oop(narrowOop* p) { guarantee(false, "NYI"); } + template void do_oop_nv(T* p); + virtual void do_oop(oop* p) { do_oop_nv(p); } + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } bool apply_to_weak_ref_discovered_field() { return true; } bool do_header() { return false; } int out_of_region() { return _out_of_region; } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp index fdca16083fc..2ba92a7f8d3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp @@ -31,9 +31,10 @@ // perf-critical inner loop. #define FILTERINTOCSCLOSURE_DOHISTOGRAMCOUNT 0 -inline void FilterIntoCSClosure::do_oop_nv(oop* p) { - oop obj = *p; - if (obj != NULL && _g1->obj_in_cs(obj)) { +template inline void FilterIntoCSClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop) && + _g1->obj_in_cs(oopDesc::decode_heap_oop_not_null(heap_oop))) { _oc->do_oop(p); #if FILTERINTOCSCLOSURE_DOHISTOGRAMCOUNT _dcto_cl->incr_count(); @@ -41,44 +42,32 @@ inline void FilterIntoCSClosure::do_oop_nv(oop* p) { } } -inline void FilterIntoCSClosure::do_oop(oop* p) -{ - do_oop_nv(p); -} - #define FILTEROUTOFREGIONCLOSURE_DOHISTOGRAMCOUNT 0 -inline void FilterOutOfRegionClosure::do_oop_nv(oop* p) { - oop obj = *p; - HeapWord* obj_hw = (HeapWord*)obj; - if (obj_hw != NULL && (obj_hw < _r_bottom || obj_hw >= _r_end)) { - _oc->do_oop(p); +template inline void FilterOutOfRegionClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + HeapWord* obj_hw = (HeapWord*)oopDesc::decode_heap_oop_not_null(heap_oop); + if (obj_hw < _r_bottom || obj_hw >= _r_end) { + _oc->do_oop(p); #if FILTEROUTOFREGIONCLOSURE_DOHISTOGRAMCOUNT - _out_of_region++; + _out_of_region++; #endif + } } } -inline void FilterOutOfRegionClosure::do_oop(oop* p) -{ - do_oop_nv(p); -} - -inline void FilterInHeapRegionAndIntoCSClosure::do_oop_nv(oop* p) { - oop obj = *p; - if (obj != NULL && _g1->obj_in_cs(obj)) +template inline void FilterInHeapRegionAndIntoCSClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop) && + _g1->obj_in_cs(oopDesc::decode_heap_oop_not_null(heap_oop))) _oc->do_oop(p); } -inline void FilterInHeapRegionAndIntoCSClosure::do_oop(oop* p) -{ - do_oop_nv(p); -} - - -inline void FilterAndMarkInHeapRegionAndIntoCSClosure::do_oop_nv(oop* p) { - oop obj = *p; - if (obj != NULL) { +template inline void FilterAndMarkInHeapRegionAndIntoCSClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); HeapRegion* hr = _g1->heap_region_containing((HeapWord*) obj); if (hr != NULL) { if (hr->in_collection_set()) @@ -89,24 +78,29 @@ inline void FilterAndMarkInHeapRegionAndIntoCSClosure::do_oop_nv(oop* p) { } } -inline void FilterAndMarkInHeapRegionAndIntoCSClosure::do_oop(oop* p) -{ - do_oop_nv(p); -} +// This closure is applied to the fields of the objects that have just been copied. +template inline void G1ParScanClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); -inline void G1ScanAndBalanceClosure::do_oop_nv(oop* p) { - RefToScanQueue* q; - if (ParallelGCThreads > 0) { - // Deal the work out equally. - _nq = (_nq + 1) % ParallelGCThreads; - q = _g1->task_queue(_nq); - } else { - q = _g1->task_queue(0); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + if (_g1->in_cset_fast_test(obj)) { + // We're not going to even bother checking whether the object is + // already forwarded or not, as this usually causes an immediate + // stall. We'll try to prefetch the object (for write, given that + // we might need to install the forwarding reference) and we'll + // get back to it when pop it from the queue + Prefetch::write(obj->mark_addr(), 0); + Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); + + // slightly paranoid test; I'm trying to catch potential + // problems before we go into push_on_queue to know where the + // problem is coming from + assert(obj == oopDesc::load_decode_heap_oop(p), + "p should still be pointing to obj"); + _par_scan_state->push_on_queue(p); + } else { + _par_scan_state->update_rs(_from, p, _par_scan_state->queue_num()); + } } - bool nooverflow = q->push(p); - guarantee(nooverflow, "Overflow during poplularity region processing"); -} - -inline void G1ScanAndBalanceClosure::do_oop(oop* p) { - do_oop_nv(p); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index 86a39a7f0a8..9c36026174e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -65,11 +65,10 @@ public: void set_region(HeapRegion* from) { _blk->set_region(from); } - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - virtual void do_oop(oop* p) { - oop obj = *p; + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } + template void do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); if (_g1->obj_in_cs(obj)) _blk->do_oop(p); } bool apply_to_weak_ref_discovered_field() { return true; } @@ -110,11 +109,10 @@ class VerifyRSCleanCardOopClosure: public OopClosure { public: VerifyRSCleanCardOopClosure(G1CollectedHeap* g1) : _g1(g1) {} - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - virtual void do_oop(oop* p) { - oop obj = *p; + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } + template void do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); HeapRegion* to = _g1->heap_region_containing(obj); guarantee(to == NULL || !to->in_collection_set(), "Missed a rem set member."); @@ -129,9 +127,9 @@ HRInto_G1RemSet::HRInto_G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) { _seq_task = new SubTasksDone(NumSeqTasks); guarantee(n_workers() > 0, "There should be some workers"); - _new_refs = NEW_C_HEAP_ARRAY(GrowableArray*, n_workers()); + _new_refs = NEW_C_HEAP_ARRAY(GrowableArray*, n_workers()); for (uint i = 0; i < n_workers(); i++) { - _new_refs[i] = new (ResourceObj::C_HEAP) GrowableArray(8192,true); + _new_refs[i] = new (ResourceObj::C_HEAP) GrowableArray(8192,true); } } @@ -140,7 +138,7 @@ HRInto_G1RemSet::~HRInto_G1RemSet() { for (uint i = 0; i < n_workers(); i++) { delete _new_refs[i]; } - FREE_C_HEAP_ARRAY(GrowableArray*, _new_refs); + FREE_C_HEAP_ARRAY(GrowableArray*, _new_refs); } void CountNonCleanMemRegionClosure::do_MemRegion(MemRegion mr) { @@ -428,15 +426,15 @@ public: } }; -void -HRInto_G1RemSet::scanNewRefsRS(OopsInHeapRegionClosure* oc, - int worker_i) { +template void +HRInto_G1RemSet::scanNewRefsRS_work(OopsInHeapRegionClosure* oc, + int worker_i) { double scan_new_refs_start_sec = os::elapsedTime(); G1CollectedHeap* g1h = G1CollectedHeap::heap(); CardTableModRefBS* ct_bs = (CardTableModRefBS*) (g1h->barrier_set()); for (int i = 0; i < _new_refs[worker_i]->length(); i++) { - oop* p = _new_refs[worker_i]->at(i); - oop obj = *p; + T* p = (T*) _new_refs[worker_i]->at(i); + oop obj = oopDesc::load_decode_heap_oop(p); // *p was in the collection set when p was pushed on "_new_refs", but // another thread may have processed this location from an RS, so it // might not point into the CS any longer. If so, it's obviously been @@ -549,11 +547,10 @@ class UpdateRSetOopsIntoCSImmediate : public OopClosure { G1CollectedHeap* _g1; public: UpdateRSetOopsIntoCSImmediate(G1CollectedHeap* g1) : _g1(g1) { } - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - virtual void do_oop(oop* p) { - HeapRegion* to = _g1->heap_region_containing(*p); + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } + template void do_oop_work(T* p) { + HeapRegion* to = _g1->heap_region_containing(oopDesc::load_decode_heap_oop(p)); if (to->in_collection_set()) { to->rem_set()->add_reference(p, 0); } @@ -567,11 +564,10 @@ class UpdateRSetOopsIntoCSDeferred : public OopClosure { public: UpdateRSetOopsIntoCSDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) : _g1(g1), _ct_bs((CardTableModRefBS*)_g1->barrier_set()), _dcq(dcq) { } - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } - virtual void do_oop(oop* p) { - oop obj = *p; + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } + template void do_oop_work(T* p) { + oop obj = oopDesc::load_decode_heap_oop(p); if (_g1->obj_in_cs(obj)) { size_t card_index = _ct_bs->index_for(p); if (_ct_bs->mark_card_deferred(card_index)) { @@ -581,10 +577,10 @@ public: } }; -void HRInto_G1RemSet::new_refs_iterate(OopClosure* cl) { +template void HRInto_G1RemSet::new_refs_iterate_work(OopClosure* cl) { for (size_t i = 0; i < n_workers(); i++) { for (int j = 0; j < _new_refs[i]->length(); j++) { - oop* p = _new_refs[i]->at(j); + T* p = (T*) _new_refs[i]->at(j); cl->do_oop(p); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp index 4d58e0be6a1..60ba420d8be 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp @@ -62,10 +62,12 @@ public: // If "this" is of the given subtype, return "this", else "NULL". virtual HRInto_G1RemSet* as_HRInto_G1RemSet() { return NULL; } - // Record, if necessary, the fact that *p (where "p" is in region "from") - // has changed to its new value. + // Record, if necessary, the fact that *p (where "p" is in region "from", + // and is, a fortiori, required to be non-NULL) has changed to its new value. virtual void write_ref(HeapRegion* from, oop* p) = 0; + virtual void write_ref(HeapRegion* from, narrowOop* p) = 0; virtual void par_write_ref(HeapRegion* from, oop* p, int tid) = 0; + virtual void par_write_ref(HeapRegion* from, narrowOop* p, int tid) = 0; // Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region // or card, respectively, such that a region or card with a corresponding @@ -105,7 +107,9 @@ public: // Nothing is necessary in the version below. void write_ref(HeapRegion* from, oop* p) {} + void write_ref(HeapRegion* from, narrowOop* p) {} void par_write_ref(HeapRegion* from, oop* p, int tid) {} + void par_write_ref(HeapRegion* from, narrowOop* p, int tid) {} void scrub(BitMap* region_bm, BitMap* card_bm) {} void scrub_par(BitMap* region_bm, BitMap* card_bm, @@ -143,8 +147,19 @@ protected: // their references into the collection summarized in "_new_refs". bool _par_traversal_in_progress; void set_par_traversal(bool b) { _par_traversal_in_progress = b; } - GrowableArray** _new_refs; - void new_refs_iterate(OopClosure* cl); + GrowableArray** _new_refs; + template void new_refs_iterate_work(OopClosure* cl); + void new_refs_iterate(OopClosure* cl) { + if (UseCompressedOops) { + new_refs_iterate_work(cl); + } else { + new_refs_iterate_work(cl); + } + } + +protected: + template void write_ref_nv(HeapRegion* from, T* p); + template void par_write_ref_nv(HeapRegion* from, T* p, int tid); public: // This is called to reset dual hash tables after the gc pause @@ -161,7 +176,14 @@ public: void prepare_for_oops_into_collection_set_do(); void cleanup_after_oops_into_collection_set_do(); void scanRS(OopsInHeapRegionClosure* oc, int worker_i); - void scanNewRefsRS(OopsInHeapRegionClosure* oc, int worker_i); + template void scanNewRefsRS_work(OopsInHeapRegionClosure* oc, int worker_i); + void scanNewRefsRS(OopsInHeapRegionClosure* oc, int worker_i) { + if (UseCompressedOops) { + scanNewRefsRS_work(oc, worker_i); + } else { + scanNewRefsRS_work(oc, worker_i); + } + } void updateRS(int worker_i); HeapRegion* calculateStartRegion(int i); @@ -172,12 +194,22 @@ public: // Record, if necessary, the fact that *p (where "p" is in region "from", // which is required to be non-NULL) has changed to a new non-NULL value. - inline void write_ref(HeapRegion* from, oop* p); - // The "_nv" version is the same; it exists just so that it is not virtual. - inline void write_ref_nv(HeapRegion* from, oop* p); + // [Below the virtual version calls a non-virtual protected + // workhorse that is templatified for narrow vs wide oop.] + inline void write_ref(HeapRegion* from, oop* p) { + write_ref_nv(from, p); + } + inline void write_ref(HeapRegion* from, narrowOop* p) { + write_ref_nv(from, p); + } + inline void par_write_ref(HeapRegion* from, oop* p, int tid) { + par_write_ref_nv(from, p, tid); + } + inline void par_write_ref(HeapRegion* from, narrowOop* p, int tid) { + par_write_ref_nv(from, p, tid); + } - inline bool self_forwarded(oop obj); - inline void par_write_ref(HeapRegion* from, oop* p, int tid); + bool self_forwarded(oop obj); void scrub(BitMap* region_bm, BitMap* card_bm); void scrub_par(BitMap* region_bm, BitMap* card_bm, @@ -208,6 +240,9 @@ class UpdateRSOopClosure: public OopClosure { HeapRegion* _from; HRInto_G1RemSet* _rs; int _worker_i; + + template void do_oop_work(T* p); + public: UpdateRSOopClosure(HRInto_G1RemSet* rs, int worker_i = 0) : _from(NULL), _rs(rs), _worker_i(worker_i) { @@ -219,11 +254,10 @@ public: _from = from; } - virtual void do_oop(narrowOop* p); - virtual void do_oop(oop* p); + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } // Override: this closure is idempotent. // bool idempotent() { return true; } bool apply_to_weak_ref_discovered_field() { return true; } }; - diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp index 00aa14452c2..f14c54031bd 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @@ -30,12 +30,8 @@ inline size_t G1RemSet::n_workers() { } } -inline void HRInto_G1RemSet::write_ref_nv(HeapRegion* from, oop* p) { - par_write_ref(from, p, 0); -} - -inline void HRInto_G1RemSet::write_ref(HeapRegion* from, oop* p) { - write_ref_nv(from, p); +template inline void HRInto_G1RemSet::write_ref_nv(HeapRegion* from, T* p) { + par_write_ref_nv(from, p, 0); } inline bool HRInto_G1RemSet::self_forwarded(oop obj) { @@ -43,8 +39,8 @@ inline bool HRInto_G1RemSet::self_forwarded(oop obj) { return result; } -inline void HRInto_G1RemSet::par_write_ref(HeapRegion* from, oop* p, int tid) { - oop obj = *p; +template inline void HRInto_G1RemSet::par_write_ref_nv(HeapRegion* from, T* p, int tid) { + oop obj = oopDesc::load_decode_heap_oop(p); #ifdef ASSERT // can't do because of races // assert(obj == NULL || obj->is_oop(), "expected an oop"); @@ -71,7 +67,7 @@ inline void HRInto_G1RemSet::par_write_ref(HeapRegion* from, oop* p, int tid) { // false during the evacuation failure handing. if (_par_traversal_in_progress && to->in_collection_set() && !self_forwarded(obj)) { - _new_refs[tid]->push(p); + _new_refs[tid]->push((void*)p); // Deferred updates to the Cset are either discarded (in the normal case), // or processed (if an evacuation failure occurs) at the end // of the collection. @@ -89,11 +85,7 @@ inline void HRInto_G1RemSet::par_write_ref(HeapRegion* from, oop* p, int tid) { } } -inline void UpdateRSOopClosure::do_oop(narrowOop* p) { - guarantee(false, "NYI"); -} - -inline void UpdateRSOopClosure::do_oop(oop* p) { +template inline void UpdateRSOopClosure::do_oop_work(T* p) { assert(_from != NULL, "from region must be non-NULL"); _rs->par_write_ref(_from, p, _worker_i); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp index 37414989eb9..f82b8ba8fe9 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp @@ -34,6 +34,7 @@ G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, void G1SATBCardTableModRefBS::enqueue(oop pre_val) { + assert(pre_val->is_oop_or_null(true), "Error"); if (!JavaThread::satb_mark_queue_set().active()) return; Thread* thr = Thread::current(); if (thr->is_Java_thread()) { @@ -46,32 +47,31 @@ void G1SATBCardTableModRefBS::enqueue(oop pre_val) { } // When we know the current java thread: -void -G1SATBCardTableModRefBS::write_ref_field_pre_static(void* field, - oop newVal, +template void +G1SATBCardTableModRefBS::write_ref_field_pre_static(T* field, + oop new_val, JavaThread* jt) { if (!JavaThread::satb_mark_queue_set().active()) return; - assert(!UseCompressedOops, "Else will need to modify this to deal with narrowOop"); - oop preVal = *(oop*)field; - if (preVal != NULL) { - jt->satb_mark_queue().enqueue(preVal); + T heap_oop = oopDesc::load_heap_oop(field); + if (!oopDesc::is_null(heap_oop)) { + oop pre_val = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(pre_val->is_oop(true /* ignore mark word */), "Error"); + jt->satb_mark_queue().enqueue(pre_val); } } -void -G1SATBCardTableModRefBS::write_ref_array_pre(MemRegion mr) { +template void +G1SATBCardTableModRefBS::write_ref_array_pre_work(T* dst, int count) { if (!JavaThread::satb_mark_queue_set().active()) return; - assert(!UseCompressedOops, "Else will need to modify this to deal with narrowOop"); - oop* elem_ptr = (oop*)mr.start(); - while ((HeapWord*)elem_ptr < mr.end()) { - oop elem = *elem_ptr; - if (elem != NULL) enqueue(elem); - elem_ptr++; + T* elem_ptr = dst; + for (int i = 0; i < count; i++, elem_ptr++) { + T heap_oop = oopDesc::load_heap_oop(elem_ptr); + if (!oopDesc::is_null(heap_oop)) { + enqueue(oopDesc::decode_heap_oop_not_null(heap_oop)); + } } } - - G1SATBCardTableLoggingModRefBS:: G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, int max_covered_regions) : diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp index 86f8283d449..5a5283e6878 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @@ -47,31 +47,41 @@ public: // This notes that we don't need to access any BarrierSet data // structures, so this can be called from a static context. - static void write_ref_field_pre_static(void* field, oop newVal) { - assert(!UseCompressedOops, "Else needs to be templatized"); - oop preVal = *((oop*)field); - if (preVal != NULL) { - enqueue(preVal); + template static void write_ref_field_pre_static(T* field, oop newVal) { + T heap_oop = oopDesc::load_heap_oop(field); + if (!oopDesc::is_null(heap_oop)) { + enqueue(oopDesc::decode_heap_oop(heap_oop)); } } // When we know the current java thread: - static void write_ref_field_pre_static(void* field, oop newVal, - JavaThread* jt); + template static void write_ref_field_pre_static(T* field, oop newVal, + JavaThread* jt); // We export this to make it available in cases where the static // type of the barrier set is known. Note that it is non-virtual. - inline void inline_write_ref_field_pre(void* field, oop newVal) { + template inline void inline_write_ref_field_pre(T* field, oop newVal) { write_ref_field_pre_static(field, newVal); } - // This is the more general virtual version. - void write_ref_field_pre_work(void* field, oop new_val) { + // These are the more general virtual versions. + virtual void write_ref_field_pre_work(oop* field, oop new_val) { inline_write_ref_field_pre(field, new_val); } + virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) { + inline_write_ref_field_pre(field, new_val); + } + virtual void write_ref_field_pre_work(void* field, oop new_val) { + guarantee(false, "Not needed"); + } - virtual void write_ref_array_pre(MemRegion mr); - + template void write_ref_array_pre_work(T* dst, int count); + virtual void write_ref_array_pre(oop* dst, int count) { + write_ref_array_pre_work(dst, count); + } + virtual void write_ref_array_pre(narrowOop* dst, int count) { + write_ref_array_pre_work(dst, count); + } }; // Adds card-table logging to the post-barrier. diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp index 5b296e204d0..8e134bb3fbf 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -80,9 +80,6 @@ develop(bool, G1TraceConcurrentRefinement, false, \ "Trace G1 concurrent refinement") \ \ - develop(bool, G1ConcMark, true, \ - "If true, run concurrent marking for G1") \ - \ product(intx, G1MarkStackSize, 2 * 1024 * 1024, \ "Size of the mark stack for concurrent marking.") \ \ diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp index 5171bdb62cb..101d330077e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp @@ -37,14 +37,12 @@ template - G1ParScanHeapEvacClosure; +typedef G1ParCopyClosure G1ParScanHeapEvacClosure; class FilterIntoCSClosure; class FilterOutOfRegionClosure; class FilterInHeapRegionAndIntoCSClosure; class FilterAndMarkInHeapRegionAndIntoCSClosure; -class G1ScanAndBalanceClosure; #ifdef FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES #error "FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES already defined." @@ -56,8 +54,7 @@ class G1ScanAndBalanceClosure; f(FilterIntoCSClosure,_nv) \ f(FilterOutOfRegionClosure,_nv) \ f(FilterInHeapRegionAndIntoCSClosure,_nv) \ - f(FilterAndMarkInHeapRegionAndIntoCSClosure,_nv) \ - f(G1ScanAndBalanceClosure,_nv) + f(FilterAndMarkInHeapRegionAndIntoCSClosure,_nv) #ifdef FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES #error "FURTHER_SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES already defined." diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index 43af2b52cb7..20876c602c6 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -66,16 +66,16 @@ public: bool failures() { return _failures; } int n_failures() { return _n_failures; } - virtual void do_oop(narrowOop* p) { - guarantee(false, "NYI"); - } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop( oop* p) { do_oop_work(p); } - void do_oop(oop* p) { + template void do_oop_work(T* p) { assert(_containing_obj != NULL, "Precondition"); assert(!_g1h->is_obj_dead_cond(_containing_obj, _use_prev_marking), "Precondition"); - oop obj = *p; - if (obj != NULL) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); bool failed = false; if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _use_prev_marking)) { @@ -106,8 +106,8 @@ public: } if (!_g1h->full_collection()) { - HeapRegion* from = _g1h->heap_region_containing(p); - HeapRegion* to = _g1h->heap_region_containing(*p); + HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); + HeapRegion* to = _g1h->heap_region_containing(obj); if (from != NULL && to != NULL && from != to && !to->isHumongous()) { @@ -534,13 +534,13 @@ HeapRegion::object_iterate_mem_careful(MemRegion mr, // Otherwise, find the obj that extends onto mr.start(). assert(cur <= mr.start() - && (oop(cur)->klass() == NULL || + && (oop(cur)->klass_or_null() == NULL || cur + oop(cur)->size() > mr.start()), "postcondition of block_start"); oop obj; while (cur < mr.end()) { obj = oop(cur); - if (obj->klass() == NULL) { + if (obj->klass_or_null() == NULL) { // Ran into an unparseable point. return cur; } else if (!g1h->is_obj_dead(obj)) { @@ -577,7 +577,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr, assert(cur <= mr.start(), "Postcondition"); while (cur <= mr.start()) { - if (oop(cur)->klass() == NULL) { + if (oop(cur)->klass_or_null() == NULL) { // Ran into an unparseable point. return cur; } @@ -591,7 +591,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr, obj = oop(cur); // If we finish this loop... assert(cur <= mr.start() - && obj->klass() != NULL + && obj->klass_or_null() != NULL && cur + obj->size() > mr.start(), "Loop postcondition"); if (!g1h->is_obj_dead(obj)) { @@ -601,7 +601,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr, HeapWord* next; while (cur < mr.end()) { obj = oop(cur); - if (obj->klass() == NULL) { + if (obj->klass_or_null() == NULL) { // Ran into an unparseable point. return cur; }; @@ -781,8 +781,13 @@ void G1OffsetTableContigSpace::set_saved_mark() { // will pick up the right saved_mark_word() as the high water mark // of the region. Either way, the behaviour will be correct. ContiguousSpace::set_saved_mark(); + OrderAccess::storestore(); _gc_time_stamp = curr_gc_time_stamp; - OrderAccess::fence(); + // The following fence is to force a flush of the writes above, but + // is strictly not needed because when an allocating worker thread + // calls set_saved_mark() it does so under the ParGCRareEvent_lock; + // when the lock is released, the write will be flushed. + // OrderAccess::fence(); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp index 5fb5762811c..f52a1ff2a42 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp @@ -126,7 +126,7 @@ protected: } } - void add_reference_work(oop* from, bool par) { + void add_reference_work(OopOrNarrowOopStar from, bool par) { // Must make this robust in case "from" is not in "_hr", because of // concurrency. @@ -173,11 +173,11 @@ public: _bm.clear(); } - void add_reference(oop* from) { + void add_reference(OopOrNarrowOopStar from) { add_reference_work(from, /*parallel*/ true); } - void seq_add_reference(oop* from) { + void seq_add_reference(OopOrNarrowOopStar from) { add_reference_work(from, /*parallel*/ false); } @@ -220,7 +220,7 @@ public: } // Requires "from" to be in "hr()". - bool contains_reference(oop* from) const { + bool contains_reference(OopOrNarrowOopStar from) const { assert(hr()->is_in_reserved(from), "Precondition."); size_t card_ind = pointer_delta(from, hr()->bottom(), CardTableModRefBS::card_size); @@ -394,7 +394,7 @@ public: void set_next(PosParPRT* nxt) { _next = nxt; } PosParPRT** next_addr() { return &_next; } - void add_reference(oop* from, int tid) { + void add_reference(OopOrNarrowOopStar from, int tid) { // Expand if necessary. PerRegionTable** pt = par_tables(); if (par_tables() == NULL && tid > 0 && hr()->is_gc_alloc_region()) { @@ -447,7 +447,7 @@ public: return res; } - bool contains_reference(oop* from) const { + bool contains_reference(OopOrNarrowOopStar from) const { if (PerRegionTable::contains_reference(from)) return true; if (_par_tables != NULL) { for (int i = 0; i < HeapRegionRemSet::num_par_rem_sets()-1; i++) { @@ -564,12 +564,15 @@ void OtherRegionsTable::print_from_card_cache() { } #endif -void OtherRegionsTable::add_reference(oop* from, int tid) { +void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) { size_t cur_hrs_ind = hr()->hrs_index(); #if HRRS_VERBOSE gclog_or_tty->print_cr("ORT::add_reference_work(" PTR_FORMAT "->" PTR_FORMAT ").", - from, *from); + from, + UseCompressedOops + ? oopDesc::load_decode_heap_oop((narrowOop*)from) + : oopDesc::load_decode_heap_oop((oop*)from)); #endif int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); @@ -1021,13 +1024,13 @@ bool OtherRegionsTable::del_single_region_table(size_t ind, } } -bool OtherRegionsTable::contains_reference(oop* from) const { +bool OtherRegionsTable::contains_reference(OopOrNarrowOopStar from) const { // Cast away const in this case. MutexLockerEx x((Mutex*)&_m, Mutex::_no_safepoint_check_flag); return contains_reference_locked(from); } -bool OtherRegionsTable::contains_reference_locked(oop* from) const { +bool OtherRegionsTable::contains_reference_locked(OopOrNarrowOopStar from) const { HeapRegion* hr = _g1h->heap_region_containing_raw(from); if (hr == NULL) return false; RegionIdx_t hr_ind = (RegionIdx_t) hr->hrs_index(); @@ -1288,24 +1291,24 @@ bool HeapRegionRemSetIterator::has_next(size_t& card_index) { -oop** HeapRegionRemSet::_recorded_oops = NULL; -HeapWord** HeapRegionRemSet::_recorded_cards = NULL; -HeapRegion** HeapRegionRemSet::_recorded_regions = NULL; -int HeapRegionRemSet::_n_recorded = 0; +OopOrNarrowOopStar* HeapRegionRemSet::_recorded_oops = NULL; +HeapWord** HeapRegionRemSet::_recorded_cards = NULL; +HeapRegion** HeapRegionRemSet::_recorded_regions = NULL; +int HeapRegionRemSet::_n_recorded = 0; HeapRegionRemSet::Event* HeapRegionRemSet::_recorded_events = NULL; int* HeapRegionRemSet::_recorded_event_index = NULL; int HeapRegionRemSet::_n_recorded_events = 0; -void HeapRegionRemSet::record(HeapRegion* hr, oop* f) { +void HeapRegionRemSet::record(HeapRegion* hr, OopOrNarrowOopStar f) { if (_recorded_oops == NULL) { assert(_n_recorded == 0 && _recorded_cards == NULL && _recorded_regions == NULL, "Inv"); - _recorded_oops = NEW_C_HEAP_ARRAY(oop*, MaxRecorded); - _recorded_cards = NEW_C_HEAP_ARRAY(HeapWord*, MaxRecorded); - _recorded_regions = NEW_C_HEAP_ARRAY(HeapRegion*, MaxRecorded); + _recorded_oops = NEW_C_HEAP_ARRAY(OopOrNarrowOopStar, MaxRecorded); + _recorded_cards = NEW_C_HEAP_ARRAY(HeapWord*, MaxRecorded); + _recorded_regions = NEW_C_HEAP_ARRAY(HeapRegion*, MaxRecorded); } if (_n_recorded == MaxRecorded) { gclog_or_tty->print_cr("Filled up 'recorded' (%d).", MaxRecorded); @@ -1408,21 +1411,21 @@ void HeapRegionRemSet::test() { HeapRegionRemSet* hrrs = hr0->rem_set(); // Make three references from region 0x101... - hrrs->add_reference((oop*)hr1_start); - hrrs->add_reference((oop*)hr1_mid); - hrrs->add_reference((oop*)hr1_last); + hrrs->add_reference((OopOrNarrowOopStar)hr1_start); + hrrs->add_reference((OopOrNarrowOopStar)hr1_mid); + hrrs->add_reference((OopOrNarrowOopStar)hr1_last); - hrrs->add_reference((oop*)hr2_start); - hrrs->add_reference((oop*)hr2_mid); - hrrs->add_reference((oop*)hr2_last); + hrrs->add_reference((OopOrNarrowOopStar)hr2_start); + hrrs->add_reference((OopOrNarrowOopStar)hr2_mid); + hrrs->add_reference((OopOrNarrowOopStar)hr2_last); - hrrs->add_reference((oop*)hr3_start); - hrrs->add_reference((oop*)hr3_mid); - hrrs->add_reference((oop*)hr3_last); + hrrs->add_reference((OopOrNarrowOopStar)hr3_start); + hrrs->add_reference((OopOrNarrowOopStar)hr3_mid); + hrrs->add_reference((OopOrNarrowOopStar)hr3_last); // Now cause a coarsening. - hrrs->add_reference((oop*)hr4->bottom()); - hrrs->add_reference((oop*)hr5->bottom()); + hrrs->add_reference((OopOrNarrowOopStar)hr4->bottom()); + hrrs->add_reference((OopOrNarrowOopStar)hr5->bottom()); // Now, does iteration yield these three? HeapRegionRemSetIterator iter; diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp index d6309815251..d525b5ad306 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp @@ -116,9 +116,9 @@ public: // For now. Could "expand" some tables in the future, so that this made // sense. - void add_reference(oop* from, int tid); + void add_reference(OopOrNarrowOopStar from, int tid); - void add_reference(oop* from) { + void add_reference(OopOrNarrowOopStar from) { return add_reference(from, 0); } @@ -140,8 +140,8 @@ public: static size_t static_mem_size(); static size_t fl_mem_size(); - bool contains_reference(oop* from) const; - bool contains_reference_locked(oop* from) const; + bool contains_reference(OopOrNarrowOopStar from) const; + bool contains_reference_locked(OopOrNarrowOopStar from) const; void clear(); @@ -192,10 +192,10 @@ private: // Unused unless G1RecordHRRSOops is true. static const int MaxRecorded = 1000000; - static oop** _recorded_oops; - static HeapWord** _recorded_cards; - static HeapRegion** _recorded_regions; - static int _n_recorded; + static OopOrNarrowOopStar* _recorded_oops; + static HeapWord** _recorded_cards; + static HeapRegion** _recorded_regions; + static int _n_recorded; static const int MaxRecordedEvents = 1000; static Event* _recorded_events; @@ -231,13 +231,13 @@ public: /* Used in the sequential case. Returns "true" iff this addition causes the size limit to be reached. */ - void add_reference(oop* from) { + void add_reference(OopOrNarrowOopStar from) { _other_regions.add_reference(from); } /* Used in the parallel case. Returns "true" iff this addition causes the size limit to be reached. */ - void add_reference(oop* from, int tid) { + void add_reference(OopOrNarrowOopStar from, int tid) { _other_regions.add_reference(from, tid); } @@ -301,7 +301,7 @@ public: return OtherRegionsTable::fl_mem_size(); } - bool contains_reference(oop* from) const { + bool contains_reference(OopOrNarrowOopStar from) const { return _other_regions.contains_reference(from); } void print() const; @@ -329,7 +329,7 @@ public: } #endif - static void record(HeapRegion* hr, oop* f); + static void record(HeapRegion* hr, OopOrNarrowOopStar f); static void print_recorded(); static void record_event(Event evnt); diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp index a3e74a41ce0..3cf402ce7a8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp @@ -43,6 +43,18 @@ void ObjPtrQueue::apply_closure_to_buffer(ObjectClosure* cl, } } } + +#ifdef ASSERT +void ObjPtrQueue::verify_oops_in_buffer() { + if (_buf == NULL) return; + for (size_t i = _index; i < _sz; i += oopSize) { + oop obj = (oop)_buf[byte_index_to_index((int)i)]; + assert(obj != NULL && obj->is_oop(true /* ignore mark word */), + "Not an oop"); + } +} +#endif + #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away #pragma warning( disable:4355 ) // 'this' : used in base member initializer list #endif // _MSC_VER @@ -66,6 +78,7 @@ void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { + DEBUG_ONLY(t->satb_mark_queue().verify_oops_in_buffer();) t->satb_mark_queue().handle_zero_index(); } @@ -143,7 +156,7 @@ void SATBMarkQueueSet::abandon_partial_marking() { } _completed_buffers_tail = NULL; _n_completed_buffers = 0; - debug_only(assert_completed_buffer_list_len_correct_locked()); + DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked()); } while (buffers_to_delete != NULL) { CompletedBufferNode* nd = buffers_to_delete; diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp index ab8bf5fa4ab..ed1181dd79f 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp @@ -39,6 +39,7 @@ public: static void apply_closure_to_buffer(ObjectClosure* cl, void** buf, size_t index, size_t sz); + void verify_oops_in_buffer() NOT_DEBUG_RETURN; }; diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 b/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 index f7236edafe6..7e2df3fc8af 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 @@ -27,6 +27,7 @@ bufferingOopClosure.hpp genOopClosures.hpp bufferingOopClosure.hpp generation.hpp bufferingOopClosure.hpp os.hpp +bufferingOopClosure.hpp taskqueue.hpp cardTableRS.cpp concurrentMark.hpp cardTableRS.cpp g1SATBCardTableModRefBS.hpp @@ -139,7 +140,7 @@ g1CollectedHeap.cpp concurrentZFThread.hpp g1CollectedHeap.cpp g1CollectedHeap.inline.hpp g1CollectedHeap.cpp g1CollectorPolicy.hpp g1CollectedHeap.cpp g1MarkSweep.hpp -g1CollectedHeap.cpp g1RemSet.hpp +g1CollectedHeap.cpp g1RemSet.inline.hpp g1CollectedHeap.cpp g1OopClosures.inline.hpp g1CollectedHeap.cpp genOopClosures.inline.hpp g1CollectedHeap.cpp gcLocker.inline.hpp @@ -151,13 +152,14 @@ g1CollectedHeap.cpp icBuffer.hpp g1CollectedHeap.cpp isGCActiveMark.hpp g1CollectedHeap.cpp oop.inline.hpp g1CollectedHeap.cpp oop.pcgc.inline.hpp -g1CollectedHeap.cpp parGCAllocBuffer.hpp g1CollectedHeap.cpp vm_operations_g1.hpp g1CollectedHeap.cpp vmThread.hpp g1CollectedHeap.hpp barrierSet.hpp +g1CollectedHeap.hpp g1RemSet.hpp g1CollectedHeap.hpp heapRegion.hpp g1CollectedHeap.hpp memRegion.hpp +g1CollectedHeap.hpp parGCAllocBuffer.hpp g1CollectedHeap.hpp sharedHeap.hpp g1CollectedHeap.inline.hpp concurrentMark.hpp @@ -245,6 +247,7 @@ g1RemSet.cpp intHisto.hpp g1RemSet.cpp iterator.hpp g1RemSet.cpp oop.inline.hpp +g1RemSet.inline.hpp oop.inline.hpp g1RemSet.inline.hpp g1RemSet.hpp g1RemSet.inline.hpp heapRegionRemSet.hpp @@ -255,6 +258,7 @@ g1SATBCardTableModRefBS.cpp thread.hpp g1SATBCardTableModRefBS.cpp thread_.inline.hpp g1SATBCardTableModRefBS.cpp satbQueue.hpp +g1SATBCardTableModRefBS.hpp oop.inline.hpp g1SATBCardTableModRefBS.hpp cardTableModRefBS.hpp g1SATBCardTableModRefBS.hpp memRegion.hpp diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp index fcbd6cc42e8..ce7ba20252c 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp @@ -31,9 +31,10 @@ void CardTableModRefBS::par_non_clean_card_iterate_work(Space* sp, MemRegion mr, bool clear, int n_threads) { if (n_threads > 0) { - assert(n_threads == (int)ParallelGCThreads, "# worker threads != # requested!"); - - // Make sure the LNC array is valid for the space. + assert((n_threads == 1 && ParallelGCThreads == 0) || + n_threads <= (int)ParallelGCThreads, + "# worker threads != # requested!"); + // Make sure the LNC array is valid for the space. jbyte** lowest_non_clean; uintptr_t lowest_non_clean_base_chunk_index; size_t lowest_non_clean_chunk_size; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index d0fa3a4eecf..b48344fd2c2 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -885,7 +885,7 @@ void ParallelScavengeHeap::print_tracing_info() const { } -void ParallelScavengeHeap::verify(bool allow_dirty, bool silent) { +void ParallelScavengeHeap::verify(bool allow_dirty, bool silent, bool option /* ignored */) { // Why do we need the total_collections()-filter below? if (total_collections() > 0) { if (!silent) { diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp index 2b8904cfa29..350c0431716 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp @@ -217,7 +217,7 @@ class ParallelScavengeHeap : public CollectedHeap { virtual void gc_threads_do(ThreadClosure* tc) const; virtual void print_tracing_info() const; - void verify(bool allow_dirty, bool silent); + void verify(bool allow_dirty, bool silent, bool /* option */); void print_heap_change(size_t prev_used); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp index f1a9e64fe93..e1f0994b88c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -117,6 +117,7 @@ inline void PSPromotionManager::process_popped_location_depth(StarTask p) { process_array_chunk(old); } else { if (p.is_narrow()) { + assert(UseCompressedOops, "Error"); PSScavenge::copy_and_push_safe_barrier(this, (narrowOop*)p); } else { PSScavenge::copy_and_push_safe_barrier(this, (oop*)p); diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index 3db5224bb59..11da8de2ec8 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -533,7 +533,7 @@ class CollectedHeap : public CHeapObj { virtual void print_tracing_info() const = 0; // Heap verification - virtual void verify(bool allow_dirty, bool silent) = 0; + virtual void verify(bool allow_dirty, bool silent, bool option) = 0; // Non product verification and debugging. #ifndef PRODUCT diff --git a/hotspot/src/share/vm/includeDB_core b/hotspot/src/share/vm/includeDB_core index f595248f92c..bd6109967fd 100644 --- a/hotspot/src/share/vm/includeDB_core +++ b/hotspot/src/share/vm/includeDB_core @@ -554,7 +554,6 @@ ciEnv.cpp jvmtiExport.hpp ciEnv.cpp linkResolver.hpp ciEnv.cpp methodDataOop.hpp ciEnv.cpp objArrayKlass.hpp -ciEnv.cpp oop.hpp ciEnv.cpp oop.inline.hpp ciEnv.cpp oop.inline2.hpp ciEnv.cpp oopFactory.hpp @@ -785,7 +784,6 @@ ciObjectFactory.hpp growableArray.hpp ciSignature.cpp allocation.inline.hpp ciSignature.cpp ciSignature.hpp ciSignature.cpp ciUtilities.hpp -ciSignature.cpp oop.hpp ciSignature.cpp oop.inline.hpp ciSignature.cpp signature.hpp @@ -950,7 +948,6 @@ classLoadingService.hpp perfData.hpp classify.cpp classify.hpp classify.cpp systemDictionary.hpp -classify.hpp oop.hpp classify.hpp oop.inline.hpp codeBlob.cpp allocation.inline.hpp @@ -1185,7 +1182,6 @@ compilerOracle.cpp handles.inline.hpp compilerOracle.cpp jniHandles.hpp compilerOracle.cpp klass.hpp compilerOracle.cpp methodOop.hpp -compilerOracle.cpp oop.hpp compilerOracle.cpp oop.inline.hpp compilerOracle.cpp oopFactory.hpp compilerOracle.cpp resourceArea.hpp @@ -1629,7 +1625,6 @@ frame.cpp methodDataOop.hpp frame.cpp methodOop.hpp frame.cpp monitorChunk.hpp frame.cpp nativeInst_.hpp -frame.cpp oop.hpp frame.cpp oop.inline.hpp frame.cpp oop.inline2.hpp frame.cpp oopMapCache.hpp @@ -1797,7 +1792,6 @@ generation.cpp genOopClosures.inline.hpp generation.cpp generation.hpp generation.cpp generation.inline.hpp generation.cpp java.hpp -generation.cpp oop.hpp generation.cpp oop.inline.hpp generation.cpp spaceDecorator.hpp generation.cpp space.inline.hpp @@ -2270,7 +2264,6 @@ java.cpp jvmtiExport.hpp java.cpp memprofiler.hpp java.cpp methodOop.hpp java.cpp objArrayOop.hpp -java.cpp oop.hpp java.cpp oop.inline.hpp java.cpp oopFactory.hpp java.cpp sharedRuntime.hpp @@ -2947,7 +2940,7 @@ mutex_.inline.hpp thread_.inline.hpp nativeInst_.cpp assembler_.inline.hpp nativeInst_.cpp handles.hpp nativeInst_.cpp nativeInst_.hpp -nativeInst_.cpp oop.hpp +nativeInst_.cpp oop.inline.hpp nativeInst_.cpp ostream.hpp nativeInst_.cpp resourceArea.hpp nativeInst_.cpp sharedRuntime.hpp @@ -3842,7 +3835,7 @@ stackMapTable.hpp stackMapFrame.hpp stackValue.cpp debugInfo.hpp stackValue.cpp frame.inline.hpp stackValue.cpp handles.inline.hpp -stackValue.cpp oop.hpp +stackValue.cpp oop.inline.hpp stackValue.cpp stackValue.hpp stackValue.hpp handles.hpp @@ -4329,7 +4322,6 @@ typeArrayOop.hpp typeArrayKlass.hpp unhandledOops.cpp collectedHeap.hpp unhandledOops.cpp gcLocker.inline.hpp unhandledOops.cpp globalDefinitions.hpp -unhandledOops.cpp oop.hpp unhandledOops.cpp oop.inline.hpp unhandledOops.cpp thread.hpp unhandledOops.cpp unhandledOops.hpp @@ -4465,7 +4457,6 @@ vframe.cpp javaClasses.hpp vframe.cpp nmethod.hpp vframe.cpp objectMonitor.hpp vframe.cpp objectMonitor.inline.hpp -vframe.cpp oop.hpp vframe.cpp oop.inline.hpp vframe.cpp oopMapCache.hpp vframe.cpp pcDesc.hpp @@ -4577,7 +4568,6 @@ vmThread.cpp events.hpp vmThread.cpp interfaceSupport.hpp vmThread.cpp methodOop.hpp vmThread.cpp mutexLocker.hpp -vmThread.cpp oop.hpp vmThread.cpp oop.inline.hpp vmThread.cpp os.hpp vmThread.cpp resourceArea.hpp diff --git a/hotspot/src/share/vm/includeDB_features b/hotspot/src/share/vm/includeDB_features index 863f6513340..c0b02eb42c8 100644 --- a/hotspot/src/share/vm/includeDB_features +++ b/hotspot/src/share/vm/includeDB_features @@ -47,7 +47,7 @@ dump.cpp javaCalls.hpp dump.cpp javaClasses.hpp dump.cpp loaderConstraints.hpp dump.cpp methodDataOop.hpp -dump.cpp oop.hpp +dump.cpp oop.inline.hpp dump.cpp oopFactory.hpp dump.cpp resourceArea.hpp dump.cpp signature.hpp @@ -237,7 +237,7 @@ serialize.cpp compactingPermGenGen.hpp serialize.cpp compiledICHolderOop.hpp serialize.cpp methodDataOop.hpp serialize.cpp objArrayOop.hpp -serialize.cpp oop.hpp +serialize.cpp oop.inline.hpp serialize.cpp symbolTable.hpp serialize.cpp systemDictionary.hpp @@ -295,7 +295,7 @@ vmStructs.cpp nmethod.hpp vmStructs.cpp objArrayKlass.hpp vmStructs.cpp objArrayKlassKlass.hpp vmStructs.cpp objArrayOop.hpp -vmStructs.cpp oop.hpp +vmStructs.cpp oop.inline.hpp vmStructs.cpp oopMap.hpp vmStructs.cpp pcDesc.hpp vmStructs.cpp perfMemory.hpp diff --git a/hotspot/src/share/vm/memory/barrierSet.cpp b/hotspot/src/share/vm/memory/barrierSet.cpp index 23308805a60..07ff7a0fc21 100644 --- a/hotspot/src/share/vm/memory/barrierSet.cpp +++ b/hotspot/src/share/vm/memory/barrierSet.cpp @@ -25,12 +25,27 @@ # include "incls/_precompiled.incl" # include "incls/_barrierSet.cpp.incl" -// count is in HeapWord's +// count is number of array elements being written void BarrierSet::static_write_ref_array_pre(HeapWord* start, size_t count) { - Universe::heap()->barrier_set()->write_ref_array_pre(MemRegion(start, start + count)); + assert(count <= (size_t)max_intx, "count too large"); +#if 0 + warning("Pre: \t" INTPTR_FORMAT "[" SIZE_FORMAT "]\t", + start, count); +#endif + if (UseCompressedOops) { + Universe::heap()->barrier_set()->write_ref_array_pre((narrowOop*)start, (int)count); + } else { + Universe::heap()->barrier_set()->write_ref_array_pre( (oop*)start, (int)count); + } } -// count is in HeapWord's +// count is number of array elements being written void BarrierSet::static_write_ref_array_post(HeapWord* start, size_t count) { - Universe::heap()->barrier_set()->write_ref_array_work(MemRegion(start, start + count)); + assert(count <= (size_t)max_intx, "count too large"); + HeapWord* end = start + objArrayOopDesc::array_size((int)count); +#if 0 + warning("Post:\t" INTPTR_FORMAT "[" SIZE_FORMAT "] : [" INTPTR_FORMAT","INTPTR_FORMAT")\t", + start, count, start, end); +#endif + Universe::heap()->barrier_set()->write_ref_array_work(MemRegion(start, end)); } diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp index bff929b2c8b..0fc6a006140 100644 --- a/hotspot/src/share/vm/memory/barrierSet.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -81,9 +81,13 @@ public: // barrier types. Semantically, it should be thought of as a call to the // virtual "_work" function below, which must implement the barrier.) // First the pre-write versions... - inline void write_ref_field_pre(void* field, oop new_val); + template inline void write_ref_field_pre(T* field, oop new_val); +private: + // Keep this private so as to catch violations at build time. + virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); }; protected: - virtual void write_ref_field_pre_work(void* field, oop new_val) {}; + virtual void write_ref_field_pre_work( oop* field, oop new_val) {}; + virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {}; public: // ...then the post-write version. @@ -117,12 +121,17 @@ public: virtual void read_ref_array(MemRegion mr) = 0; virtual void read_prim_array(MemRegion mr) = 0; - virtual void write_ref_array_pre(MemRegion mr) {} + virtual void write_ref_array_pre( oop* dst, int length) {} + virtual void write_ref_array_pre(narrowOop* dst, int length) {} inline void write_ref_array(MemRegion mr); // Static versions, suitable for calling from generated code. static void static_write_ref_array_pre(HeapWord* start, size_t count); static void static_write_ref_array_post(HeapWord* start, size_t count); + // Narrow oop versions of the above; count is # of array elements being written, + // starting with "start", which is HeapWord-aligned. + static void static_write_ref_array_pre_narrow(HeapWord* start, size_t count); + static void static_write_ref_array_post_narrow(HeapWord* start, size_t count); protected: virtual void write_ref_array_work(MemRegion mr) = 0; diff --git a/hotspot/src/share/vm/memory/barrierSet.inline.hpp b/hotspot/src/share/vm/memory/barrierSet.inline.hpp index 50382c994bb..edcb551bdcd 100644 --- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp @@ -23,10 +23,10 @@ */ // Inline functions of BarrierSet, which de-virtualize certain -// performance-critical calls when when the barrier is the most common +// performance-critical calls when the barrier is the most common // card-table kind. -void BarrierSet::write_ref_field_pre(void* field, oop new_val) { +template void BarrierSet::write_ref_field_pre(T* field, oop new_val) { if (kind() == CardTableModRef) { ((CardTableModRefBS*)this)->inline_write_ref_field_pre(field, new_val); } else { diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp index 46a5dd9f6b9..d31dc6eb8a4 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp @@ -287,7 +287,7 @@ public: // these functions here for performance. protected: void write_ref_field_work(oop obj, size_t offset, oop newVal); - void write_ref_field_work(void* field, oop newVal); + virtual void write_ref_field_work(void* field, oop newVal); public: bool has_write_ref_array_opt() { return true; } @@ -317,10 +317,10 @@ public: // *** Card-table-barrier-specific things. - inline void inline_write_ref_field_pre(void* field, oop newVal) {} + template inline void inline_write_ref_field_pre(T* field, oop newVal) {} - inline void inline_write_ref_field(void* field, oop newVal) { - jbyte* byte = byte_for(field); + template inline void inline_write_ref_field(T* field, oop newVal) { + jbyte* byte = byte_for((void*)field); *byte = dirty_card; } diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index 048bd0eca29..e25cc513158 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -1194,7 +1194,7 @@ GCStats* GenCollectedHeap::gc_stats(int level) const { return _gens[level]->gc_stats(); } -void GenCollectedHeap::verify(bool allow_dirty, bool silent) { +void GenCollectedHeap::verify(bool allow_dirty, bool silent, bool option /* ignored */) { if (!silent) { gclog_or_tty->print("permgen "); } diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp index 0630eec6395..0c14c7f3d9a 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp @@ -325,7 +325,7 @@ public: void prepare_for_verify(); // Override. - void verify(bool allow_dirty, bool silent); + void verify(bool allow_dirty, bool silent, bool /* option */); // Override. void print() const; diff --git a/hotspot/src/share/vm/memory/genOopClosures.hpp b/hotspot/src/share/vm/memory/genOopClosures.hpp index 4cb2ca6c202..8f8fe5caaa0 100644 --- a/hotspot/src/share/vm/memory/genOopClosures.hpp +++ b/hotspot/src/share/vm/memory/genOopClosures.hpp @@ -57,7 +57,7 @@ class OopsInGenClosure : public OopClosure { template void do_barrier(T* p); // Version for use by closures that may be called in parallel code. - void par_do_barrier(oop* p); + template void par_do_barrier(T* p); public: OopsInGenClosure() : OopClosure(NULL), diff --git a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp index 5f13668e9c4..8971b43ccae 100644 --- a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp +++ b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp @@ -40,18 +40,20 @@ inline void OopsInGenClosure::set_generation(Generation* gen) { template inline void OopsInGenClosure::do_barrier(T* p) { assert(generation()->is_in_reserved(p), "expected ref in generation"); - assert(!oopDesc::is_null(*p), "expected non-null object"); - oop obj = oopDesc::load_decode_heap_oop_not_null(p); + T heap_oop = oopDesc::load_heap_oop(p); + assert(!oopDesc::is_null(heap_oop), "expected non-null oop"); + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); // If p points to a younger generation, mark the card. if ((HeapWord*)obj < _gen_boundary) { _rs->inline_write_ref_field_gc(p, obj); } } -inline void OopsInGenClosure::par_do_barrier(oop* p) { +template inline void OopsInGenClosure::par_do_barrier(T* p) { assert(generation()->is_in_reserved(p), "expected ref in generation"); - oop obj = *p; - assert(obj != NULL, "expected non-null object"); + T heap_oop = oopDesc::load_heap_oop(p); + assert(!oopDesc::is_null(heap_oop), "expected non-null oop"); + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); // If p points to a younger generation, mark the card. if ((HeapWord*)obj < gen_boundary()) { rs()->write_ref_field_gc_par(p, obj); diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp index 36d95144f46..616ca5d690a 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.cpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp @@ -1013,12 +1013,19 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, // discovered_addr. oop current_head = refs_list.head(); - // Note: In the case of G1, this pre-barrier is strictly + // Note: In the case of G1, this specific pre-barrier is strictly // not necessary because the only case we are interested in - // here is when *discovered_addr is NULL, so this will expand to - // nothing. As a result, I am just manually eliding this out for G1. + // here is when *discovered_addr is NULL (see the CAS further below), + // so this will expand to nothing. As a result, we have manually + // elided this out for G1, but left in the test for some future + // collector that might have need for a pre-barrier here. if (_discovered_list_needs_barrier && !UseG1GC) { - _bs->write_ref_field_pre((void*)discovered_addr, current_head); guarantee(false, "Needs to be fixed: YSR"); + if (UseCompressedOops) { + _bs->write_ref_field_pre((narrowOop*)discovered_addr, current_head); + } else { + _bs->write_ref_field_pre((oop*)discovered_addr, current_head); + } + guarantee(false, "Need to check non-G1 collector"); } oop retest = oopDesc::atomic_compare_exchange_oop(current_head, discovered_addr, NULL); @@ -1029,9 +1036,8 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, refs_list.set_head(obj); refs_list.inc_length(1); if (_discovered_list_needs_barrier) { - _bs->write_ref_field((void*)discovered_addr, current_head); guarantee(false, "Needs to be fixed: YSR"); + _bs->write_ref_field((void*)discovered_addr, current_head); } - } else { // If retest was non NULL, another thread beat us to it: // The reference has already been discovered... @@ -1177,11 +1183,16 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { // pre-value, we can safely elide the pre-barrier here for the case of G1. assert(discovered == NULL, "control point invariant"); if (_discovered_list_needs_barrier && !UseG1GC) { // safe to elide for G1 - _bs->write_ref_field_pre((oop*)discovered_addr, current_head); + if (UseCompressedOops) { + _bs->write_ref_field_pre((narrowOop*)discovered_addr, current_head); + } else { + _bs->write_ref_field_pre((oop*)discovered_addr, current_head); + } + guarantee(false, "Need to check non-G1 collector"); } oop_store_raw(discovered_addr, current_head); if (_discovered_list_needs_barrier) { - _bs->write_ref_field((oop*)discovered_addr, current_head); + _bs->write_ref_field((void*)discovered_addr, current_head); } list->set_head(obj); list->inc_length(1); diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp index e6164ba19ef..98fc8a22880 100644 --- a/hotspot/src/share/vm/memory/space.hpp +++ b/hotspot/src/share/vm/memory/space.hpp @@ -106,6 +106,7 @@ class Space: public CHeapObj { virtual void set_end(HeapWord* value) { _end = value; } virtual HeapWord* saved_mark_word() const { return _saved_mark_word; } + void set_saved_mark_word(HeapWord* p) { _saved_mark_word = p; } MemRegionClosure* preconsumptionDirtyCardClosure() const { diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index b854d64892c..adcc3eca787 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1170,7 +1170,7 @@ void Universe::print_heap_after_gc(outputStream* st) { st->print_cr("}"); } -void Universe::verify(bool allow_dirty, bool silent) { +void Universe::verify(bool allow_dirty, bool silent, bool option) { if (SharedSkipVerify) { return; } @@ -1194,7 +1194,7 @@ void Universe::verify(bool allow_dirty, bool silent) { if (!silent) gclog_or_tty->print("[Verifying "); if (!silent) gclog_or_tty->print("threads "); Threads::verify(); - heap()->verify(allow_dirty, silent); + heap()->verify(allow_dirty, silent, option); if (!silent) gclog_or_tty->print("syms "); SymbolTable::verify(); diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index 9e17a184450..53cf78066aa 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -398,7 +398,7 @@ class Universe: AllStatic { // Debugging static bool verify_in_progress() { return _verify_in_progress; } - static void verify(bool allow_dirty = true, bool silent = false); + static void verify(bool allow_dirty = true, bool silent = false, bool option = true); static int verify_count() { return _verify_count; } static void print(); static void print_on(outputStream* st); diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.cpp b/hotspot/src/share/vm/oops/instanceRefKlass.cpp index c6d9f75b0cb..5e6d40f9dc5 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp @@ -28,13 +28,14 @@ template static void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); - oop referent = oopDesc::load_decode_heap_oop(referent_addr); + T heap_oop = oopDesc::load_heap_oop(referent_addr); debug_only( if(TraceReferenceGC && PrintGCDetails) { gclog_or_tty->print_cr("instanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj); } ) - if (referent != NULL) { + if (!oopDesc::is_null(heap_oop)) { + oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); if (!referent->is_gc_marked() && MarkSweep::ref_processor()-> discover_reference(obj, ref->reference_type())) { @@ -81,13 +82,14 @@ static void specialized_oop_follow_contents(instanceRefKlass* ref, ParCompactionManager* cm, oop obj) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); - oop referent = oopDesc::load_decode_heap_oop(referent_addr); + T heap_oop = oopDesc::load_heap_oop(referent_addr); debug_only( if(TraceReferenceGC && PrintGCDetails) { gclog_or_tty->print_cr("instanceRefKlass::oop_follow_contents " INTPTR_FORMAT, obj); } ) - if (referent != NULL) { + if (!oopDesc::is_null(heap_oop)) { + oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); if (PSParallelCompact::mark_bitmap()->is_unmarked(referent) && PSParallelCompact::ref_processor()-> discover_reference(obj, ref->reference_type())) { @@ -182,9 +184,10 @@ int instanceRefKlass::oop_adjust_pointers(oop obj) { } \ \ T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); \ - oop referent = oopDesc::load_decode_heap_oop(referent_addr); \ - if (referent != NULL && contains(referent_addr)) { \ + T heap_oop = oopDesc::load_heap_oop(referent_addr); \ + if (!oopDesc::is_null(heap_oop) && contains(referent_addr)) { \ ReferenceProcessor* rp = closure->_ref_processor; \ + oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); \ if (!referent->is_gc_marked() && (rp != NULL) && \ rp->discover_reference(obj, reference_type())) { \ return size; \ diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index 3f56d9c1ff6..a97cb0aadd6 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -84,8 +84,6 @@ oop objArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) { template void objArrayKlass::do_copy(arrayOop s, T* src, arrayOop d, T* dst, int length, TRAPS) { - const size_t word_len = objArrayOopDesc::array_size(length); - BarrierSet* bs = Universe::heap()->barrier_set(); // For performance reasons, we assume we are that the write barrier we // are using has optimized modes for arrays of references. At least one @@ -93,11 +91,10 @@ template void objArrayKlass::do_copy(arrayOop s, T* src, assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); - MemRegion dst_mr = MemRegion((HeapWord*)dst, word_len); if (s == d) { // since source and destination are equal we do not need conversion checks. assert(length > 0, "sanity check"); - bs->write_ref_array_pre(dst_mr); + bs->write_ref_array_pre(dst, length); Copy::conjoint_oops_atomic(src, dst, length); } else { // We have to make sure all elements conform to the destination array @@ -105,7 +102,7 @@ template void objArrayKlass::do_copy(arrayOop s, T* src, klassOop stype = objArrayKlass::cast(s->klass())->element_klass(); if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) { // elements are guaranteed to be subtypes, so no check necessary - bs->write_ref_array_pre(dst_mr); + bs->write_ref_array_pre(dst, length); Copy::conjoint_oops_atomic(src, dst, length); } else { // slow case: need individual subtype checks @@ -137,6 +134,7 @@ template void objArrayKlass::do_copy(arrayOop s, T* src, } } } + const size_t word_len = objArrayOopDesc::array_size(length); bs->write_ref_array(MemRegion((HeapWord*)dst, word_len)); } diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 5c4ad5a1e0d..962a075fbd1 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -148,12 +148,14 @@ inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; } inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) { assert(!is_null(v), "oop value can never be zero"); + assert(Universe::heap()->is_in_reserved(v), "Address not in heap"); address base = Universe::narrow_oop_base(); int shift = Universe::narrow_oop_shift(); uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); uint64_t result = pd >> shift; assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow"); + assert(decode_heap_oop(result) == v, "reversibility"); return (narrowOop)result; } @@ -449,7 +451,7 @@ inline void update_barrier_set(void* p, oop v) { oopDesc::bs()->write_ref_field(p, v); } -inline void update_barrier_set_pre(void* p, oop v) { +template inline void update_barrier_set_pre(T* p, oop v) { oopDesc::bs()->write_ref_field_pre(p, v); } @@ -459,15 +461,15 @@ template inline void oop_store(T* p, oop v) { } else { update_barrier_set_pre(p, v); oopDesc::encode_store_heap_oop(p, v); - update_barrier_set(p, v); + update_barrier_set((void*)p, v); // cast away type } } template inline void oop_store(volatile T* p, oop v) { - update_barrier_set_pre((void*)p, v); + update_barrier_set_pre((T*)p, v); // cast away volatile // Used by release_obj_field_put, so use release_store_ptr. oopDesc::release_encode_store_heap_oop(p, v); - update_barrier_set((void*)p, v); + update_barrier_set((void*)p, v); // cast away type } template inline void oop_store_without_check(T* p, oop v) { diff --git a/hotspot/src/share/vm/oops/oopsHierarchy.hpp b/hotspot/src/share/vm/oops/oopsHierarchy.hpp index 1e864522d97..4609f0efc72 100644 --- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp +++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp @@ -29,6 +29,7 @@ typedef juint narrowOop; // Offset instead of address for an oop within a java object typedef class klassOopDesc* wideKlassOop; // to keep SA happy and unhandled oop // detector happy. +typedef void* OopOrNarrowOopStar; #ifndef CHECK_UNHANDLED_OOPS diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index e48c15e7914..a81859cf83c 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -1789,7 +1789,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { #ifdef _LP64 // Push DecodeN down through phi. // The rest of phi graph will transform by split EncodeP node though phis up. - if (UseCompressedOops && can_reshape && progress == NULL) { + if (UseNewCode && UseCompressedOops && can_reshape && progress == NULL) { bool may_push = true; bool has_decodeN = false; Node* in_decodeN = NULL; diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 081f19fefd2..8bf06ef9064 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -1048,7 +1048,11 @@ UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapObject(JNIEnv *env, jobject unsafe, oop e = JNIHandles::resolve(e_h); oop p = JNIHandles::resolve(obj); HeapWord* addr = (HeapWord *)index_oop_from_field_offset_long(p, offset); - update_barrier_set_pre((void*)addr, e); + if (UseCompressedOops) { + update_barrier_set_pre((narrowOop*)addr, e); + } else { + update_barrier_set_pre((oop*)addr, e); + } oop res = oopDesc::atomic_compare_exchange_oop(x, addr, e); jboolean success = (res == e); if (success) diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index d86e7a9f16b..6eaa8cea6b8 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1202,18 +1202,13 @@ void Arguments::set_ergonomics_flags() { } #ifdef _LP64 - // Compressed Headers do not work with CMS, which uses a bit in the klass - // field offset to determine free list chunk markers. // Check that UseCompressedOops can be set with the max heap size allocated // by ergonomics. if (MaxHeapSize <= max_heap_for_compressed_oops()) { - if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { + if (FLAG_IS_DEFAULT(UseCompressedOops)) { // Turn off until bug is fixed. // the following line to return it to default status. // FLAG_SET_ERGO(bool, UseCompressedOops, true); - } else if (UseCompressedOops && UseG1GC) { - warning(" UseCompressedOops does not currently work with UseG1GC; switching off UseCompressedOops. "); - FLAG_SET_DEFAULT(UseCompressedOops, false); } #ifdef _WIN64 if (UseLargePages && UseCompressedOops) { @@ -1454,6 +1449,7 @@ bool Arguments::check_gc_consistency() { if (UseSerialGC) i++; if (UseConcMarkSweepGC || UseParNewGC) i++; if (UseParallelGC || UseParallelOldGC) i++; + if (UseG1GC) i++; if (i > 1) { jio_fprintf(defaultStream::error_stream(), "Conflicting collector combinations in option list; " @@ -2603,22 +2599,6 @@ jint Arguments::parse(const JavaVMInitArgs* args) { return result; } - // These are hacks until G1 is fully supported and tested - // but lets you force -XX:+UseG1GC in PRT and get it where it (mostly) works - if (UseG1GC) { - if (UseConcMarkSweepGC || UseParNewGC || UseParallelGC || UseParallelOldGC || UseSerialGC) { -#ifndef PRODUCT - tty->print_cr("-XX:+UseG1GC is incompatible with other collectors, using UseG1GC"); -#endif // PRODUCT - UseConcMarkSweepGC = false; - UseParNewGC = false; - UseParallelGC = false; - UseParallelOldGC = false; - UseSerialGC = false; - } - no_shared_spaces(); - } - #ifndef PRODUCT if (TraceBytecodesAt != 0) { TraceBytecodes = true; @@ -2676,10 +2656,7 @@ jint Arguments::parse(const JavaVMInitArgs* args) { } else if (UseParNewGC) { // Set some flags for ParNew set_parnew_gc_flags(); - } - // Temporary; make the "if" an "else-if" before - // we integrate G1. XXX - if (UseG1GC) { + } else if (UseG1GC) { // Set some flags for garbage-first, if needed. set_g1_gc_flags(); } diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index eed2afff8f9..01bd705c291 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -49,7 +49,7 @@ void SafepointSynchronize::begin() { // In the future we should investigate whether CMS can use the // more-general mechanism below. DLD (01/05). ConcurrentMarkSweepThread::synchronize(false); - } else { + } else if (UseG1GC) { ConcurrentGCThread::safepoint_synchronize(); } #endif // SERIALGC @@ -400,7 +400,7 @@ void SafepointSynchronize::end() { // If there are any concurrent GC threads resume them. if (UseConcMarkSweepGC) { ConcurrentMarkSweepThread::desynchronize(false); - } else { + } else if (UseG1GC) { ConcurrentGCThread::safepoint_desynchronize(); } #endif // SERIALGC diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 4709b6bd748..b729eeff2b5 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -119,6 +119,7 @@ JRT_LEAF(void, SharedRuntime::g1_wb_pre(oopDesc* orig, JavaThread *thread)) assert(false, "should be optimized out"); return; } + assert(orig->is_oop(true /* ignore mark word */), "Error"); // store the original value that was in the field reference thread->satb_mark_queue().enqueue(orig); JRT_END diff --git a/hotspot/src/share/vm/utilities/taskqueue.cpp b/hotspot/src/share/vm/utilities/taskqueue.cpp index 768f9b5580b..3a41b5754e1 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.cpp +++ b/hotspot/src/share/vm/utilities/taskqueue.cpp @@ -64,15 +64,18 @@ bool ParallelTaskTerminator::peek_in_queue_set() { } void ParallelTaskTerminator::yield() { + assert(_offered_termination <= _n_threads, "Invariant"); os::yield(); } void ParallelTaskTerminator::sleep(uint millis) { + assert(_offered_termination <= _n_threads, "Invariant"); os::sleep(Thread::current(), millis, false); } bool ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { + assert(_offered_termination < _n_threads, "Invariant"); Atomic::inc(&_offered_termination); uint yield_count = 0; @@ -96,6 +99,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { // Loop waiting for all threads to offer termination or // more work. while (true) { + assert(_offered_termination <= _n_threads, "Invariant"); // Are all threads offering termination? if (_offered_termination == _n_threads) { return true; @@ -151,6 +155,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { if (peek_in_queue_set() || (terminator != NULL && terminator->should_exit_termination())) { Atomic::dec(&_offered_termination); + assert(_offered_termination < _n_threads, "Invariant"); return false; } } diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp index 6b83bc083f5..489122afcd9 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.hpp +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp @@ -560,8 +560,14 @@ typedef GenericTaskQueueSet OopTaskQueueSet; class StarTask { void* _holder; // either union oop* or narrowOop* public: - StarTask(narrowOop *p) { _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK); } - StarTask(oop *p) { _holder = (void*)p; } + StarTask(narrowOop* p) { + assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!"); + _holder = (void *)((uintptr_t)p | COMPRESSED_OOP_MASK); + } + StarTask(oop* p) { + assert(((uintptr_t)p & COMPRESSED_OOP_MASK) == 0, "Information loss!"); + _holder = (void*)p; + } StarTask() { _holder = NULL; } operator oop*() { return (oop*)_holder; } operator narrowOop*() { From 26c66d001583ed3d5f38c866063cca74836b1dae Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Wed, 15 Jul 2009 12:22:59 -0400 Subject: [PATCH 55/91] 6859911: G1: assert(Heap_lock->owner() = NULL, "Should be owned on this thread's behalf") The used() method assumes that the heap lock is held when it is called. However, when used() is called from print_on(), this is not the case. Reviewed-by: ysr, jmasa --- .../src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 7 ++++++- .../src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index f7c53a71873..4f2ef1d5d78 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -1666,6 +1666,11 @@ size_t G1CollectedHeap::used() const { return result; } +size_t G1CollectedHeap::used_unlocked() const { + size_t result = _summary_bytes_used; + return result; +} + class SumUsedClosure: public HeapRegionClosure { size_t _used; public: @@ -2349,7 +2354,7 @@ void G1CollectedHeap::print_on(outputStream* st) const { void G1CollectedHeap::print_on(outputStream* st, bool extended) const { st->print(" %-20s", "garbage-first heap"); st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", - capacity()/K, used()/K); + capacity()/K, used_unlocked()/K); st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", _g1_storage.low_boundary(), _g1_storage.high(), diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 3dc60175986..2bf8b51299c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -700,6 +700,9 @@ public: size_t g1_reserved_obj_bytes() { return _g1_reserved.byte_size(); } virtual size_t capacity() const; virtual size_t used() const; + // This should be called when we're not holding the heap lock. The + // result might be a bit inaccurate. + size_t used_unlocked() const; size_t recalculate_used() const; #ifndef PRODUCT size_t recalculate_used_regions() const; From a24ea182cc2e56ab8e649f9fba3fca621d50f5e4 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Wed, 15 Jul 2009 13:37:35 -0700 Subject: [PATCH 56/91] 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post Co-authored-by: Chuck Rasbold Reviewed-by: never, kvn --- hotspot/src/share/vm/opto/loopopts.cpp | 5 +- hotspot/test/compiler/6860469/Test.java | 71 +++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 hotspot/test/compiler/6860469/Test.java diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 5084e3d8234..e7c02dca900 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -346,7 +346,10 @@ Node *PhaseIdealLoop::remix_address_expressions( Node *n ) { // Yes! Reshape address expression! Node *inv_scale = new (C, 3) LShiftINode( add_invar, scale ); - register_new_node( inv_scale, add_invar_ctrl ); + Node *inv_scale_ctrl = + dom_depth(add_invar_ctrl) > dom_depth(scale_ctrl) ? + add_invar_ctrl : scale_ctrl; + register_new_node( inv_scale, inv_scale_ctrl ); Node *var_scale = new (C, 3) LShiftINode( add_var, scale ); register_new_node( var_scale, n_ctrl ); Node *var_add = new (C, 3) AddINode( var_scale, inv_scale ); diff --git a/hotspot/test/compiler/6860469/Test.java b/hotspot/test/compiler/6860469/Test.java new file mode 100644 index 00000000000..0e7771b24fc --- /dev/null +++ b/hotspot/test/compiler/6860469/Test.java @@ -0,0 +1,71 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +/** + * @test + * @bug 6860469 + * @summary remix_address_expressions reshapes address expression with bad control + * + * @run main/othervm -Xcomp -XX:CompileOnly=Test.C Test + */ + +public class Test { + + private static final int H = 16; + private static final int F = 9; + + static int[] fl = new int[1 << F]; + + static int C(int ll, int f) { + int max = -1; + int min = H + 1; + + if (ll != 0) { + if (ll < min) { + min = ll; + } + if (ll > max) { + max = ll; + } + } + + if (f > max) { + f = max; + } + if (min > f) { + min = f; + } + + for (int mc = 1 >> max - f; mc <= 0; mc++) { + int i = mc << (32 - f); + fl[i] = max; + } + + return min; + } + + public static void main(String argv[]) { + C(0, 10); + } +} From addbc1de711aff94b0e991d667fc76c0e2f7f4bf Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:04 -0700 Subject: [PATCH 57/91] Added tag jdk7-b65 for changeset f5311292903a --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 6b4351ee95a..3b501dece9d 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -39,3 +39,4 @@ ffd09e767dfa6d21466183a400f72cf62d53297f jdk7-b57 c7ed15ab92ce36a09d264a5e34025884b2d7607f jdk7-b62 57f7e028c7ad1806500ae89eb3f4cd9a51b10e18 jdk7-b63 269c1ec4435dfb7b452ae6e3bdde005d55c5c830 jdk7-b64 +e01380cd1de4ce048b87d059d238e5ab5e341947 jdk7-b65 From a9c0cc5110763a4dcc5e80a5c2195df55d48a607 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:05 -0700 Subject: [PATCH 58/91] Added tag jdk7-b65 for changeset 2ad3a445ce89 --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 0bb9b5fe667..e9712d235d3 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -39,3 +39,4 @@ e906b16a12a9a63b615898afa5d9673cbd1c5ab8 jdk7-b61 65b66117dbd70a493e9644aeb4033cf95a4e3c99 jdk7-b62 d20e45cd539f20405ff843652069cfd7550c5ab3 jdk7-b63 047dd27fddb607f8135296b3754131f6e13cb8c7 jdk7-b64 +97fd9b42f5c2d342b90d18f0a2b57e4117e39415 jdk7-b65 From 7edbc2373cfc3e23c8c4bc07c2ff70a2ecf59120 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:09 -0700 Subject: [PATCH 59/91] Added tag jdk7-b65 for changeset 60611616dba4 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 0e026969a54..82f00b1c160 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -39,3 +39,4 @@ a77eddcd510c3972717c025cfcef9a60bfa4ecac jdk7-b60 a88386380bdaaa5ab4ffbedf22c57bac5dbec034 jdk7-b62 32c83fb84370a35344676991a48440378e6b6c8a jdk7-b63 ba36394eb84b949b31212bdb32a518a8f92bab5b jdk7-b64 +ba313800759b678979434d6da8ed3bf49eb8bea4 jdk7-b65 From 9b9bfcc5ffaabc7882708099e820a9e471eea70c Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:13 -0700 Subject: [PATCH 60/91] Added tag jdk7-b65 for changeset 98a2177833c8 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 67a0b9e2e17..2713e5f9d70 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -39,3 +39,4 @@ f1ac756616eaaad795f77f7f5e7f7c7bfdc9c1de jdk7-b61 a97dd57a62604c35c79bc2fa77a612ed547f6135 jdk7-b62 ae449e9c04c1fe651bd30f0f4d4cc24ba794e0c4 jdk7-b63 a10eec7a1edf536f39b5828d8623054dbc62c2b7 jdk7-b64 +008c662e0ee9a91aebb75e46b97de979083d5c1c jdk7-b65 From 9243a3226550d0fa07b0cc0f4efdc7954bddcb40 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:15 -0700 Subject: [PATCH 61/91] Added tag jdk7-b65 for changeset 83ac5deac923 --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 3645edaf091..d85a9e3d5f0 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -39,3 +39,4 @@ aeabf802f2a1ca72b87d7397c5ece58058e000a9 jdk7-b61 75c801c13ea1ddebc58b1a8c8da9318d72750e62 jdk7-b62 b8a6e883c0a6708f6d818815040525d472262495 jdk7-b63 aaa25dfd3de68c6f1a1d3ef8c45fd99f76bca6dd jdk7-b64 +aa22a1be5866a6608ba17a7a443945559409ae0f jdk7-b65 From 27e3d0608ddf5ecccbd79150108bd2835b1cc22c Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:21 -0700 Subject: [PATCH 62/91] Added tag jdk7-b65 for changeset 6d887683b2b4 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 4b9e6d23082..b1cc226d467 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -39,3 +39,4 @@ f72c0dc047b9b2e797beee68ae0b50decb1f020d jdk7-b61 12e11fab9a839a9666a996a8f9a02fd8fa03aab6 jdk7-b62 2ed6ed6b5bfc7dd724925b90dbb31223df59c25d jdk7-b63 a50217eb3ee10b9f9547e0708e5c9625405083ef jdk7-b64 +382a27aa78d3236fa123c60577797a887fe93e09 jdk7-b65 From c524fb1e6646bf3c3ee29feedff066a9fbe2bc22 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Thu, 16 Jul 2009 10:53:31 -0700 Subject: [PATCH 63/91] Added tag jdk7-b65 for changeset dde9c43422cd --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index 0bb6612a24f..4d03a266a98 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -39,3 +39,4 @@ dbdeb4a7581b2a8699644b91cae6793cb01953f7 jdk7-b53 6855e5aa3348f185fe5b443ee43a1b00ec5d390e jdk7-b62 5c2c8112055565b4980b6756e001e45eb7b88d6e jdk7-b63 d8f23a81d46f47a4186f1044dd9e44841bbeab84 jdk7-b64 +7e0056ded28c802609d2bd79bfcda551d72a3fec jdk7-b65 From c3efa899b62ed8b89990fdcab0a109d9de840bd2 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Thu, 16 Jul 2009 14:10:42 -0700 Subject: [PATCH 64/91] 6851742: (EA) allocation elimination doesn't work with UseG1GC Fix eliminate_card_mark() to eliminate G1 pre/post barriers. Reviewed-by: never --- hotspot/src/share/vm/opto/escape.cpp | 16 +- hotspot/src/share/vm/opto/graphKit.cpp | 324 +++++++++------------ hotspot/src/share/vm/opto/graphKit.hpp | 30 +- hotspot/src/share/vm/opto/idealKit.cpp | 25 +- hotspot/src/share/vm/opto/idealKit.hpp | 11 +- hotspot/src/share/vm/opto/ifnode.cpp | 13 +- hotspot/src/share/vm/opto/library_call.cpp | 31 +- hotspot/src/share/vm/opto/machnode.cpp | 6 + hotspot/src/share/vm/opto/macro.cpp | 82 +++++- hotspot/src/share/vm/opto/matcher.cpp | 3 +- hotspot/src/share/vm/opto/phaseX.hpp | 2 + hotspot/src/share/vm/opto/type.hpp | 4 + 12 files changed, 315 insertions(+), 232 deletions(-) diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index ed3067e9e94..a9be52b6e35 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -578,11 +578,24 @@ PhiNode *ConnectionGraph::create_split_phi(PhiNode *orig_phi, int alias_idx, Gro if (phi_alias_idx == alias_idx) { return orig_phi; } - // have we already created a Phi for this alias index? + // Have we recently created a Phi for this alias index? PhiNode *result = get_map_phi(orig_phi->_idx); if (result != NULL && C->get_alias_index(result->adr_type()) == alias_idx) { return result; } + // Previous check may fail when the same wide memory Phi was split into Phis + // for different memory slices. Search all Phis for this region. + if (result != NULL) { + Node* region = orig_phi->in(0); + for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { + Node* phi = region->fast_out(i); + if (phi->is_Phi() && + C->get_alias_index(phi->as_Phi()->adr_type()) == alias_idx) { + assert(phi->_idx >= nodes_size(), "only new Phi per instance memory slice"); + return phi->as_Phi(); + } + } + } if ((int)C->unique() + 2*NodeLimitFudgeFactor > MaxNodeLimit) { if (C->do_escape_analysis() == true && !C->failing()) { // Retry compilation without escape analysis. @@ -595,6 +608,7 @@ PhiNode *ConnectionGraph::create_split_phi(PhiNode *orig_phi, int alias_idx, Gro orig_phi_worklist.append_if_missing(orig_phi); const TypePtr *atype = C->get_adr_type(alias_idx); result = PhiNode::make(orig_phi->in(0), NULL, Type::MEMORY, atype); + C->copy_node_notes_to(result, orig_phi); set_map_phi(orig_phi->_idx, result); igvn->set_type(result, result->bottom_type()); record_for_optimizer(result); diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 83646c54ed9..90ffdfca8cb 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1373,11 +1373,12 @@ Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt, return st; } + void GraphKit::pre_barrier(Node* ctl, Node* obj, Node* adr, - uint adr_idx, - Node *val, + uint adr_idx, + Node* val, const TypeOopPtr* val_type, BasicType bt) { BarrierSet* bs = Universe::heap()->barrier_set(); @@ -1385,7 +1386,7 @@ void GraphKit::pre_barrier(Node* ctl, switch (bs->kind()) { case BarrierSet::G1SATBCT: case BarrierSet::G1SATBCTLogging: - g1_write_barrier_pre(obj, adr, adr_idx, val, val_type, bt); + g1_write_barrier_pre(obj, adr, adr_idx, val, val_type, bt); break; case BarrierSet::CardTableModRef: @@ -1404,8 +1405,8 @@ void GraphKit::post_barrier(Node* ctl, Node* store, Node* obj, Node* adr, - uint adr_idx, - Node *val, + uint adr_idx, + Node* val, BasicType bt, bool use_precise) { BarrierSet* bs = Universe::heap()->barrier_set(); @@ -1413,7 +1414,7 @@ void GraphKit::post_barrier(Node* ctl, switch (bs->kind()) { case BarrierSet::G1SATBCT: case BarrierSet::G1SATBCTLogging: - g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); + g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); break; case BarrierSet::CardTableModRef: @@ -1431,42 +1432,36 @@ void GraphKit::post_barrier(Node* ctl, } } -Node* GraphKit::store_oop_to_object(Node* ctl, - Node* obj, - Node* adr, - const TypePtr* adr_type, - Node *val, - const TypeOopPtr* val_type, - BasicType bt) { +Node* GraphKit::store_oop(Node* ctl, + Node* obj, + Node* adr, + const TypePtr* adr_type, + Node* val, + const TypeOopPtr* val_type, + BasicType bt, + bool use_precise) { + + set_control(ctl); + if (stopped()) return top(); // Dead path ? + + assert(bt == T_OBJECT, "sanity"); + assert(val != NULL, "not dead path"); uint adr_idx = C->get_alias_index(adr_type); - Node* store; - pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); - store = store_to_memory(control(), adr, val, bt, adr_idx); - post_barrier(control(), store, obj, adr, adr_idx, val, bt, false); - return store; -} - -Node* GraphKit::store_oop_to_array(Node* ctl, - Node* obj, - Node* adr, - const TypePtr* adr_type, - Node *val, - const TypeOopPtr* val_type, - BasicType bt) { - uint adr_idx = C->get_alias_index(adr_type); - Node* store; - pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); - store = store_to_memory(control(), adr, val, bt, adr_idx); - post_barrier(control(), store, obj, adr, adr_idx, val, bt, true); + assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" ); + + pre_barrier(control(), obj, adr, adr_idx, val, val_type, bt); + Node* store = store_to_memory(control(), adr, val, bt, adr_idx); + post_barrier(control(), store, obj, adr, adr_idx, val, bt, use_precise); return store; } +// Could be an array or object we don't know at compile time (unsafe ref.) Node* GraphKit::store_oop_to_unknown(Node* ctl, - Node* obj, - Node* adr, - const TypePtr* adr_type, - Node *val, - BasicType bt) { + Node* obj, // containing obj + Node* adr, // actual adress to store val at + const TypePtr* adr_type, + Node* val, + BasicType bt) { Compile::AliasType* at = C->alias_type(adr_type); const TypeOopPtr* val_type = NULL; if (adr_type->isa_instptr()) { @@ -1485,12 +1480,7 @@ Node* GraphKit::store_oop_to_unknown(Node* ctl, if (val_type == NULL) { val_type = TypeInstPtr::BOTTOM; } - - uint adr_idx = at->index(); - pre_barrier(ctl, obj, adr, adr_idx, val, val_type, bt); - Node* store = store_to_memory(control(), adr, val, bt, adr_idx); - post_barrier(control(), store, obj, adr, adr_idx, val, bt, true); - return store; + return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true); } @@ -1804,93 +1794,6 @@ Node* GraphKit::just_allocated_object(Node* current_control) { } -//------------------------------store_barrier---------------------------------- -// Insert a write-barrier store. This is to let generational GC work; we have -// to flag all oop-stores before the next GC point. -void GraphKit::write_barrier_post(Node* oop_store, Node* obj, Node* adr, - Node* val, bool use_precise) { - // No store check needed if we're storing a NULL or an old object - // (latter case is probably a string constant). The concurrent - // mark sweep garbage collector, however, needs to have all nonNull - // oop updates flagged via card-marks. - if (val != NULL && val->is_Con()) { - // must be either an oop or NULL - const Type* t = val->bottom_type(); - if (t == TypePtr::NULL_PTR || t == Type::TOP) - // stores of null never (?) need barriers - return; - ciObject* con = t->is_oopptr()->const_oop(); - if (con != NULL - && con->is_perm() - && Universe::heap()->can_elide_permanent_oop_store_barriers()) - // no store barrier needed, because no old-to-new ref created - return; - } - - if (use_ReduceInitialCardMarks() - && obj == just_allocated_object(control())) { - // We can skip marks on a freshly-allocated object. - // Keep this code in sync with do_eager_card_mark in runtime.cpp. - // That routine eagerly marks the occasional object which is produced - // by the slow path, so that we don't have to do it here. - return; - } - - if (!use_precise) { - // All card marks for a (non-array) instance are in one place: - adr = obj; - } - // (Else it's an array (or unknown), and we want more precise card marks.) - assert(adr != NULL, ""); - - // Get the alias_index for raw card-mark memory - int adr_type = Compile::AliasIdxRaw; - // Convert the pointer to an int prior to doing math on it - Node* cast = _gvn.transform(new (C, 2) CastP2XNode(control(), adr)); - // Divide by card size - assert(Universe::heap()->barrier_set()->kind() == BarrierSet::CardTableModRef, - "Only one we handle so far."); - CardTableModRefBS* ct = - (CardTableModRefBS*)(Universe::heap()->barrier_set()); - Node *b = _gvn.transform(new (C, 3) URShiftXNode( cast, _gvn.intcon(CardTableModRefBS::card_shift) )); - // We store into a byte array, so do not bother to left-shift by zero - Node *c = byte_map_base_node(); - // Combine - Node *sb_ctl = control(); - Node *sb_adr = _gvn.transform(new (C, 4) AddPNode( top()/*no base ptr*/, c, b )); - Node *sb_val = _gvn.intcon(0); - // Smash zero into card - if( !UseConcMarkSweepGC ) { - BasicType bt = T_BYTE; - store_to_memory(sb_ctl, sb_adr, sb_val, bt, adr_type); - } else { - // Specialized path for CM store barrier - cms_card_mark( sb_ctl, sb_adr, sb_val, oop_store); - } -} - -// Specialized path for CMS store barrier -void GraphKit::cms_card_mark(Node* ctl, Node* adr, Node* val, Node *oop_store) { - BasicType bt = T_BYTE; - int adr_idx = Compile::AliasIdxRaw; - Node* mem = memory(adr_idx); - - // The type input is NULL in PRODUCT builds - const TypePtr* type = NULL; - debug_only(type = C->get_adr_type(adr_idx)); - - // Add required edge to oop_store, optimizer does not support precedence edges. - // Convert required edge to precedence edge before allocation. - Node *store = _gvn.transform( new (C, 5) StoreCMNode(ctl, mem, adr, type, val, oop_store) ); - set_memory(store, adr_idx); - - // For CMS, back-to-back card-marks can only remove the first one - // and this requires DU info. Push on worklist for optimizer. - if (mem->req() > MemNode::Address && adr == mem->in(MemNode::Address)) - record_for_igvn(store); -} - - void GraphKit::round_double_arguments(ciMethod* dest_method) { // (Note: TypeFunc::make has a cache that makes this fast.) const TypeFunc* tf = TypeFunc::make(dest_method); @@ -3215,6 +3118,79 @@ InitializeNode* AllocateNode::initialization() { return NULL; } +//----------------------------- store barriers ---------------------------- +#define __ ideal. + +void GraphKit::sync_kit(IdealKit& ideal) { + // Final sync IdealKit and graphKit. + __ drain_delay_transform(); + set_all_memory(__ merged_memory()); + set_control(__ ctrl()); +} + +// vanilla/CMS post barrier +// Insert a write-barrier store. This is to let generational GC work; we have +// to flag all oop-stores before the next GC point. +void GraphKit::write_barrier_post(Node* oop_store, + Node* obj, + Node* adr, + Node* val, + bool use_precise) { + // No store check needed if we're storing a NULL or an old object + // (latter case is probably a string constant). The concurrent + // mark sweep garbage collector, however, needs to have all nonNull + // oop updates flagged via card-marks. + if (val != NULL && val->is_Con()) { + // must be either an oop or NULL + const Type* t = val->bottom_type(); + if (t == TypePtr::NULL_PTR || t == Type::TOP) + // stores of null never (?) need barriers + return; + ciObject* con = t->is_oopptr()->const_oop(); + if (con != NULL + && con->is_perm() + && Universe::heap()->can_elide_permanent_oop_store_barriers()) + // no store barrier needed, because no old-to-new ref created + return; + } + + if (!use_precise) { + // All card marks for a (non-array) instance are in one place: + adr = obj; + } + // (Else it's an array (or unknown), and we want more precise card marks.) + assert(adr != NULL, ""); + + IdealKit ideal(gvn(), control(), merged_memory(), true); + + // Convert the pointer to an int prior to doing math on it + Node* cast = __ CastPX(__ ctrl(), adr); + + // Divide by card size + assert(Universe::heap()->barrier_set()->kind() == BarrierSet::CardTableModRef, + "Only one we handle so far."); + Node* card_offset = __ URShiftX( cast, __ ConI(CardTableModRefBS::card_shift) ); + + // Combine card table base and card offset + Node* card_adr = __ AddP(__ top(), byte_map_base_node(), card_offset ); + + // Get the alias_index for raw card-mark memory + int adr_type = Compile::AliasIdxRaw; + // Smash zero into card + Node* zero = __ ConI(0); + BasicType bt = T_BYTE; + if( !UseConcMarkSweepGC ) { + __ store(__ ctrl(), card_adr, zero, bt, adr_type); + } else { + // Specialized path for CM store barrier + __ storeCM(__ ctrl(), card_adr, zero, oop_store, bt, adr_type); + } + + // Final sync IdealKit and GraphKit. + sync_kit(ideal); +} + +// G1 pre/post barriers void GraphKit::g1_write_barrier_pre(Node* obj, Node* adr, uint alias_idx, @@ -3222,10 +3198,8 @@ void GraphKit::g1_write_barrier_pre(Node* obj, const TypeOopPtr* val_type, BasicType bt) { IdealKit ideal(gvn(), control(), merged_memory(), true); -#define __ ideal. - __ declares_done(); - Node* thread = __ thread(); + Node* tls = __ thread(); // ThreadLocalStorage Node* no_ctrl = NULL; Node* no_base = __ top(); @@ -3248,9 +3222,9 @@ void GraphKit::g1_write_barrier_pre(Node* obj, // set_control( ctl); - Node* marking_adr = __ AddP(no_base, thread, __ ConX(marking_offset)); - Node* buffer_adr = __ AddP(no_base, thread, __ ConX(buffer_offset)); - Node* index_adr = __ AddP(no_base, thread, __ ConX(index_offset)); + Node* marking_adr = __ AddP(no_base, tls, __ ConX(marking_offset)); + Node* buffer_adr = __ AddP(no_base, tls, __ ConX(buffer_offset)); + Node* index_adr = __ AddP(no_base, tls, __ ConX(index_offset)); // Now some of the values @@ -3278,55 +3252,52 @@ void GraphKit::g1_write_barrier_pre(Node* obj, Node* next_index = __ SubI(index, __ ConI(sizeof(intptr_t))); Node* next_indexX = next_index; #ifdef _LP64 - // We could refine the type for what it's worth - // const TypeLong* lidxtype = TypeLong::make(CONST64(0), get_size_from_queue); - next_indexX = _gvn.transform( new (C, 2) ConvI2LNode(next_index, TypeLong::make(0, max_jlong, Type::WidenMax)) ); -#endif // _LP64 + // We could refine the type for what it's worth + // const TypeLong* lidxtype = TypeLong::make(CONST64(0), get_size_from_queue); + next_indexX = _gvn.transform( new (C, 2) ConvI2LNode(next_index, TypeLong::make(0, max_jlong, Type::WidenMax)) ); +#endif // Now get the buffer location we will log the original value into and store it - Node *log_addr = __ AddP(no_base, buffer, next_indexX); - // __ store(__ ctrl(), log_addr, orig, T_OBJECT, C->get_alias_index(TypeOopPtr::BOTTOM)); __ store(__ ctrl(), log_addr, orig, T_OBJECT, Compile::AliasIdxRaw); - // update the index - // __ store(__ ctrl(), index_adr, next_index, T_INT, Compile::AliasIdxRaw); - // This is a hack to force this store to occur before the oop store that is coming up - __ store(__ ctrl(), index_adr, next_index, T_INT, C->get_alias_index(TypeOopPtr::BOTTOM)); + __ store(__ ctrl(), index_adr, next_index, T_INT, Compile::AliasIdxRaw); } __ else_(); { // logging buffer is full, call the runtime const TypeFunc *tf = OptoRuntime::g1_wb_pre_Type(); - // __ make_leaf_call(tf, OptoRuntime::g1_wb_pre_Java(), "g1_wb_pre", orig, thread); - __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), "g1_wb_pre", orig, thread); - } __ end_if(); - } __ end_if(); - } __ end_if(); + __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), "g1_wb_pre", orig, tls); + } __ end_if(); // (!index) + } __ end_if(); // (orig != NULL) + } __ end_if(); // (!marking) - __ drain_delay_transform(); - set_control( __ ctrl()); - set_all_memory( __ merged_memory()); - -#undef __ + // Final sync IdealKit and GraphKit. + sync_kit(ideal); } // // Update the card table and add card address to the queue // -void GraphKit::g1_mark_card(IdealKit* ideal, Node* card_adr, Node* store, Node* index, Node* index_adr, Node* buffer, const TypeFunc* tf) { -#define __ ideal-> +void GraphKit::g1_mark_card(IdealKit& ideal, + Node* card_adr, + Node* oop_store, + Node* index, + Node* index_adr, + Node* buffer, + const TypeFunc* tf) { + Node* zero = __ ConI(0); Node* no_base = __ top(); BasicType card_bt = T_BYTE; // Smash zero into card. MUST BE ORDERED WRT TO STORE - __ storeCM(__ ctrl(), card_adr, zero, store, card_bt, Compile::AliasIdxRaw); + __ storeCM(__ ctrl(), card_adr, zero, oop_store, card_bt, Compile::AliasIdxRaw); // Now do the queue work __ if_then(index, BoolTest::ne, zero); { - Node* next_index = __ SubI(index, __ ConI(sizeof(intptr_t))); + Node* next_index = __ SubI(index, __ ConI(sizeof(intptr_t))); Node* next_indexX = next_index; #ifdef _LP64 // We could refine the type for what it's worth @@ -3341,10 +3312,10 @@ void GraphKit::g1_mark_card(IdealKit* ideal, Node* card_adr, Node* store, Node* } __ else_(); { __ make_leaf_call(tf, CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), "g1_wb_post", card_adr, __ thread()); } __ end_if(); -#undef __ + } -void GraphKit::g1_write_barrier_post(Node* store, +void GraphKit::g1_write_barrier_post(Node* oop_store, Node* obj, Node* adr, uint alias_idx, @@ -3369,10 +3340,8 @@ void GraphKit::g1_write_barrier_post(Node* store, assert(adr != NULL, ""); IdealKit ideal(gvn(), control(), merged_memory(), true); -#define __ ideal. - __ declares_done(); - Node* thread = __ thread(); + Node* tls = __ thread(); // ThreadLocalStorage Node* no_ctrl = NULL; Node* no_base = __ top(); @@ -3394,8 +3363,8 @@ void GraphKit::g1_write_barrier_post(Node* store, // Pointers into the thread - Node* buffer_adr = __ AddP(no_base, thread, __ ConX(buffer_offset)); - Node* index_adr = __ AddP(no_base, thread, __ ConX(index_offset)); + Node* buffer_adr = __ AddP(no_base, tls, __ ConX(buffer_offset)); + Node* index_adr = __ AddP(no_base, tls, __ ConX(index_offset)); // Now some values @@ -3404,18 +3373,14 @@ void GraphKit::g1_write_barrier_post(Node* store, // Convert the store obj pointer to an int prior to doing math on it - // Use addr not obj gets accurate card marks - - // Node* cast = __ CastPX(no_ctrl, adr /* obj */); - // Must use ctrl to prevent "integerized oop" existing across safepoint - Node* cast = __ CastPX(__ ctrl(), ( use_precise ? adr : obj )); + Node* cast = __ CastPX(__ ctrl(), adr); // Divide pointer by card size Node* card_offset = __ URShiftX( cast, __ ConI(CardTableModRefBS::card_shift) ); // Combine card table base and card offset - Node *card_adr = __ AddP(no_base, byte_map_base_node(), card_offset ); + Node* card_adr = __ AddP(no_base, byte_map_base_node(), card_offset ); // If we know the value being stored does it cross regions? @@ -3439,18 +3404,17 @@ void GraphKit::g1_write_barrier_post(Node* store, Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); __ if_then(card_val, BoolTest::ne, zero); { - g1_mark_card(&ideal, card_adr, store, index, index_adr, buffer, tf); + g1_mark_card(ideal, card_adr, oop_store, index, index_adr, buffer, tf); } __ end_if(); } __ end_if(); } __ end_if(); } else { - g1_mark_card(&ideal, card_adr, store, index, index_adr, buffer, tf); + // Object.clone() instrinsic uses this path. + g1_mark_card(ideal, card_adr, oop_store, index, index_adr, buffer, tf); } - - __ drain_delay_transform(); - set_control( __ ctrl()); - set_all_memory( __ merged_memory()); + // Final sync IdealKit and GraphKit. + sync_kit(ideal); +} #undef __ -} diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 7904a0b0f2f..cd4fceff9d9 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -449,13 +449,24 @@ class GraphKit : public Phase { // // If val==NULL, it is taken to be a completely unknown value. QQQ + Node* store_oop(Node* ctl, + Node* obj, // containing obj + Node* adr, // actual adress to store val at + const TypePtr* adr_type, + Node* val, + const TypeOopPtr* val_type, + BasicType bt, + bool use_precise); + Node* store_oop_to_object(Node* ctl, Node* obj, // containing obj Node* adr, // actual adress to store val at const TypePtr* adr_type, Node* val, const TypeOopPtr* val_type, - BasicType bt); + BasicType bt) { + return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false); + } Node* store_oop_to_array(Node* ctl, Node* obj, // containing obj @@ -463,7 +474,9 @@ class GraphKit : public Phase { const TypePtr* adr_type, Node* val, const TypeOopPtr* val_type, - BasicType bt); + BasicType bt) { + return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true); + } // Could be an array or object we don't know at compile time (unsafe ref.) Node* store_oop_to_unknown(Node* ctl, @@ -488,9 +501,6 @@ class GraphKit : public Phase { // Return a load of array element at idx. Node* load_array_element(Node* ctl, Node* ary, Node* idx, const TypeAryPtr* arytype); - // CMS card-marks have an input from the corresponding oop_store - void cms_card_mark(Node* ctl, Node* adr, Node* val, Node* oop_store); - //---------------- Dtrace support -------------------- void make_dtrace_method_entry_exit(ciMethod* method, bool is_entry); void make_dtrace_method_entry(ciMethod* method) { @@ -582,9 +592,6 @@ class GraphKit : public Phase { return C->too_many_recompiles(method(), bci(), reason); } - // vanilla/CMS post barrier - void write_barrier_post(Node *store, Node* obj, Node* adr, Node* val, bool use_precise); - // Returns the object (if any) which was created the moment before. Node* just_allocated_object(Node* current_control); @@ -593,6 +600,11 @@ class GraphKit : public Phase { && Universe::heap()->can_elide_tlab_store_barriers()); } + void sync_kit(IdealKit& ideal); + + // vanilla/CMS post barrier + void write_barrier_post(Node *store, Node* obj, Node* adr, Node* val, bool use_precise); + // G1 pre/post barriers void g1_write_barrier_pre(Node* obj, Node* adr, @@ -610,7 +622,7 @@ class GraphKit : public Phase { bool use_precise); // Helper function for g1 private: - void g1_mark_card(IdealKit* ideal, Node* card_adr, Node* store, Node* index, Node* index_adr, + void g1_mark_card(IdealKit& ideal, Node* card_adr, Node* store, Node* index, Node* index_adr, Node* buffer, const TypeFunc* tf); public: diff --git a/hotspot/src/share/vm/opto/idealKit.cpp b/hotspot/src/share/vm/opto/idealKit.cpp index 026a22f0c7a..0631d905eb0 100644 --- a/hotspot/src/share/vm/opto/idealKit.cpp +++ b/hotspot/src/share/vm/opto/idealKit.cpp @@ -34,7 +34,7 @@ const uint IdealKit::first_var = TypeFunc::Parms + 1; //----------------------------IdealKit----------------------------------------- -IdealKit::IdealKit(PhaseGVN &gvn, Node* control, Node* mem, bool delay_all_transforms) : +IdealKit::IdealKit(PhaseGVN &gvn, Node* control, Node* mem, bool delay_all_transforms, bool has_declarations) : _gvn(gvn), C(gvn.C) { _initial_ctrl = control; _initial_memory = mem; @@ -47,6 +47,9 @@ IdealKit::IdealKit(PhaseGVN &gvn, Node* control, Node* mem, bool delay_all_trans _pending_cvstates = new (C->node_arena()) GrowableArray(C->node_arena(), init_size, 0, 0); _delay_transform = new (C->node_arena()) GrowableArray(C->node_arena(), init_size, 0, 0); DEBUG_ONLY(_state = new (C->node_arena()) GrowableArray(C->node_arena(), init_size, 0, 0)); + if (!has_declarations) { + declarations_done(); + } } //-------------------------------if_then------------------------------------- @@ -97,7 +100,7 @@ void IdealKit::else_() { //-------------------------------end_if------------------------------------- // Merge the "then" and "else" cvstates. // -// The if_then() pushed the current state for later use +// The if_then() pushed a copy of the current state for later use // as the initial state for a future "else" clause. The // current state then became the initial state for the // then clause. If an "else" clause was encountered, it will @@ -258,8 +261,8 @@ Node* IdealKit::promote_to_phi(Node* n, Node* reg) { return delay_transform(PhiNode::make(reg, n, ct)); } -//-----------------------------declares_done----------------------------------- -void IdealKit::declares_done() { +//-----------------------------declarations_done------------------------------- +void IdealKit::declarations_done() { _cvstate = new_cvstate(); // initialize current cvstate set_ctrl(_initial_ctrl); // initialize control in current cvstate set_all_memory(_initial_memory);// initialize memory in current cvstate @@ -277,7 +280,9 @@ Node* IdealKit::transform(Node* n) { //-----------------------------delay_transform----------------------------------- Node* IdealKit::delay_transform(Node* n) { - gvn().set_type(n, n->bottom_type()); + if (!gvn().is_IterGVN() || !gvn().is_IterGVN()->delay_transform()) { + gvn().set_type(n, n->bottom_type()); + } _delay_transform->push(n); return n; } @@ -321,7 +326,9 @@ IdealVariable::IdealVariable(IdealKit &k) { Node* IdealKit::memory(uint alias_idx) { MergeMemNode* mem = merged_memory(); Node* p = mem->memory_at(alias_idx); - _gvn.set_type(p, Type::MEMORY); // must be mapped + if (!gvn().is_IterGVN() || !gvn().is_IterGVN()->delay_transform()) { + _gvn.set_type(p, Type::MEMORY); // must be mapped + } return p; } @@ -462,9 +469,6 @@ void IdealKit::make_leaf_call(const TypeFunc *slow_call_type, const TypePtr* adr_type = TypeRawPtr::BOTTOM; uint adr_idx = C->get_alias_index(adr_type); - // Clone initial memory - MergeMemNode* cloned_mem = MergeMemNode::make(C, merged_memory()); - // Slow-path leaf call int size = slow_call_type->domain()->cnt(); CallNode *call = (CallNode*)new (C, size) CallLeafNode( slow_call_type, slow_call, leaf_name, adr_type); @@ -489,9 +493,6 @@ void IdealKit::make_leaf_call(const TypeFunc *slow_call_type, set_ctrl(transform( new (C, 1) ProjNode(call,TypeFunc::Control) )); - // Set the incoming clone of memory as current memory - set_all_memory(cloned_mem); - // Make memory for the call Node* mem = _gvn.transform( new (C, 1) ProjNode(call, TypeFunc::Memory) ); diff --git a/hotspot/src/share/vm/opto/idealKit.hpp b/hotspot/src/share/vm/opto/idealKit.hpp index 5ccdb77b3b7..817ed4de2c1 100644 --- a/hotspot/src/share/vm/opto/idealKit.hpp +++ b/hotspot/src/share/vm/opto/idealKit.hpp @@ -49,7 +49,7 @@ // Example: // Node* limit = ?? // IdealVariable i(kit), j(kit); -// declares_done(); +// declarations_done(); // Node* exit = make_label(1); // 1 goto // set(j, ConI(0)); // loop(i, ConI(0), BoolTest::lt, limit); { @@ -101,10 +101,7 @@ class IdealKit: public StackObj { Node* new_cvstate(); // Create a new cvstate Node* cvstate() { return _cvstate; } // current cvstate Node* copy_cvstate(); // copy current cvstate - void set_ctrl(Node* ctrl) { _cvstate->set_req(TypeFunc::Control, ctrl); } - // Should this assert this is a MergeMem??? - void set_all_memory(Node* mem){ _cvstate->set_req(TypeFunc::Memory, mem); } void set_memory(Node* mem, uint alias_idx ); void do_memory_merge(Node* merging, Node* join); void clear(Node* m); // clear a cvstate @@ -132,15 +129,17 @@ class IdealKit: public StackObj { Node* memory(uint alias_idx); public: - IdealKit(PhaseGVN &gvn, Node* control, Node* memory, bool delay_all_transforms = false); + IdealKit(PhaseGVN &gvn, Node* control, Node* memory, bool delay_all_transforms = false, bool has_declarations = false); ~IdealKit() { stop(); drain_delay_transform(); } // Control Node* ctrl() { return _cvstate->in(TypeFunc::Control); } + void set_ctrl(Node* ctrl) { _cvstate->set_req(TypeFunc::Control, ctrl); } Node* top() { return C->top(); } MergeMemNode* merged_memory() { return _cvstate->in(TypeFunc::Memory)->as_MergeMem(); } + void set_all_memory(Node* mem) { _cvstate->set_req(TypeFunc::Memory, mem); } void set(IdealVariable& v, Node* rhs) { _cvstate->set_req(first_var + v.id(), rhs); } Node* value(IdealVariable& v) { return _cvstate->in(first_var + v.id()); } void dead(IdealVariable& v) { set(v, (Node*)NULL); } @@ -155,7 +154,7 @@ class IdealKit: public StackObj { Node* make_label(int goto_ct); void bind(Node* lab); void goto_(Node* lab, bool bind = false); - void declares_done(); + void declarations_done(); void drain_delay_transform(); Node* IfTrue(IfNode* iff) { return transform(new (C,1) IfTrueNode(iff)); } diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 38fab34a50d..98cd93c3ca5 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -378,7 +378,18 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) { // Force the original merge dead igvn->hash_delete(r); - r->set_req_X(0,NULL,igvn); + // First, remove region's dead users. + for (DUIterator_Last lmin, l = r->last_outs(lmin); l >= lmin;) { + Node* u = r->last_out(l); + if( u == r ) { + r->set_req(0, NULL); + } else { + assert(u->outcnt() == 0, "only dead users"); + igvn->remove_dead_node(u); + } + l -= 1; + } + igvn->remove_dead_node(r); // Now remove the bogus extra edges used to keep things alive igvn->remove_dead_node( hook ); diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 4fd8f5044a7..ec58f71e01b 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -1030,7 +1030,7 @@ Node* LibraryCallKit::string_indexOf(Node* string_object, ciTypeArray* target_ar const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin)); const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot); - IdealKit kit(gvn(), control(), merged_memory()); + IdealKit kit(gvn(), control(), merged_memory(), false, true); #define __ kit. Node* zero = __ ConI(0); Node* one = __ ConI(1); @@ -1042,7 +1042,7 @@ Node* LibraryCallKit::string_indexOf(Node* string_object, ciTypeArray* target_ar Node* targetOffset = __ ConI(targetOffset_i); Node* sourceEnd = __ SubI(__ AddI(sourceOffset, sourceCount), targetCountLess1); - IdealVariable rtn(kit), i(kit), j(kit); __ declares_done(); + IdealVariable rtn(kit), i(kit), j(kit); __ declarations_done(); Node* outer_loop = __ make_label(2 /* goto */); Node* return_ = __ make_label(1); @@ -1079,9 +1079,9 @@ Node* LibraryCallKit::string_indexOf(Node* string_object, ciTypeArray* target_ar __ bind(outer_loop); }__ end_loop(); __ dead(i); __ bind(return_); - __ drain_delay_transform(); - set_control(__ ctrl()); + // Final sync IdealKit and GraphKit. + sync_kit(kit); Node* result = __ value(rtn); #undef __ C->set_has_loops(true); @@ -2183,14 +2183,23 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas // of it. So we need to emit code to conditionally do the proper type of // store. - IdealKit kit(gvn(), control(), merged_memory()); - kit.declares_done(); + IdealKit ideal(gvn(), control(), merged_memory()); +#define __ ideal. // QQQ who knows what probability is here?? - kit.if_then(heap_base_oop, BoolTest::ne, null(), PROB_UNLIKELY(0.999)); { - (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type); - } kit.else_(); { - (void) store_to_memory(control(), adr, val, type, adr_type, is_volatile); - } kit.end_if(); + __ if_then(heap_base_oop, BoolTest::ne, null(), PROB_UNLIKELY(0.999)); { + // Sync IdealKit and graphKit. + set_all_memory( __ merged_memory()); + set_control(__ ctrl()); + Node* st = store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type); + // Update IdealKit memory. + __ set_all_memory(merged_memory()); + __ set_ctrl(control()); + } __ else_(); { + __ store(__ ctrl(), adr, val, type, alias_type->index(), is_volatile); + } __ end_if(); + // Final sync IdealKit and GraphKit. + sync_kit(ideal); +#undef __ } } } diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index b7357f86ab6..aa2c3494368 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -300,6 +300,12 @@ const Node* MachNode::get_base_and_disp(intptr_t &offset, const TypePtr* &adr_ty } } adr_type = t_disp->add_offset(offset); + } else if( base == NULL && offset != 0 && offset != Type::OffsetBot ) { + // Use ideal type if it is oop ptr. + const TypePtr *tp = oper->type()->isa_ptr(); + if( tp != NULL) { + adr_type = tp; + } } } diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 12410d12ab2..e2421a7f3d3 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -198,14 +198,79 @@ void PhaseMacroExpand::extract_call_projections(CallNode *call) { } // Eliminate a card mark sequence. p2x is a ConvP2XNode -void PhaseMacroExpand::eliminate_card_mark(Node *p2x) { +void PhaseMacroExpand::eliminate_card_mark(Node* p2x) { assert(p2x->Opcode() == Op_CastP2X, "ConvP2XNode required"); - Node *shift = p2x->unique_out(); - Node *addp = shift->unique_out(); - for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) { - Node *st = addp->last_out(j); - assert(st->is_Store(), "store required"); - _igvn.replace_node(st, st->in(MemNode::Memory)); + if (!UseG1GC) { + // vanilla/CMS post barrier + Node *shift = p2x->unique_out(); + Node *addp = shift->unique_out(); + for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) { + Node *st = addp->last_out(j); + assert(st->is_Store(), "store required"); + _igvn.replace_node(st, st->in(MemNode::Memory)); + } + } else { + // G1 pre/post barriers + assert(p2x->outcnt() == 2, "expects 2 users: Xor and URShift nodes"); + // It could be only one user, URShift node, in Object.clone() instrinsic + // but the new allocation is passed to arraycopy stub and it could not + // be scalar replaced. So we don't check the case. + + // Remove G1 post barrier. + + // Search for CastP2X->Xor->URShift->Cmp path which + // checks if the store done to a different from the value's region. + // And replace Cmp with #0 (false) to collapse G1 post barrier. + Node* xorx = NULL; + for (DUIterator_Fast imax, i = p2x->fast_outs(imax); i < imax; i++) { + Node* u = p2x->fast_out(i); + if (u->Opcode() == Op_XorX) { + xorx = u; + break; + } + } + assert(xorx != NULL, "missing G1 post barrier"); + Node* shift = xorx->unique_out(); + Node* cmpx = shift->unique_out(); + assert(cmpx->is_Cmp() && cmpx->unique_out()->is_Bool() && + cmpx->unique_out()->as_Bool()->_test._test == BoolTest::ne, + "missing region check in G1 post barrier"); + _igvn.replace_node(cmpx, makecon(TypeInt::CC_EQ)); + + // Remove G1 pre barrier. + + // Search "if (marking != 0)" check and set it to "false". + Node* this_region = p2x->in(0); + assert(this_region != NULL, ""); + // There is no G1 pre barrier if previous stored value is NULL + // (for example, after initialization). + if (this_region->is_Region() && this_region->req() == 3) { + int ind = 1; + if (!this_region->in(ind)->is_IfFalse()) { + ind = 2; + } + if (this_region->in(ind)->is_IfFalse()) { + Node* bol = this_region->in(ind)->in(0)->in(1); + assert(bol->is_Bool(), ""); + cmpx = bol->in(1); + if (bol->as_Bool()->_test._test == BoolTest::ne && + cmpx->is_Cmp() && cmpx->in(2) == intcon(0) && + cmpx->in(1)->is_Load()) { + Node* adr = cmpx->in(1)->as_Load()->in(MemNode::Address); + const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + + PtrQueue::byte_offset_of_active()); + if (adr->is_AddP() && adr->in(AddPNode::Base) == top() && + adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal && + adr->in(AddPNode::Offset) == MakeConX(marking_offset)) { + _igvn.replace_node(cmpx, makecon(TypeInt::CC_EQ)); + } + } + } + } + // Now CastP2X can be removed since it is used only on dead path + // which currently still alive until igvn optimize it. + assert(p2x->unique_out()->Opcode() == Op_URShiftX, ""); + _igvn.replace_node(p2x, top()); } } @@ -760,14 +825,11 @@ void PhaseMacroExpand::process_users_of_allocation(AllocateNode *alloc) { if (n->is_Store()) { _igvn.replace_node(n, n->in(MemNode::Memory)); } else { - assert( n->Opcode() == Op_CastP2X, "CastP2X required"); eliminate_card_mark(n); } k -= (oc2 - use->outcnt()); } } else { - assert( !use->is_SafePoint(), "safepoint uses must have been already elimiated"); - assert( use->Opcode() == Op_CastP2X, "CastP2X required"); eliminate_card_mark(use); } j -= (oc1 - res->outcnt()); diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index c5f75e8bbe5..0b8c546c9fd 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1489,8 +1489,7 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { #ifdef ASSERT // Verify adr type after matching memory operation const MachOper* oper = mach->memory_operand(); - if (oper != NULL && oper != (MachOper*)-1 && - mach->adr_type() != TypeRawPtr::BOTTOM) { // non-direct addressing mode + if (oper != NULL && oper != (MachOper*)-1) { // It has a unique memory operand. Find corresponding ideal mem node. Node* m = NULL; if (leaf->is_Mem()) { diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index 79482ec289d..cac60f249f7 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -450,6 +450,8 @@ public: subsume_node(old, nn); } + bool delay_transform() const { return _delay_transform; } + void set_delay_transform(bool delay) { _delay_transform = delay; } diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index 06419149147..01a652ee799 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -1216,6 +1216,8 @@ inline bool Type::is_floatingpoint() const { #define Op_AndX Op_AndL #define Op_AddX Op_AddL #define Op_SubX Op_SubL +#define Op_XorX Op_XorL +#define Op_URShiftX Op_URShiftL // conversions #define ConvI2X(x) ConvI2L(x) #define ConvL2X(x) (x) @@ -1258,6 +1260,8 @@ inline bool Type::is_floatingpoint() const { #define Op_AndX Op_AndI #define Op_AddX Op_AddI #define Op_SubX Op_SubI +#define Op_XorX Op_XorI +#define Op_URShiftX Op_URShiftI // conversions #define ConvI2X(x) (x) #define ConvL2X(x) ConvL2I(x) From 2e2f60507e8bb7eca90be3b55978d8e8f0d01b6c Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Thu, 16 Jul 2009 16:29:55 -0700 Subject: [PATCH 65/91] 6851282: JIT miscompilation results in null entry in array when using CompressedOops Get type for new Phi from non dead path. Reviewed-by: never --- hotspot/src/share/vm/opto/cfgnode.cpp | 9 +- hotspot/test/compiler/6851282/Test.java | 124 ++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 hotspot/test/compiler/6851282/Test.java diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index e48c15e7914..85f5e107d8e 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -1796,8 +1796,12 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { for (uint i=1; iis_DecodeN() && ii->bottom_type() == bottom_type()) { - has_decodeN = true; - in_decodeN = ii->in(1); + // Note: in_decodeN is used only to define the type of new phi. + // Find a non dead path otherwise phi type will be wrong. + if (ii->in(1)->bottom_type() != Type::TOP) { + has_decodeN = true; + in_decodeN = ii->in(1); + } } else if (!ii->is_Phi()) { may_push = false; } @@ -1805,7 +1809,6 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (has_decodeN && may_push) { PhaseIterGVN *igvn = phase->is_IterGVN(); - // Note: in_decodeN is used only to define the type of new phi here. PhiNode *new_phi = PhiNode::make_blank(in(0), in_decodeN); uint orig_cnt = req(); for (uint i=1; i as = new ArrayList(); + for (int i = 0; i < 5000; i++) { + List bs = new ArrayList(); + for (int j = i; j < i + 1000; j++) + bs.add(new B(j)); + as.add(new A(bs.toArray(new B[0]))); + } + new Test().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0])); + } +} + +class A { + final B[] bs; + + public A(B[] bs) { + this.bs = bs; + } + + final B[] c(final A a) { + return new BoxedArray(bs).filter(new Function() { + public Boolean apply(B arg) { + for (B b : a.bs) { + if (b.d == arg.d) + return true; + } + return false; + } + }); + } +} + +class BoxedArray { + + private final T[] array; + + BoxedArray(T[] array) { + this.array = array; + } + + public T[] filter(Function function) { + boolean[] include = new boolean[array.length]; + int len = 0; + int i = 0; + while (i < array.length) { + if (function.apply(array[i])) { + include[i] = true; + len += 1; + } + i += 1; + } + T[] result = (T[]) java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), len); + len = 0; + i = 0; + while (len < result.length) { + if (include[i]) { + result[len] = array[i]; + len += 1; + } + i += 1; + } + return result; + } +} + +interface Function { + R apply(T arg); +} + +class B { + final int d; + public B(int d) { + this.d = d; + } +} + From 1c4a7e95bb5e97dbfe8bf04e82f08c3935e2fb6d Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Thu, 16 Jul 2009 17:59:27 -0700 Subject: [PATCH 66/91] 6861513: correct copyright attribution in test for 6837094 and 6860469 Reviewed-by: rasbold --- hotspot/test/compiler/6837094/Test.java | 2 +- hotspot/test/compiler/6860469/Test.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/test/compiler/6837094/Test.java b/hotspot/test/compiler/6837094/Test.java index 9fe2a6a35e5..23db4fc71c5 100644 --- a/hotspot/test/compiler/6837094/Test.java +++ b/hotspot/test/compiler/6837094/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Google Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/test/compiler/6860469/Test.java b/hotspot/test/compiler/6860469/Test.java index 0e7771b24fc..59d5f9969d5 100644 --- a/hotspot/test/compiler/6860469/Test.java +++ b/hotspot/test/compiler/6860469/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Google Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From 62ca1df1dd99fe15de47d8a8cadb8e7a310f0924 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Tue, 21 Jul 2009 16:42:58 -0700 Subject: [PATCH 67/91] 6857159: local schedule failed with checkcast of Thread.currentThread() Reviewed-by: kvn --- hotspot/src/share/vm/adlc/formssel.cpp | 31 +++++++++ hotspot/src/share/vm/adlc/formssel.hpp | 6 ++ .../test/compiler/6857159/Test6857159.java | 68 +++++++++++++++++++ hotspot/test/compiler/6857159/Test6857159.sh | 65 ++++++++++++++++++ 4 files changed, 170 insertions(+) create mode 100644 hotspot/test/compiler/6857159/Test6857159.java create mode 100644 hotspot/test/compiler/6857159/Test6857159.sh diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 1f80e2d0e16..11bfa14f7e8 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -420,6 +420,13 @@ Form::DataType InstructForm::is_ideal_load() const { return _matrule->is_ideal_load(); } +// Return 'true' if this instruction matches an ideal 'LoadKlass' node +bool InstructForm::skip_antidep_check() const { + if( _matrule == NULL ) return false; + + return _matrule->skip_antidep_check(); +} + // Return 'true' if this instruction matches an ideal 'Load?' node Form::DataType InstructForm::is_ideal_store() const { if( _matrule == NULL ) return Form::none; @@ -567,6 +574,8 @@ bool InstructForm::rematerialize(FormDict &globals, RegisterForm *registers ) { // loads from memory, so must check for anti-dependence bool InstructForm::needs_anti_dependence_check(FormDict &globals) const { + if ( skip_antidep_check() ) return false; + // Machine independent loads must be checked for anti-dependences if( is_ideal_load() != Form::none ) return true; @@ -3957,6 +3966,28 @@ Form::DataType MatchRule::is_ideal_load() const { } +bool MatchRule::skip_antidep_check() const { + // Some loads operate on what is effectively immutable memory so we + // should skip the anti dep computations. For some of these nodes + // the rewritable field keeps the anti dep logic from triggering but + // for certain kinds of LoadKlass it does not since they are + // actually reading memory which could be rewritten by the runtime, + // though never by generated code. This disables it uniformly for + // the nodes that behave like this: LoadKlass, LoadNKlass and + // LoadRange. + if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) { + const char *opType = _rChild->_opType; + if (strcmp("LoadKlass", opType) == 0 || + strcmp("LoadNKlass", opType) == 0 || + strcmp("LoadRange", opType) == 0) { + return true; + } + } + + return false; +} + + Form::DataType MatchRule::is_ideal_store() const { Form::DataType ideal_store = Form::none; diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp index 2a7bfbb7934..66583ef1a09 100644 --- a/hotspot/src/share/vm/adlc/formssel.hpp +++ b/hotspot/src/share/vm/adlc/formssel.hpp @@ -158,6 +158,9 @@ public: virtual Form::CallType is_ideal_call() const; // matches ideal 'Call' virtual Form::DataType is_ideal_load() const; // node matches ideal 'LoadXNode' + // Should antidep checks be disabled for this Instruct + // See definition of MatchRule::skip_antidep_check + bool skip_antidep_check() const; virtual Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode' bool is_ideal_mem() const { return is_ideal_load() != Form::none || is_ideal_store() != Form::none; } virtual uint two_address(FormDict &globals); // output reg must match input reg @@ -1003,6 +1006,9 @@ public: bool is_ideal_loopEnd() const; // node matches ideal 'LoopEnd' bool is_ideal_bool() const; // node matches ideal 'Bool' Form::DataType is_ideal_load() const;// node matches ideal 'LoadXNode' + // Should antidep checks be disabled for this rule + // See definition of MatchRule::skip_antidep_check + bool skip_antidep_check() const; Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode' // Check if 'mRule2' is a cisc-spill variant of this MatchRule diff --git a/hotspot/test/compiler/6857159/Test6857159.java b/hotspot/test/compiler/6857159/Test6857159.java new file mode 100644 index 00000000000..638f2a6edb6 --- /dev/null +++ b/hotspot/test/compiler/6857159/Test6857159.java @@ -0,0 +1,68 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +/** + * @test + * @bug 6857159 + * @summary local schedule failed with checkcast of Thread.currentThread() + * + * @run shell Test6857159.sh + */ + +public class Test6857159 extends Thread { + static class ct0 extends Test6857159 { + public void message() { + // System.out.println("message"); + } + + public void run() { + message(); + ct0 ct = (ct0) Thread.currentThread(); + ct.message(); + } + } + static class ct1 extends ct0 { + public void message() { + // System.out.println("message"); + } + } + static class ct2 extends ct0 { + public void message() { + // System.out.println("message"); + } + } + + public static void main(String[] args) throws Exception { + for (int i = 0; i < 100000; i++) { + Thread t = null; + switch (i % 3) { + case 0: t = new ct0(); break; + case 1: t = new ct1(); break; + case 2: t = new ct2(); break; + } + t.start(); + t.join(); + } + } +} diff --git a/hotspot/test/compiler/6857159/Test6857159.sh b/hotspot/test/compiler/6857159/Test6857159.sh new file mode 100644 index 00000000000..da25e4cd2cc --- /dev/null +++ b/hotspot/test/compiler/6857159/Test6857159.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# +# + +if [ "${TESTSRC}" = "" ] +then + echo "TESTSRC not set. Test cannot execute. Failed." + exit 1 +fi +echo "TESTSRC=${TESTSRC}" +if [ "${TESTJAVA}" = "" ] +then + echo "TESTJAVA not set. Test cannot execute. Failed." + exit 1 +fi +echo "TESTJAVA=${TESTJAVA}" +if [ "${TESTCLASSES}" = "" ] +then + echo "TESTCLASSES not set. Test cannot execute. Failed." + exit 1 +fi +echo "TESTCLASSES=${TESTCLASSES}" +echo "CLASSPATH=${CLASSPATH}" + +set -x + +cp ${TESTSRC}/Test6857159.java . +cp ${TESTSRC}/Test6857159.sh . + +${TESTJAVA}/bin/javac -d . Test6857159.java + +${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbatch -XX:+PrintCompilation -XX:CompileOnly=Test6857159\$ct.run Test6857159 > test.out 2>&1 + +grep "COMPILE SKIPPED" test.out + +result=$? +if [ $result -eq 1 ] +then + echo "Passed" + exit 0 +else + echo "Failed" + exit 1 +fi From 6515225d49fa262d4d1be086c753381b717c1aad Mon Sep 17 00:00:00 2001 From: John R Rose Date: Tue, 21 Jul 2009 16:56:06 -0700 Subject: [PATCH 68/91] 6862576: vmIntrinsics needs cleanup in order to support JSR 292 intrinsics Remove useless lazy evaluation of intrinsics; add LAST_COMPILER_INLINE to help categorize them Reviewed-by: kvn --- .../share/vm/classfile/classFileParser.cpp | 10 +++++ hotspot/src/share/vm/classfile/vmSymbols.hpp | 24 +++++++---- hotspot/src/share/vm/interpreter/rewriter.cpp | 3 ++ hotspot/src/share/vm/oops/methodKlass.cpp | 2 +- hotspot/src/share/vm/oops/methodOop.cpp | 42 +++++++++++++------ hotspot/src/share/vm/oops/methodOop.hpp | 25 ++++------- hotspot/src/share/vm/opto/compile.cpp | 3 +- hotspot/src/share/vm/opto/library_call.cpp | 24 ++++------- 8 files changed, 75 insertions(+), 58 deletions(-) diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 36194f79b32..4e7db3b303a 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -3231,6 +3231,16 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, this_klass->set_minor_version(minor_version); this_klass->set_major_version(major_version); + // Set up methodOop::intrinsic_id as soon as we know the names of methods. + // (We used to do this lazily, but now we query it in Rewriter, + // which is eagerly done for every method, so we might as well do it now, + // when everything is fresh in memory.) + if (methodOopDesc::klass_id_for_intrinsics(this_klass->as_klassOop()) != vmSymbols::NO_SID) { + for (int j = 0; j < methods->length(); j++) { + ((methodOop)methods->obj_at(j))->init_intrinsic_id(); + } + } + if (cached_class_file_bytes != NULL) { // JVMTI: we have an instanceKlass now, tell it about the cached bytes this_klass->set_cached_class_file(cached_class_file_bytes, diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 9c8a205ccd8..04bb9369205 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -513,9 +513,6 @@ // // for Emacs: (let ((c-backslash-column 120) (c-backslash-max-column 120)) (c-backslash-region (point) (point-max) nil t)) #define VM_INTRINSICS_DO(do_intrinsic, do_class, do_name, do_signature, do_alias) \ - do_intrinsic(_Object_init, java_lang_Object, object_initializer_name, void_method_signature, F_R) \ - /* (symbol object_initializer_name defined above) */ \ - \ do_intrinsic(_hashCode, java_lang_Object, hashCode_name, void_int_signature, F_R) \ do_name( hashCode_name, "hashCode") \ do_intrinsic(_getClass, java_lang_Object, getClass_name, void_class_signature, F_R) \ @@ -635,9 +632,6 @@ do_intrinsic(_equalsC, java_util_Arrays, equals_name, equalsC_signature, F_S) \ do_signature(equalsC_signature, "([C[C)Z") \ \ - do_intrinsic(_invoke, java_lang_reflect_Method, invoke_name, object_array_object_object_signature, F_R) \ - /* (symbols invoke_name and invoke_signature defined above) */ \ - \ do_intrinsic(_compareTo, java_lang_String, compareTo_name, string_int_signature, F_R) \ do_name( compareTo_name, "compareTo") \ do_intrinsic(_indexOf, java_lang_String, indexOf_name, string_int_signature, F_R) \ @@ -656,8 +650,6 @@ do_name( attemptUpdate_name, "attemptUpdate") \ do_signature(attemptUpdate_signature, "(JJ)Z") \ \ - do_intrinsic(_fillInStackTrace, java_lang_Throwable, fillInStackTrace_name, void_throwable_signature, F_RNY) \ - \ /* support for sun.misc.Unsafe */ \ do_class(sun_misc_Unsafe, "sun/misc/Unsafe") \ \ @@ -819,10 +811,22 @@ do_name( prefetchReadStatic_name, "prefetchReadStatic") \ do_intrinsic(_prefetchWriteStatic, sun_misc_Unsafe, prefetchWriteStatic_name, prefetch_signature, F_SN) \ do_name( prefetchWriteStatic_name, "prefetchWriteStatic") \ + /*== LAST_COMPILER_INLINE*/ \ + /*the compiler does have special inlining code for these; bytecode inline is just fine */ \ + \ + do_intrinsic(_fillInStackTrace, java_lang_Throwable, fillInStackTrace_name, void_throwable_signature, F_RNY) \ + \ + do_intrinsic(_Object_init, java_lang_Object, object_initializer_name, void_method_signature, F_R) \ + /* (symbol object_initializer_name defined above) */ \ + \ + do_intrinsic(_invoke, java_lang_reflect_Method, invoke_name, object_array_object_object_signature, F_R) \ + /* (symbols invoke_name and invoke_signature defined above) */ \ + \ /*end*/ + // Class vmSymbols class vmSymbols: AllStatic { @@ -935,6 +939,7 @@ class vmIntrinsics: AllStatic { #undef VM_INTRINSIC_ENUM ID_LIMIT, + LAST_COMPILER_INLINE = _prefetchWriteStatic, FIRST_ID = _none + 1 }; @@ -972,4 +977,7 @@ public: static Flags flags_for(ID id); static const char* short_name_as_C_string(ID id, char* buf, int size); + + // Access to intrinsic methods: + static methodOop method_for(ID id); }; diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp index b2451cd0edd..c70c0c0356f 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.cpp +++ b/hotspot/src/share/vm/interpreter/rewriter.cpp @@ -273,6 +273,7 @@ Rewriter::Rewriter(instanceKlassHandle klass, TRAPS) compute_index_maps(); if (RegisterFinalizersAtInit && _klass->name() == vmSymbols::java_lang_Object()) { + bool did_rewrite = false; int i = _methods->length(); while (i-- > 0) { methodOop method = (methodOop)_methods->obj_at(i); @@ -281,9 +282,11 @@ Rewriter::Rewriter(instanceKlassHandle klass, TRAPS) // object for finalization if needed. methodHandle m(THREAD, method); rewrite_Object_init(m, CHECK); + did_rewrite = true; break; } } + assert(did_rewrite, "must find Object:: to rewrite it"); } // rewrite methods, in two passes diff --git a/hotspot/src/share/vm/oops/methodKlass.cpp b/hotspot/src/share/vm/oops/methodKlass.cpp index 03f59e1b24e..2879529bb9f 100644 --- a/hotspot/src/share/vm/oops/methodKlass.cpp +++ b/hotspot/src/share/vm/oops/methodKlass.cpp @@ -68,7 +68,7 @@ methodOop methodKlass::allocate(constMethodHandle xconst, m->set_constants(NULL); m->set_max_stack(0); m->set_max_locals(0); - m->clear_intrinsic_id_cache(); + m->set_intrinsic_id(vmIntrinsics::_none); m->set_method_data(NULL); m->set_interpreter_throwout_count(0); m->set_vtable_index(methodOopDesc::garbage_vtable_index); diff --git a/hotspot/src/share/vm/oops/methodOop.cpp b/hotspot/src/share/vm/oops/methodOop.cpp index cb9cddac5b5..e68c289510c 100644 --- a/hotspot/src/share/vm/oops/methodOop.cpp +++ b/hotspot/src/share/vm/oops/methodOop.cpp @@ -962,26 +962,39 @@ methodHandle methodOopDesc:: clone_with_new_data(methodHandle m, u_char* new_cod return newm; } -vmIntrinsics::ID methodOopDesc::compute_intrinsic_id() const { - assert(vmIntrinsics::_none == 0, "correct coding of default case"); - const uintptr_t max_cache_uint = right_n_bits((int)(sizeof(_intrinsic_id_cache) * BitsPerByte)); - assert((uintptr_t)vmIntrinsics::ID_LIMIT <= max_cache_uint, "else fix cache size"); +vmSymbols::SID methodOopDesc::klass_id_for_intrinsics(klassOop holder) { // if loader is not the default loader (i.e., != NULL), we can't know the intrinsics // because we are not loading from core libraries - if (instanceKlass::cast(method_holder())->class_loader() != NULL) return vmIntrinsics::_none; + if (instanceKlass::cast(holder)->class_loader() != NULL) + return vmSymbols::NO_SID; // regardless of name, no intrinsics here // see if the klass name is well-known: - symbolOop klass_name = instanceKlass::cast(method_holder())->name(); - vmSymbols::SID klass_id = vmSymbols::find_sid(klass_name); - if (klass_id == vmSymbols::NO_SID) return vmIntrinsics::_none; + symbolOop klass_name = instanceKlass::cast(holder)->name(); + return vmSymbols::find_sid(klass_name); +} + +void methodOopDesc::init_intrinsic_id() { + assert(_intrinsic_id == vmIntrinsics::_none, "do this just once"); + const uintptr_t max_id_uint = right_n_bits((int)(sizeof(_intrinsic_id) * BitsPerByte)); + assert((uintptr_t)vmIntrinsics::ID_LIMIT <= max_id_uint, "else fix size"); + + // the klass name is well-known: + vmSymbols::SID klass_id = klass_id_for_intrinsics(method_holder()); + assert(klass_id != vmSymbols::NO_SID, "caller responsibility"); // ditto for method and signature: vmSymbols::SID name_id = vmSymbols::find_sid(name()); - if (name_id == vmSymbols::NO_SID) return vmIntrinsics::_none; + if (name_id == vmSymbols::NO_SID) return; vmSymbols::SID sig_id = vmSymbols::find_sid(signature()); - if (sig_id == vmSymbols::NO_SID) return vmIntrinsics::_none; + if (sig_id == vmSymbols::NO_SID) return; jshort flags = access_flags().as_short(); + vmIntrinsics::ID id = vmIntrinsics::find_id(klass_id, name_id, sig_id, flags); + if (id != vmIntrinsics::_none) { + set_intrinsic_id(id); + return; + } + // A few slightly irregular cases: switch (klass_id) { case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_StrictMath): @@ -992,15 +1005,18 @@ vmIntrinsics::ID methodOopDesc::compute_intrinsic_id() const { case vmSymbols::VM_SYMBOL_ENUM_NAME(sqrt_name): // pretend it is the corresponding method in the non-strict class: klass_id = vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_Math); + id = vmIntrinsics::find_id(klass_id, name_id, sig_id, flags); break; } } - // return intrinsic id if any - return vmIntrinsics::find_id(klass_id, name_id, sig_id, flags); + if (id != vmIntrinsics::_none) { + // Set up its iid. It is an alias method. + set_intrinsic_id(id); + return; + } } - // These two methods are static since a GC may move the methodOopDesc bool methodOopDesc::load_signature_classes(methodHandle m, TRAPS) { bool sig_is_loaded = true; diff --git a/hotspot/src/share/vm/oops/methodOop.hpp b/hotspot/src/share/vm/oops/methodOop.hpp index 9a0afa85db9..5a79ed62609 100644 --- a/hotspot/src/share/vm/oops/methodOop.hpp +++ b/hotspot/src/share/vm/oops/methodOop.hpp @@ -104,7 +104,7 @@ class methodOopDesc : public oopDesc { u2 _max_stack; // Maximum number of entries on the expression stack u2 _max_locals; // Number of local variables used by this method u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words - u1 _intrinsic_id_cache; // Cache for intrinsic_id; 0 or 1+vmInt::ID + u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none) u1 _highest_tier_compile; // Highest compile level this method has ever seen. u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting u2 _number_of_breakpoints; // fullspeed debugging support @@ -224,8 +224,6 @@ class methodOopDesc : public oopDesc { int highest_tier_compile() { return _highest_tier_compile;} void set_highest_tier_compile(int level) { _highest_tier_compile = level;} - void clear_intrinsic_id_cache() { _intrinsic_id_cache = 0; } - // Count of times method was exited via exception while interpreting void interpreter_throwout_increment() { if (_interpreter_throwout_count < 65534) { @@ -571,18 +569,12 @@ class methodOopDesc : public oopDesc { void set_cached_itable_index(int index) { instanceKlass::cast(method_holder())->set_cached_itable_index(method_idnum(), index); } // Support for inlining of intrinsic methods - vmIntrinsics::ID intrinsic_id() const { // returns zero if not an intrinsic - const u1& cache = _intrinsic_id_cache; - if (cache != 0) { - return (vmIntrinsics::ID)(cache - 1); - } else { - vmIntrinsics::ID id = compute_intrinsic_id(); - *(u1*)&cache = ((u1) id) + 1; // force the cache to be non-const - vmIntrinsics::verify_method(id, (methodOop) this); - assert((vmIntrinsics::ID)(cache - 1) == id, "proper conversion"); - return id; - } - } + vmIntrinsics::ID intrinsic_id() const { return (vmIntrinsics::ID) _intrinsic_id; } + void set_intrinsic_id(vmIntrinsics::ID id) { _intrinsic_id = (u1) id; } + + // Helper routines for intrinsic_id() and vmIntrinsics::method(). + void init_intrinsic_id(); // updates from _none if a match + static vmSymbols::SID klass_id_for_intrinsics(klassOop holder); // On-stack replacement support bool has_osr_nmethod() { return instanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci) != NULL; } @@ -635,9 +627,6 @@ class methodOopDesc : public oopDesc { void set_size_of_parameters(int size) { _size_of_parameters = size; } private: - // Helper routine for intrinsic_id(). - vmIntrinsics::ID compute_intrinsic_id() const; - // Inlined elements address* native_function_addr() const { assert(is_native(), "must be native"); return (address*) (this+1); } address* signature_handler_addr() const { return native_function_addr() + 1; } diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index f3197152194..6b7fd37919e 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -101,7 +101,8 @@ CallGenerator* Compile::find_intrinsic(ciMethod* m, bool is_virtual) { } } // Lazily create intrinsics for intrinsic IDs well-known in the runtime. - if (m->intrinsic_id() != vmIntrinsics::_none) { + if (m->intrinsic_id() != vmIntrinsics::_none && + m->intrinsic_id() <= vmIntrinsics::LAST_COMPILER_INLINE) { CallGenerator* cg = make_vm_intrinsic(m, is_virtual); if (cg != NULL) { // Save it for next time: diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index ec58f71e01b..ecc8abbf287 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -310,11 +310,6 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { if (!InlineAtomicLong) return NULL; break; - case vmIntrinsics::_Object_init: - case vmIntrinsics::_invoke: - // We do not intrinsify these; they are marked for other purposes. - return NULL; - case vmIntrinsics::_getCallerClass: if (!UseNewReflection) return NULL; if (!InlineReflectionGetCallerClass) return NULL; @@ -327,6 +322,8 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { break; default: + assert(id <= vmIntrinsics::LAST_COMPILER_INLINE, "caller responsibility"); + assert(id != vmIntrinsics::_Object_init && id != vmIntrinsics::_invoke, "enum out of order?"); break; } @@ -394,18 +391,11 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) { } if (PrintIntrinsics) { - switch (intrinsic_id()) { - case vmIntrinsics::_invoke: - case vmIntrinsics::_Object_init: - // We do not expect to inline these, so do not produce any noise about them. - break; - default: - tty->print("Did not inline intrinsic %s%s at bci:%d in", - vmIntrinsics::name_at(intrinsic_id()), - (is_virtual() ? " (virtual)" : ""), kit.bci()); - kit.caller()->print_short_name(tty); - tty->print_cr(" (%d bytes)", kit.caller()->code_size()); - } + tty->print("Did not inline intrinsic %s%s at bci:%d in", + vmIntrinsics::name_at(intrinsic_id()), + (is_virtual() ? " (virtual)" : ""), kit.bci()); + kit.caller()->print_short_name(tty); + tty->print_cr(" (%d bytes)", kit.caller()->code_size()); } C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed); return NULL; From 0e783b7554093f332ac898b9215949d8d124d441 Mon Sep 17 00:00:00 2001 From: Andrey Petrusenko Date: Wed, 22 Jul 2009 02:46:55 -0700 Subject: [PATCH 69/91] 6862661: G1: _gc_alloc_region_counts is not updated properly after 6604422 Implementation of RFE 6604422 (G1: re-use half-promoted regions) introduced incorrect _gc_alloc_region_counts updates which effectively disabled survivor spaces. Reviewed-by: johnc, jmasa, tonyp --- .../src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 4f2ef1d5d78..b463b40a7fc 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -2981,6 +2981,7 @@ void G1CollectedHeap::get_gc_alloc_regions() { for (int ap = 0; ap < GCAllocPurposeCount; ++ap) { assert(_gc_alloc_regions[ap] == NULL, "invariant"); + assert(_gc_alloc_region_counts[ap] == 0, "invariant"); // Create new GC alloc regions. HeapRegion* alloc_region = _retained_gc_alloc_regions[ap]; @@ -3009,6 +3010,9 @@ void G1CollectedHeap::get_gc_alloc_regions() { if (alloc_region == NULL) { // we will get a new GC alloc region alloc_region = newAllocRegionWithExpansion(ap, 0); + } else { + // the region was retained from the last collection + ++_gc_alloc_region_counts[ap]; } if (alloc_region != NULL) { @@ -3047,11 +3051,11 @@ void G1CollectedHeap::release_gc_alloc_regions(bool totally) { for (int ap = 0; ap < GCAllocPurposeCount; ++ap) { HeapRegion* r = _gc_alloc_regions[ap]; _retained_gc_alloc_regions[ap] = NULL; + _gc_alloc_region_counts[ap] = 0; if (r != NULL) { // we retain nothing on _gc_alloc_regions between GCs set_gc_alloc_region(ap, NULL); - _gc_alloc_region_counts[ap] = 0; if (r->is_empty()) { // we didn't actually allocate anything in it; let's just put From b0f75657c5b97f267ac40e4962b3f8034c4dfc68 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Wed, 22 Jul 2009 15:48:51 -0700 Subject: [PATCH 70/91] 6826736: CMS: core dump with -XX:+UseCompressedOops Fix deoptimization code and OopMapSet::all_do() to check for oop = narrow_oop_base. Reviewed-by: jcoomes, phh, ysr, never --- hotspot/src/share/vm/compiler/oopMap.cpp | 21 +++++- hotspot/src/share/vm/compiler/oopMap.hpp | 4 ++ hotspot/src/share/vm/memory/universe.hpp | 1 + hotspot/src/share/vm/runtime/stackValue.cpp | 12 +++- hotspot/test/compiler/6826736/Test.java | 75 +++++++++++++++++++++ 5 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 hotspot/test/compiler/6826736/Test.java diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 22b4b9438cd..87751ab5bf3 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -379,7 +379,15 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map, if ( loc != NULL ) { oop *base_loc = fr->oopmapreg_to_location(omv.content_reg(), reg_map); oop *derived_loc = loc; - derived_oop_fn(base_loc, derived_loc); + oop val = *base_loc; + if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) { + // Ignore NULL oops and decoded NULL narrow oops which + // equal to Universe::narrow_oop_base when a narrow oop + // implicit null check is used in compiled code. + // The narrow_oop_base could be NULL or be the address + // of the page below heap depending on compressed oops mode. + } else + derived_oop_fn(base_loc, derived_loc); } oms.next(); } while (!oms.is_done()); @@ -394,6 +402,15 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map, oop* loc = fr->oopmapreg_to_location(omv.reg(),reg_map); if ( loc != NULL ) { if ( omv.type() == OopMapValue::oop_value ) { + oop val = *loc; + if (val == (oop)NULL || Universe::is_narrow_oop_base(val)) { + // Ignore NULL oops and decoded NULL narrow oops which + // equal to Universe::narrow_oop_base when a narrow oop + // implicit null check is used in compiled code. + // The narrow_oop_base could be NULL or be the address + // of the page below heap depending on compressed oops mode. + continue; + } #ifdef ASSERT if ((((uintptr_t)loc & (sizeof(*loc)-1)) != 0) || !Universe::heap()->is_in_or_null(*loc)) { @@ -410,6 +427,8 @@ void OopMapSet::all_do(const frame *fr, const RegisterMap *reg_map, #endif // ASSERT oop_fn->do_oop(loc); } else if ( omv.type() == OopMapValue::value_value ) { + assert((*loc) == (oop)NULL || !Universe::is_narrow_oop_base(*loc), + "found invalid value pointer"); value_fn->do_oop(loc); } else if ( omv.type() == OopMapValue::narrowoop_value ) { narrowOop *nl = (narrowOop*)loc; diff --git a/hotspot/src/share/vm/compiler/oopMap.hpp b/hotspot/src/share/vm/compiler/oopMap.hpp index 72f9a83a9c2..ff72fb20bee 100644 --- a/hotspot/src/share/vm/compiler/oopMap.hpp +++ b/hotspot/src/share/vm/compiler/oopMap.hpp @@ -233,6 +233,10 @@ class OopMapSet : public ResourceObj { int heap_size() const; void copy_to(address addr); + // Methods oops_do() and all_do() filter out NULL oops and + // oop == Universe::narrow_oop_base() before passing oops + // to closures. + // Iterates through frame for a compiled method static void oops_do (const frame* fr, const RegisterMap* reg_map, OopClosure* f); diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index 9e17a184450..eedb021c42f 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -343,6 +343,7 @@ class Universe: AllStatic { // For UseCompressedOops static address* narrow_oop_base_addr() { return &_narrow_oop._base; } static address narrow_oop_base() { return _narrow_oop._base; } + static bool is_narrow_oop_base(void* addr) { return (narrow_oop_base() == (address)addr); } static int narrow_oop_shift() { return _narrow_oop._shift; } static void set_narrow_oop_base(address base) { _narrow_oop._base = base; } static void set_narrow_oop_shift(int shift) { _narrow_oop._shift = shift; } diff --git a/hotspot/src/share/vm/runtime/stackValue.cpp b/hotspot/src/share/vm/runtime/stackValue.cpp index 9f3fb0f0ec3..8225467c8ac 100644 --- a/hotspot/src/share/vm/runtime/stackValue.cpp +++ b/hotspot/src/share/vm/runtime/stackValue.cpp @@ -104,7 +104,17 @@ StackValue* StackValue::create_stack_value(const frame* fr, const RegisterMap* r } #endif case Location::oop: { - Handle h(*(oop *)value_addr); // Wrap a handle around the oop + oop val = *(oop *)value_addr; +#ifdef _LP64 + if (Universe::is_narrow_oop_base(val)) { + // Compiled code may produce decoded oop = narrow_oop_base + // when a narrow oop implicit null check is used. + // The narrow_oop_base could be NULL or be the address + // of the page below heap. Use NULL value for both cases. + val = (oop)NULL; + } +#endif + Handle h(val); // Wrap a handle around the oop return new StackValue(h); } case Location::addr: { diff --git a/hotspot/test/compiler/6826736/Test.java b/hotspot/test/compiler/6826736/Test.java new file mode 100644 index 00000000000..02d0b2a9de7 --- /dev/null +++ b/hotspot/test/compiler/6826736/Test.java @@ -0,0 +1,75 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +/** + * @test + * @bug 6826736 + * @summary CMS: core dump with -XX:+UseCompressedOops + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:CompileThreshold=100 -XX:CompileOnly=Test.test -XX:-BlockLayoutRotateLoops -XX:LoopUnrollLimit=0 Test + */ + +public class Test { + int[] arr; + int[] arr2; + int test(int r) { + for (int i = 0; i < 100; i++) { + for (int j = i; j < 100; j++) { + int a = 0; + for (long k = 0; k < 100; k++) { + a += k; + } + if (arr != null) + a = arr[j]; + r += a; + } + } + return r; + } + + public static void main(String[] args) { + int r = 0; + Test t = new Test(); + for (int i = 0; i < 100; i++) { + t.arr = new int[100]; + r = t.test(r); + } + System.out.println("Warmup 1 is done."); + for (int i = 0; i < 100; i++) { + t.arr = null; + r = t.test(r); + } + System.out.println("Warmup 2 is done."); + for (int i = 0; i < 100; i++) { + t.arr = new int[100]; + r = t.test(r); + } + System.out.println("Warmup is done."); + for (int i = 0; i < 100; i++) { + t.arr = new int[1000000]; + t.arr = null; + r = t.test(r); + } + } +} From 759881b511e9d5417c5f8e0e8c4c987d25f26e03 Mon Sep 17 00:00:00 2001 From: "Y. Srinivas Ramakrishna" Date: Wed, 22 Jul 2009 18:25:00 -0700 Subject: [PATCH 71/91] 6863216: Clean up debugging debris inadvertently pushed with 6700789 Anti-delta for debugging debris that was inadvertently pushed. Reviewed-by: kvn, tonyp --- .../src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 5 ++--- hotspot/src/share/vm/opto/cfgnode.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index b463b40a7fc..ac236fb2191 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -1655,9 +1655,8 @@ void G1CollectedHeap::iterate_dirty_card_closure(bool concurrent, // Computes the sum of the storage used by the various regions. size_t G1CollectedHeap::used() const { - // Temporarily, until 6859911 is fixed. XXX - // assert(Heap_lock->owner() != NULL, - // "Should be owned on this thread's behalf."); + assert(Heap_lock->owner() != NULL, + "Should be owned on this thread's behalf."); size_t result = _summary_bytes_used; // Read only once in case it is set to NULL concurrently HeapRegion* hr = _cur_alloc_region; diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index a81859cf83c..e48c15e7914 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -1789,7 +1789,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { #ifdef _LP64 // Push DecodeN down through phi. // The rest of phi graph will transform by split EncodeP node though phis up. - if (UseNewCode && UseCompressedOops && can_reshape && progress == NULL) { + if (UseCompressedOops && can_reshape && progress == NULL) { bool may_push = true; bool has_decodeN = false; Node* in_decodeN = NULL; From 7e2e64f5e04200db27fd2aa44fd00e3274332917 Mon Sep 17 00:00:00 2001 From: Dmitry Cherepanov Date: Thu, 23 Jul 2009 11:30:49 +0400 Subject: [PATCH 72/91] 6857870: Regression tests are failing with ExceptionInInitializerError Reviewed-by: art --- .../windows/classes/sun/awt/windows/WToolkit.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java index 6e12209f94c..9fcf3d67a8b 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java @@ -886,14 +886,12 @@ public class WToolkit extends SunToolkit implements Runnable { * this should be done in lazilyLoadDesktopProperty() only. */ protected synchronized void initializeDesktopProperties() { - desktopProperties.put("DnD.Autoscroll.initialDelay", Integer.valueOf(50)); - desktopProperties.put("DnD.Autoscroll.interval", Integer.valueOf(50)); - - try { - desktopProperties.put("Shell.shellFolderManager", - Class.forName("sun.awt.shell.Win32ShellFolderManager2")); - } catch (ClassNotFoundException ex) { - } + desktopProperties.put("DnD.Autoscroll.initialDelay", + Integer.valueOf(50)); + desktopProperties.put("DnD.Autoscroll.interval", + Integer.valueOf(50)); + desktopProperties.put("Shell.shellFolderManager", + "sun.awt.shell.Win32ShellFolderManager2"); } /* From 8dd34cd52f9869dc2d5cfd1b37eca18f24c2b26f Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Thu, 23 Jul 2009 14:53:56 -0700 Subject: [PATCH 73/91] 6860599: nodes limit could be reached during Output phase Bailout compilation if nodes limit could be reached during Output phase. Reviewed-by: never, twisti --- hotspot/src/share/vm/opto/compile.cpp | 63 +++++++++++++++++---------- hotspot/src/share/vm/opto/compile.hpp | 10 +++-- hotspot/src/share/vm/opto/output.cpp | 11 +++-- 3 files changed, 54 insertions(+), 30 deletions(-) diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 6b7fd37919e..0db21631f2c 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -441,6 +441,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _orig_pc_slot_offset_in_bytes(0), _node_bundling_limit(0), _node_bundling_base(NULL), + _java_calls(0), + _inner_loops(0), #ifndef PRODUCT _trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")), _printer(IdealGraphPrinter::printer()), @@ -711,6 +713,8 @@ Compile::Compile( ciEnv* ci_env, _code_buffer("Compile::Fill_buffer"), _node_bundling_limit(0), _node_bundling_base(NULL), + _java_calls(0), + _inner_loops(0), #ifndef PRODUCT _trace_opto_output(TraceOptoOutput), _printer(NULL), @@ -1851,22 +1855,26 @@ struct Final_Reshape_Counts : public StackObj { int _float_count; // count float ops requiring 24-bit precision int _double_count; // count double ops requiring more precision int _java_call_count; // count non-inlined 'java' calls + int _inner_loop_count; // count loops which need alignment VectorSet _visited; // Visitation flags Node_List _tests; // Set of IfNodes & PCTableNodes Final_Reshape_Counts() : - _call_count(0), _float_count(0), _double_count(0), _java_call_count(0), + _call_count(0), _float_count(0), _double_count(0), + _java_call_count(0), _inner_loop_count(0), _visited( Thread::current()->resource_area() ) { } void inc_call_count () { _call_count ++; } void inc_float_count () { _float_count ++; } void inc_double_count() { _double_count++; } void inc_java_call_count() { _java_call_count++; } + void inc_inner_loop_count() { _inner_loop_count++; } int get_call_count () const { return _call_count ; } int get_float_count () const { return _float_count ; } int get_double_count() const { return _double_count; } int get_java_call_count() const { return _java_call_count; } + int get_inner_loop_count() const { return _inner_loop_count; } }; static bool oop_offset_is_sane(const TypeInstPtr* tp) { @@ -1878,7 +1886,7 @@ static bool oop_offset_is_sane(const TypeInstPtr* tp) { //------------------------------final_graph_reshaping_impl---------------------- // Implement items 1-5 from final_graph_reshaping below. -static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { +static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc ) { if ( n->outcnt() == 0 ) return; // dead node uint nop = n->Opcode(); @@ -1920,13 +1928,13 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { case Op_CmpF: case Op_CmpF3: // case Op_ConvL2F: // longs are split into 32-bit halves - fpu.inc_float_count(); + frc.inc_float_count(); break; case Op_ConvF2D: case Op_ConvD2F: - fpu.inc_float_count(); - fpu.inc_double_count(); + frc.inc_float_count(); + frc.inc_double_count(); break; // Count all double operations that may use FPU @@ -1943,7 +1951,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { case Op_ConD: case Op_CmpD: case Op_CmpD3: - fpu.inc_double_count(); + frc.inc_double_count(); break; case Op_Opaque1: // Remove Opaque Nodes before matching case Op_Opaque2: // Remove Opaque Nodes before matching @@ -1952,7 +1960,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { case Op_CallStaticJava: case Op_CallJava: case Op_CallDynamicJava: - fpu.inc_java_call_count(); // Count java call site; + frc.inc_java_call_count(); // Count java call site; case Op_CallRuntime: case Op_CallLeaf: case Op_CallLeafNoFP: { @@ -1963,7 +1971,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { // uncommon_trap, _complete_monitor_locking, _complete_monitor_unlocking, // _new_Java, _new_typeArray, _new_objArray, _rethrow_Java, ... if( !call->is_CallStaticJava() || !call->as_CallStaticJava()->_name ) { - fpu.inc_call_count(); // Count the call site + frc.inc_call_count(); // Count the call site } else { // See if uncommon argument is shared Node *n = call->in(TypeFunc::Parms); int nop = n->Opcode(); @@ -1984,11 +1992,11 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { case Op_StoreD: case Op_LoadD: case Op_LoadD_unaligned: - fpu.inc_double_count(); + frc.inc_double_count(); goto handle_mem; case Op_StoreF: case Op_LoadF: - fpu.inc_float_count(); + frc.inc_float_count(); goto handle_mem; case Op_StoreB: @@ -2325,6 +2333,12 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { n->subsume_by(btp); } break; + case Op_Loop: + case Op_CountedLoop: + if (n->as_Loop()->is_inner_loop()) { + frc.inc_inner_loop_count(); + } + break; default: assert( !n->is_Call(), "" ); assert( !n->is_Mem(), "" ); @@ -2333,17 +2347,17 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { // Collect CFG split points if (n->is_MultiBranch()) - fpu._tests.push(n); + frc._tests.push(n); } //------------------------------final_graph_reshaping_walk--------------------- // Replacing Opaque nodes with their input in final_graph_reshaping_impl(), // requires that the walk visits a node's inputs before visiting the node. -static void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &fpu ) { +static void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc ) { ResourceArea *area = Thread::current()->resource_area(); Unique_Node_List sfpt(area); - fpu._visited.set(root->_idx); // first, mark node as visited + frc._visited.set(root->_idx); // first, mark node as visited uint cnt = root->req(); Node *n = root; uint i = 0; @@ -2352,7 +2366,7 @@ static void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Re // Place all non-visited non-null inputs onto stack Node* m = n->in(i); ++i; - if (m != NULL && !fpu._visited.test_set(m->_idx)) { + if (m != NULL && !frc._visited.test_set(m->_idx)) { if (m->is_SafePoint() && m->as_SafePoint()->jvms() != NULL) sfpt.push(m); cnt = m->req(); @@ -2362,7 +2376,7 @@ static void final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Re } } else { // Now do post-visit work - final_graph_reshaping_impl( n, fpu ); + final_graph_reshaping_impl( n, frc ); if (nstack.is_empty()) break; // finished n = nstack.node(); // Get node from stack @@ -2443,16 +2457,16 @@ bool Compile::final_graph_reshaping() { return true; } - Final_Reshape_Counts fpu; + Final_Reshape_Counts frc; // Visit everybody reachable! // Allocate stack of size C->unique()/2 to avoid frequent realloc Node_Stack nstack(unique() >> 1); - final_graph_reshaping_walk(nstack, root(), fpu); + final_graph_reshaping_walk(nstack, root(), frc); // Check for unreachable (from below) code (i.e., infinite loops). - for( uint i = 0; i < fpu._tests.size(); i++ ) { - MultiBranchNode *n = fpu._tests[i]->as_MultiBranch(); + for( uint i = 0; i < frc._tests.size(); i++ ) { + MultiBranchNode *n = frc._tests[i]->as_MultiBranch(); // Get number of CFG targets. // Note that PCTables include exception targets after calls. uint required_outcnt = n->required_outcnt(); @@ -2498,7 +2512,7 @@ bool Compile::final_graph_reshaping() { // Check that I actually visited all kids. Unreached kids // must be infinite loops. for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) - if (!fpu._visited.test(n->fast_out(j)->_idx)) { + if (!frc._visited.test(n->fast_out(j)->_idx)) { record_method_not_compilable("infinite loop"); return true; // Found unvisited kid; must be unreach } @@ -2507,13 +2521,14 @@ bool Compile::final_graph_reshaping() { // If original bytecodes contained a mixture of floats and doubles // check if the optimizer has made it homogenous, item (3). if( Use24BitFPMode && Use24BitFP && - fpu.get_float_count() > 32 && - fpu.get_double_count() == 0 && - (10 * fpu.get_call_count() < fpu.get_float_count()) ) { + frc.get_float_count() > 32 && + frc.get_double_count() == 0 && + (10 * frc.get_call_count() < frc.get_float_count()) ) { set_24_bit_selection_and_mode( false, true ); } - set_has_java_calls(fpu.get_java_call_count() > 0); + set_java_calls(frc.get_java_call_count()); + set_inner_loops(frc.get_inner_loop_count()); // No infinite loops, no reason to bail out. return false; diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index dcd6813a893..bad984ff65d 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -223,7 +223,8 @@ class Compile : public Phase { PhaseCFG* _cfg; // Results of CFG finding bool _select_24_bit_instr; // We selected an instruction with a 24-bit result bool _in_24_bit_fp_mode; // We are emitting instructions with 24-bit results - bool _has_java_calls; // True if the method has java calls + int _java_calls; // Number of java calls in the method + int _inner_loops; // Number of inner loops in the method Matcher* _matcher; // Engine to map ideal to machine instructions PhaseRegAlloc* _regalloc; // Results of register allocation. int _frame_slots; // Size of total frame in stack slots @@ -505,7 +506,9 @@ class Compile : public Phase { PhaseCFG* cfg() { return _cfg; } bool select_24_bit_instr() const { return _select_24_bit_instr; } bool in_24_bit_fp_mode() const { return _in_24_bit_fp_mode; } - bool has_java_calls() const { return _has_java_calls; } + bool has_java_calls() const { return _java_calls > 0; } + int java_calls() const { return _java_calls; } + int inner_loops() const { return _inner_loops; } Matcher* matcher() { return _matcher; } PhaseRegAlloc* regalloc() { return _regalloc; } int frame_slots() const { return _frame_slots; } @@ -532,7 +535,8 @@ class Compile : public Phase { _in_24_bit_fp_mode = mode; } - void set_has_java_calls(bool z) { _has_java_calls = z; } + void set_java_calls(int z) { _java_calls = z; } + void set_inner_loops(int z) { _inner_loops = z; } // Instruction bits passed off to the VM int code_size() { return _method_size; } diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index 3c8af599142..1bc5361c7a1 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -50,6 +50,13 @@ void Compile::Output() { init_scratch_buffer_blob(); if (failing()) return; // Out of memory + // The number of new nodes (mostly MachNop) is proportional to + // the number of java calls and inner loops which are aligned. + if ( C->check_node_count((NodeLimitFudgeFactor + C->java_calls()*3 + + C->inner_loops()*(OptoLoopAlignment-1)), + "out of nodes before code generation" ) ) { + return; + } // Make sure I can find the Start Node Block_Array& bbs = _cfg->_bbs; Block *entry = _cfg->_blocks[1]; @@ -1105,7 +1112,7 @@ void Compile::Fill_buffer() { uint *call_returns = NEW_RESOURCE_ARRAY(uint, _cfg->_num_blocks+1); uint return_offset = 0; - MachNode *nop = new (this) MachNopNode(); + int nop_size = (new (this) MachNopNode())->size(_regalloc); int previous_offset = 0; int current_offset = 0; @@ -1188,7 +1195,6 @@ void Compile::Fill_buffer() { } // align the instruction if necessary - int nop_size = nop->size(_regalloc); int padding = mach->compute_padding(current_offset); // Make sure safepoint node for polling is distinct from a call's // return by adding a nop if needed. @@ -1372,7 +1378,6 @@ void Compile::Fill_buffer() { // If the next block is the top of a loop, pad this block out to align // the loop top a little. Helps prevent pipe stalls at loop back branches. - int nop_size = (new (this) MachNopNode())->size(_regalloc); if( i<_cfg->_num_blocks-1 ) { Block *nb = _cfg->_blocks[i+1]; uint padding = nb->alignment_padding(current_offset); From 608d9bf61e7052fb4146d7b0b1d298e90acb72d3 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:39:46 -0700 Subject: [PATCH 74/91] Added tag jdk7-b66 for changeset 3e00e9de363a --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 3b501dece9d..6681557af03 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -40,3 +40,4 @@ c7ed15ab92ce36a09d264a5e34025884b2d7607f jdk7-b62 57f7e028c7ad1806500ae89eb3f4cd9a51b10e18 jdk7-b63 269c1ec4435dfb7b452ae6e3bdde005d55c5c830 jdk7-b64 e01380cd1de4ce048b87d059d238e5ab5e341947 jdk7-b65 +6bad5e3fe50337d95b1416d744780d65bc570da6 jdk7-b66 From b0029d3ebcc276e14b69cd30864107835692c8ff Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:39:48 -0700 Subject: [PATCH 75/91] Added tag jdk7-b66 for changeset ec9f33978e19 --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index e9712d235d3..55f6338adba 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -40,3 +40,4 @@ e906b16a12a9a63b615898afa5d9673cbd1c5ab8 jdk7-b61 d20e45cd539f20405ff843652069cfd7550c5ab3 jdk7-b63 047dd27fddb607f8135296b3754131f6e13cb8c7 jdk7-b64 97fd9b42f5c2d342b90d18f0a2b57e4117e39415 jdk7-b65 +a821e059a961bcb02830280d51f6dd030425c066 jdk7-b66 From 7084283bfa35806a2dfa30240ef5167f2bdf5572 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:39:51 -0700 Subject: [PATCH 76/91] Added tag jdk7-b66 for changeset f367b7c24c74 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 82f00b1c160..e805fe0c0aa 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -40,3 +40,4 @@ a88386380bdaaa5ab4ffbedf22c57bac5dbec034 jdk7-b62 32c83fb84370a35344676991a48440378e6b6c8a jdk7-b63 ba36394eb84b949b31212bdb32a518a8f92bab5b jdk7-b64 ba313800759b678979434d6da8ed3bf49eb8bea4 jdk7-b65 +57c71ad0341b8b64ed20f81151eb7f06324f8894 jdk7-b66 From 7548a15ae9b0e27629f86a27081ec8592b408c0d Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:39:56 -0700 Subject: [PATCH 77/91] Added tag jdk7-b66 for changeset fe07d1599221 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 2713e5f9d70..9b724960f39 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -40,3 +40,4 @@ a97dd57a62604c35c79bc2fa77a612ed547f6135 jdk7-b62 ae449e9c04c1fe651bd30f0f4d4cc24ba794e0c4 jdk7-b63 a10eec7a1edf536f39b5828d8623054dbc62c2b7 jdk7-b64 008c662e0ee9a91aebb75e46b97de979083d5c1c jdk7-b65 +22f9d5d5b5fe0f47048f41e6c6e54fee5edad0ec jdk7-b66 From fd6571fe2e59f12464c5d7ab12775f91c7d30f4f Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:39:58 -0700 Subject: [PATCH 78/91] Added tag jdk7-b66 for changeset 0d64f3a8ed0b --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index d85a9e3d5f0..a5dc8fecee0 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -40,3 +40,4 @@ aeabf802f2a1ca72b87d7397c5ece58058e000a9 jdk7-b61 b8a6e883c0a6708f6d818815040525d472262495 jdk7-b63 aaa25dfd3de68c6f1a1d3ef8c45fd99f76bca6dd jdk7-b64 aa22a1be5866a6608ba17a7a443945559409ae0f jdk7-b65 +fa8712c099edd5c9a6b3ed9729353738004d388f jdk7-b66 From cfd046568f1c326b358ef1b495f0dc082a847d3b Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:40:05 -0700 Subject: [PATCH 79/91] Added tag jdk7-b66 for changeset 7441718ff264 --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index b1cc226d467..b19d2294d2e 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -40,3 +40,4 @@ f72c0dc047b9b2e797beee68ae0b50decb1f020d jdk7-b61 2ed6ed6b5bfc7dd724925b90dbb31223df59c25d jdk7-b63 a50217eb3ee10b9f9547e0708e5c9625405083ef jdk7-b64 382a27aa78d3236fa123c60577797a887fe93e09 jdk7-b65 +bd31b30a5b21f20e42965b1633f18a5c7946d398 jdk7-b66 From c3a06b2ebe4ffa9111f601fe4549d374e5fbee13 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Fri, 24 Jul 2009 13:40:15 -0700 Subject: [PATCH 80/91] Added tag jdk7-b66 for changeset dc62947a6e47 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index 4d03a266a98..23d21f876dc 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -40,3 +40,4 @@ dbdeb4a7581b2a8699644b91cae6793cb01953f7 jdk7-b53 5c2c8112055565b4980b6756e001e45eb7b88d6e jdk7-b63 d8f23a81d46f47a4186f1044dd9e44841bbeab84 jdk7-b64 7e0056ded28c802609d2bd79bfcda551d72a3fec jdk7-b65 +634f519d6f9a602b16bba1c7cd4a17242a8f6889 jdk7-b66 From d911e41fe74afe7336154bbcc105bfb4b9d3f15b Mon Sep 17 00:00:00 2001 From: Erik Trimble Date: Fri, 24 Jul 2009 16:41:16 -0700 Subject: [PATCH 81/91] 6864901: Bump the HS16 build number to 07 Update the HS16 build number to 07 Reviewed-by: jcoomes --- hotspot/make/hotspot_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index cdac48030fa..bbcda0a80e3 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2009 HS_MAJOR_VER=16 HS_MINOR_VER=0 -HS_BUILD_NUMBER=06 +HS_BUILD_NUMBER=07 JDK_MAJOR_VER=1 JDK_MINOR_VER=7 From 10a6d2437a31d33f43f8f2c13e49d0234e9a280a Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Tue, 28 Jul 2009 12:12:34 -0700 Subject: [PATCH 82/91] 6862919: Update copyright year Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair --- make/deploy-rules.gmk | 2 +- make/jprt.properties | 2 +- make/sanity-rules.gmk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/make/deploy-rules.gmk b/make/deploy-rules.gmk index 2884601bb33..afec0ea267a 100644 --- a/make/deploy-rules.gmk +++ b/make/deploy-rules.gmk @@ -1,5 +1,5 @@ # -# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/jprt.properties b/make/jprt.properties index 7f2fffd0a2d..b451b0f25d9 100644 --- a/make/jprt.properties +++ b/make/jprt.properties @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/sanity-rules.gmk b/make/sanity-rules.gmk index 2119af3b0e4..5d2a7adb84d 100644 --- a/make/sanity-rules.gmk +++ b/make/sanity-rules.gmk @@ -1,5 +1,5 @@ # -# Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it From f3605fc37cfc14a82b088680764bdd4a5b391448 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Tue, 28 Jul 2009 12:12:36 -0700 Subject: [PATCH 83/91] 6862919: Update copyright year Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair --- corba/make/Makefile | 2 +- corba/make/common/Library.gmk | 2 +- corba/make/common/Rules.gmk | 2 +- corba/make/common/shared/Compiler-gcc.gmk | 2 +- corba/make/common/shared/Defs-java.gmk | 2 +- corba/make/common/shared/Defs-windows.gmk | 2 +- corba/make/common/shared/Platform.gmk | 2 +- corba/make/jprt.properties | 2 +- corba/make/org/omg/idl/Makefile | 2 +- corba/make/tools/logutil/Makefile | 2 +- .../com/sun/corba/se/impl/encoding/BufferManagerReadStream.java | 2 +- .../classes/com/sun/corba/se/impl/io/ObjectStreamClass.java | 2 +- .../share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java | 2 +- corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java | 2 +- .../share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java | 2 +- .../share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java | 2 +- .../corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java | 2 +- .../com/sun/corba/se/impl/resolver/INSURLOperationImpl.java | 2 +- .../corba/se/impl/transport/SocketOrChannelConnectionImpl.java | 2 +- .../share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/first.set | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/follow.set | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/grammar.idl | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/grammar3.idl | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/idl.prp | 2 +- corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp | 2 +- .../src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp | 2 +- .../sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp | 2 +- .../sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp | 2 +- .../tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp | 2 +- .../src/share/classes/com/sun/tools/corba/se/logutil/Input.java | 2 +- .../share/classes/com/sun/tools/corba/se/logutil/InputCode.java | 2 +- .../classes/com/sun/tools/corba/se/logutil/InputException.java | 2 +- corba/src/share/classes/com/sun/tools/corba/se/logutil/MC.java | 2 +- corba/src/share/classes/org/omg/CORBA/ORB.java | 2 +- corba/src/windows/resource/version.rc | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/corba/make/Makefile b/corba/make/Makefile index 1cd81c90ab0..0ca13f6c3ab 100644 --- a/corba/make/Makefile +++ b/corba/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/common/Library.gmk b/corba/make/common/Library.gmk index 49de4c64457..d0671c9a36f 100644 --- a/corba/make/common/Library.gmk +++ b/corba/make/common/Library.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/common/Rules.gmk b/corba/make/common/Rules.gmk index aa674a9bd95..0598f08df88 100644 --- a/corba/make/common/Rules.gmk +++ b/corba/make/common/Rules.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/common/shared/Compiler-gcc.gmk b/corba/make/common/shared/Compiler-gcc.gmk index c8e6779ffd6..5fc30edb995 100644 --- a/corba/make/common/shared/Compiler-gcc.gmk +++ b/corba/make/common/shared/Compiler-gcc.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/common/shared/Defs-java.gmk b/corba/make/common/shared/Defs-java.gmk index f80f0ffa4e1..44764bdc8b6 100644 --- a/corba/make/common/shared/Defs-java.gmk +++ b/corba/make/common/shared/Defs-java.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/common/shared/Defs-windows.gmk b/corba/make/common/shared/Defs-windows.gmk index d78f7f7293e..3e1fad1226a 100644 --- a/corba/make/common/shared/Defs-windows.gmk +++ b/corba/make/common/shared/Defs-windows.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/common/shared/Platform.gmk b/corba/make/common/shared/Platform.gmk index 428ff67b791..18f3aa330ec 100644 --- a/corba/make/common/shared/Platform.gmk +++ b/corba/make/common/shared/Platform.gmk @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/jprt.properties b/corba/make/jprt.properties index 50a286b77d3..928f5998a4c 100644 --- a/corba/make/jprt.properties +++ b/corba/make/jprt.properties @@ -1,5 +1,5 @@ # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/org/omg/idl/Makefile b/corba/make/org/omg/idl/Makefile index d83fbdc2bb5..26c14039c15 100644 --- a/corba/make/org/omg/idl/Makefile +++ b/corba/make/org/omg/idl/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/make/tools/logutil/Makefile b/corba/make/tools/logutil/Makefile index 2e19867f8d4..97472913b7e 100644 --- a/corba/make/tools/logutil/Makefile +++ b/corba/make/tools/logutil/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java index c57942f0da1..cbdf76ff2f9 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/encoding/BufferManagerReadStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java index b23049c08bc..50caa525af3 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java index c0cb1d8c100..0376fb6404b 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/oa/poa/POAFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java index 45fa6dde373..9fdf4b892ff 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java index ecd9539b8aa..f5c0116e2e8 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orb/ORBSingleton.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java index dd5af6e8b3b..551c5f94cd0 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ORBUtility.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java index e19bc78ea7a..0d48f2fc203 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java index 0bb9d94a1fd..56ebef4a2fc 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/resolver/INSURLOperationImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java index 5dbfedb9fea..881f0639768 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc b/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc index 7c46f35a117..6d933f6ed76 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc +++ b/corba/src/share/classes/com/sun/corba/se/spi/logging/data/ORBUtil.mc @@ -1,6 +1,6 @@ ; -; Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. +; Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. ; DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ; ; This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java b/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java index 17221825f62..d8cc4da5c24 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/first.set b/corba/src/share/classes/com/sun/tools/corba/se/idl/first.set index 93fcf81fdc2..86a71c55976 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/first.set +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/first.set @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/follow.set b/corba/src/share/classes/com/sun/tools/corba/se/idl/follow.set index d2797389d8e..5f2d8c1e3ab 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/follow.set +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/follow.set @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar.idl b/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar.idl index 2db525ed665..16a61f6ffe9 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar.idl +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar.idl @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar3.idl b/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar3.idl index 28d07b44229..c236d7559c0 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar3.idl +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/grammar3.idl @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl.prp index 2c6efdf76b4..b670a98a234 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl.prp @@ -1,5 +1,5 @@ # -# Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp index b3dd5f6c788..d29bd79992c 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_ja.prp @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp index 5da7dd9a845..372ca9100cb 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/idl_zh_CN.prp @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp index c24814126da..29af17fbb11 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable.prp @@ -1,5 +1,5 @@ # -# Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp index cce4ee5a7ec..e7a309be58c 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_ja.prp @@ -1,5 +1,5 @@ # -# Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp index 338a27a37fd..796bc3e5cb3 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/toJavaPortable_zh_CN.prp @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/logutil/Input.java b/corba/src/share/classes/com/sun/tools/corba/se/logutil/Input.java index 5431f0c7a17..1e69647eee5 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/Input.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/Input.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputCode.java b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputCode.java index 810a449f486..100b873cb9f 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputCode.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputCode.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java index 597d3185a6b..a40d365629b 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/com/sun/tools/corba/se/logutil/MC.java b/corba/src/share/classes/com/sun/tools/corba/se/logutil/MC.java index 9246f70c3ab..59a0da3de43 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/MC.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/MC.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/share/classes/org/omg/CORBA/ORB.java b/corba/src/share/classes/org/omg/CORBA/ORB.java index dde09300f2f..2fb6ca01959 100644 --- a/corba/src/share/classes/org/omg/CORBA/ORB.java +++ b/corba/src/share/classes/org/omg/CORBA/ORB.java @@ -1,5 +1,5 @@ /* - * Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/corba/src/windows/resource/version.rc b/corba/src/windows/resource/version.rc index dff3ae50fe7..ad3c51b64cc 100644 --- a/corba/src/windows/resource/version.rc +++ b/corba/src/windows/resource/version.rc @@ -1,5 +1,5 @@ // -// Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it From a63ef1000477ddb5e11e048a7cc5b266bf02fce6 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Tue, 28 Jul 2009 12:12:40 -0700 Subject: [PATCH 84/91] 6862919: Update copyright year Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair --- hotspot/agent/src/os/linux/Makefile | 2 +- .../src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java | 2 +- .../share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java | 2 +- .../src/share/classes/sun/jvm/hotspot/code/MonitorValue.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java | 2 +- .../src/share/classes/sun/jvm/hotspot/code/ScopeValue.java | 2 +- .../src/share/classes/sun/jvm/hotspot/debugger/Debugger.java | 2 +- .../share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java | 2 +- .../src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java | 2 +- .../classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java | 2 +- .../sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java | 2 +- .../sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java | 2 +- .../share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java | 2 +- .../share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java | 2 +- .../src/share/classes/sun/jvm/hotspot/memory/Universe.java | 2 +- .../share/classes/sun/jvm/hotspot/runtime/ClassConstants.java | 2 +- .../share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java | 2 +- .../classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java | 2 +- .../src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java | 2 +- .../src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java | 2 +- .../src/share/classes/sun/jvm/hotspot/runtime/StackValue.java | 2 +- .../src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java | 2 +- .../agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java | 2 +- .../src/share/classes/sun/jvm/hotspot/runtime/Threads.java | 2 +- hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java | 2 +- .../classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java | 2 +- .../share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java | 2 +- .../share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java | 2 +- .../classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java | 2 +- .../classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java | 2 +- hotspot/make/jprt.properties | 2 +- hotspot/make/linux/makefiles/jsig.make | 2 +- hotspot/make/linux/makefiles/saproc.make | 2 +- hotspot/make/solaris/makefiles/optimized.make | 2 +- hotspot/make/solaris/makefiles/sparcWorks.make | 2 +- hotspot/make/windows/build_vm_def.sh | 2 +- hotspot/make/windows/create.bat | 2 +- hotspot/make/windows/get_msc_ver.sh | 2 +- hotspot/make/windows/makefiles/adlc.make | 2 +- hotspot/make/windows/makefiles/compile.make | 2 +- hotspot/make/windows/makefiles/makedeps.make | 2 +- hotspot/make/windows/makefiles/rules.make | 2 +- hotspot/make/windows/makefiles/sa.make | 2 +- hotspot/make/windows/makefiles/sanity.make | 2 +- hotspot/make/windows/makefiles/vm.make | 2 +- hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp | 2 +- hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp | 2 +- hotspot/src/cpu/sparc/vm/globals_sparc.hpp | 2 +- hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/frame_x86.cpp | 2 +- hotspot/src/cpu/x86/vm/globals_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp | 2 +- hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp | 2 +- hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp | 2 +- hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp | 2 +- hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp | 2 +- hotspot/src/os/linux/vm/os_linux.hpp | 2 +- hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp | 2 +- hotspot/src/os/solaris/dtrace/jhelper.d | 2 +- hotspot/src/os/solaris/dtrace/libjvm_db.c | 2 +- hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp | 2 +- hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp | 2 +- hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp | 2 +- .../src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp | 2 +- .../solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp | 2 +- hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp | 2 +- hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp | 2 +- .../os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp | 2 +- .../os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp | 2 +- hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp | 2 +- hotspot/src/share/tools/MakeDeps/BuildConfig.java | 2 +- hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java | 2 +- hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC8.java | 2 +- hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC9.java | 2 +- hotspot/src/share/tools/hsdis/Makefile | 2 +- hotspot/src/share/tools/hsdis/hsdis-demo.c | 2 +- hotspot/src/share/tools/hsdis/hsdis.c | 2 +- hotspot/src/share/vm/adlc/adlc.hpp | 2 +- hotspot/src/share/vm/asm/assembler.cpp | 2 +- hotspot/src/share/vm/c1/c1_Compilation.cpp | 2 +- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 2 +- hotspot/src/share/vm/c1/c1_LinearScan.cpp | 2 +- hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp | 2 +- hotspot/src/share/vm/ci/ciEnv.cpp | 2 +- hotspot/src/share/vm/ci/ciEnv.hpp | 2 +- hotspot/src/share/vm/ci/ciMethodBlocks.cpp | 2 +- hotspot/src/share/vm/ci/ciStreams.cpp | 2 +- hotspot/src/share/vm/ci/ciStreams.hpp | 2 +- hotspot/src/share/vm/ci/ciTypeFlow.cpp | 2 +- hotspot/src/share/vm/classfile/classLoader.cpp | 2 +- hotspot/src/share/vm/classfile/verifier.cpp | 2 +- hotspot/src/share/vm/code/vtableStubs.cpp | 2 +- hotspot/src/share/vm/compiler/compileBroker.cpp | 2 +- .../src/share/vm/gc_implementation/g1/collectionSetChooser.cpp | 2 +- .../src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp | 2 +- .../share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp | 2 +- .../share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp | 2 +- .../src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp | 2 +- .../src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp | 2 +- .../src/share/vm/gc_implementation/g1/concurrentZFThread.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp | 2 +- hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp | 2 +- .../src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp | 2 +- .../vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp | 2 +- .../share/vm/gc_implementation/shared/concurrentGCThread.cpp | 2 +- .../share/vm/gc_implementation/shared/concurrentGCThread.hpp | 2 +- hotspot/src/share/vm/gc_interface/gcCause.hpp | 2 +- hotspot/src/share/vm/includeDB_compiler1 | 2 +- hotspot/src/share/vm/includeDB_jvmti | 2 +- hotspot/src/share/vm/interpreter/bytecode.cpp | 2 +- hotspot/src/share/vm/interpreter/bytecode.hpp | 2 +- hotspot/src/share/vm/interpreter/bytecodeStream.hpp | 2 +- hotspot/src/share/vm/interpreter/bytecodeTracer.cpp | 2 +- hotspot/src/share/vm/interpreter/bytecodes.cpp | 2 +- hotspot/src/share/vm/interpreter/bytecodes.hpp | 2 +- hotspot/src/share/vm/interpreter/invocationCounter.cpp | 2 +- hotspot/src/share/vm/interpreter/rewriter.hpp | 2 +- hotspot/src/share/vm/interpreter/templateTable.cpp | 2 +- hotspot/src/share/vm/interpreter/templateTable.hpp | 2 +- hotspot/src/share/vm/memory/blockOffsetTable.hpp | 2 +- hotspot/src/share/vm/memory/cardTableRS.cpp | 2 +- hotspot/src/share/vm/memory/gcLocker.hpp | 2 +- hotspot/src/share/vm/memory/heap.cpp | 2 +- hotspot/src/share/vm/oops/cpCacheOop.cpp | 2 +- hotspot/src/share/vm/oops/generateOopMap.cpp | 2 +- hotspot/src/share/vm/oops/methodDataOop.cpp | 2 +- hotspot/src/share/vm/opto/addnode.cpp | 2 +- hotspot/src/share/vm/opto/block.hpp | 2 +- hotspot/src/share/vm/opto/buildOopMap.cpp | 2 +- hotspot/src/share/vm/opto/bytecodeInfo.cpp | 2 +- hotspot/src/share/vm/opto/c2compiler.cpp | 2 +- hotspot/src/share/vm/opto/callnode.cpp | 2 +- hotspot/src/share/vm/opto/callnode.hpp | 2 +- hotspot/src/share/vm/opto/coalesce.cpp | 2 +- hotspot/src/share/vm/opto/connode.cpp | 2 +- hotspot/src/share/vm/opto/doCall.cpp | 2 +- hotspot/src/share/vm/opto/escape.cpp | 2 +- hotspot/src/share/vm/opto/loopTransform.cpp | 2 +- hotspot/src/share/vm/opto/loopopts.cpp | 2 +- hotspot/src/share/vm/opto/machnode.cpp | 2 +- hotspot/src/share/vm/opto/matcher.hpp | 2 +- hotspot/src/share/vm/opto/output.cpp | 2 +- hotspot/src/share/vm/opto/parse.hpp | 2 +- hotspot/src/share/vm/opto/parse1.cpp | 2 +- hotspot/src/share/vm/opto/parse2.cpp | 2 +- hotspot/src/share/vm/opto/parse3.cpp | 2 +- hotspot/src/share/vm/opto/parseHelper.cpp | 2 +- hotspot/src/share/vm/opto/subnode.cpp | 2 +- hotspot/src/share/vm/opto/superword.hpp | 2 +- hotspot/src/share/vm/prims/jvm_misc.hpp | 2 +- hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiEnvBase.cpp | 2 +- hotspot/src/share/vm/prims/methodComparator.cpp | 2 +- hotspot/src/share/vm/runtime/biasedLocking.cpp | 2 +- hotspot/src/share/vm/runtime/deoptimization.cpp | 2 +- hotspot/src/share/vm/runtime/dtraceJSDT.cpp | 2 +- hotspot/src/share/vm/runtime/frame.hpp | 2 +- hotspot/src/share/vm/runtime/hpi.hpp | 2 +- hotspot/src/share/vm/runtime/interfaceSupport.cpp | 2 +- hotspot/src/share/vm/runtime/mutexLocker.cpp | 2 +- hotspot/src/share/vm/runtime/mutexLocker.hpp | 2 +- hotspot/src/share/vm/runtime/orderAccess.cpp | 2 +- hotspot/src/share/vm/runtime/orderAccess.hpp | 2 +- hotspot/src/share/vm/runtime/stackValue.cpp | 2 +- hotspot/src/share/vm/runtime/stackValue.hpp | 2 +- hotspot/src/share/vm/runtime/thread.cpp | 2 +- hotspot/src/share/vm/runtime/thread.hpp | 2 +- hotspot/src/share/vm/runtime/vframe.cpp | 2 +- hotspot/src/share/vm/runtime/vframe.hpp | 2 +- hotspot/src/share/vm/runtime/vframeArray.cpp | 2 +- hotspot/src/share/vm/runtime/vframe_hp.cpp | 2 +- hotspot/src/share/vm/runtime/virtualspace.cpp | 2 +- hotspot/src/share/vm/runtime/virtualspace.hpp | 2 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 2 +- hotspot/src/share/vm/runtime/vmThread.cpp | 2 +- hotspot/src/share/vm/runtime/vm_operations.hpp | 2 +- hotspot/src/share/vm/runtime/vm_version.cpp | 2 +- hotspot/src/share/vm/utilities/bitMap.cpp | 2 +- hotspot/src/share/vm/utilities/bitMap.hpp | 2 +- hotspot/src/share/vm/utilities/bitMap.inline.hpp | 2 +- hotspot/src/share/vm/utilities/exceptions.hpp | 2 +- hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp | 2 +- hotspot/src/share/vm/utilities/macros.hpp | 2 +- hotspot/test/compiler/6772683/InterruptedTest.java | 2 +- hotspot/test/compiler/6832293/Test.java | 2 +- hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java | 2 +- 199 files changed, 199 insertions(+), 199 deletions(-) diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile index c7b64107b14..4f99ac31067 100644 --- a/hotspot/agent/src/os/linux/Makefile +++ b/hotspot/agent/src/os/linux/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java index 82f5ac44d0b..8c7c15d6ae7 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java index fa60c49839b..0ae5a9be997 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java index 43937fc690a..edfdaa18ac0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java index e75365ae226..93b498efbd4 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java index 71166a706b1..5bb1077f40e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java index 41e71c2228e..d7f1e4851a2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java index 8f5c732499b..854e5a0de1e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java index 80b71637393..586a505f702 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java index df03ce3e01c..f0b5814f4b8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java index 8a1bacb2fee..c4a8404c902 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java index edb52a65012..60f64d9814c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java index b469bde96b6..44054f93506 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java index 7ae8675f48a..3df1f22e2fd 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java index b9cdc92ff03..c6bbe3de65d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java index 306a9e677a6..431a18261a9 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java index 6588da2e8bd..5b870c9fe69 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java index f86e4f7a2c5..96f96346326 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java index 9cd4aedf6ce..4a68a22b97c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java index d4801fa05f6..b6aa76edca3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java index 98becd01816..6e6f0b8d740 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java index fad351b495d..7eb5f4924d1 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java index 9ca93b931fb..425ad5c743d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java index 9be499b5b80..ce3694ad530 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 6301b560a8e..fda1e4f39d7 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java index 3ab24ab3167..23d12314105 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java index d0cbd109b5d..1f866dfc3a7 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java index ef6ef8c7e61..077ce1241e1 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java index 6ee998699bd..bccf9fd6434 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java index b8fce3abdbf..b9f54946232 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index 0a60bae587a..c0cb616c530 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -1,5 +1,5 @@ # -# Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/linux/makefiles/jsig.make b/hotspot/make/linux/makefiles/jsig.make index edf4f77cca9..6dcff6aa72a 100644 --- a/hotspot/make/linux/makefiles/jsig.make +++ b/hotspot/make/linux/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index 11a100ad051..db05d137396 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/solaris/makefiles/optimized.make b/hotspot/make/solaris/makefiles/optimized.make index 66609cae946..d3cf526f60c 100644 --- a/hotspot/make/solaris/makefiles/optimized.make +++ b/hotspot/make/solaris/makefiles/optimized.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index f88cfdfff3a..d1648383857 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/build_vm_def.sh b/hotspot/make/windows/build_vm_def.sh index 99e30bb1b9e..6f78c6a2f1d 100644 --- a/hotspot/make/windows/build_vm_def.sh +++ b/hotspot/make/windows/build_vm_def.sh @@ -1,5 +1,5 @@ # -# Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/create.bat b/hotspot/make/windows/create.bat index bdb1916107d..0f208806b65 100644 --- a/hotspot/make/windows/create.bat +++ b/hotspot/make/windows/create.bat @@ -1,6 +1,6 @@ @echo off REM -REM Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. +REM Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/get_msc_ver.sh b/hotspot/make/windows/get_msc_ver.sh index 67df0d0dd95..9cf69456a52 100644 --- a/hotspot/make/windows/get_msc_ver.sh +++ b/hotspot/make/windows/get_msc_ver.sh @@ -1,5 +1,5 @@ # -# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/adlc.make b/hotspot/make/windows/makefiles/adlc.make index e9af2f964bb..8e424eb888c 100644 --- a/hotspot/make/windows/makefiles/adlc.make +++ b/hotspot/make/windows/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/compile.make b/hotspot/make/windows/makefiles/compile.make index 4906ab5a989..fcbd74663b4 100644 --- a/hotspot/make/windows/makefiles/compile.make +++ b/hotspot/make/windows/makefiles/compile.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/makedeps.make b/hotspot/make/windows/makefiles/makedeps.make index 43f25a4666d..f9c8e6ab530 100644 --- a/hotspot/make/windows/makefiles/makedeps.make +++ b/hotspot/make/windows/makefiles/makedeps.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/rules.make b/hotspot/make/windows/makefiles/rules.make index 064fb3f231d..90815ace24c 100644 --- a/hotspot/make/windows/makefiles/rules.make +++ b/hotspot/make/windows/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index 1970f116b45..734f2259432 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/sanity.make b/hotspot/make/windows/makefiles/sanity.make index dd5c7499f1d..dc7b07192fc 100644 --- a/hotspot/make/windows/makefiles/sanity.make +++ b/hotspot/make/windows/makefiles/sanity.make @@ -1,5 +1,5 @@ # -# Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make index eafb4417da5..2da551fc804 100644 --- a/hotspot/make/windows/makefiles/vm.make +++ b/hotspot/make/windows/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index a6e6c60e2a7..379ae282de3 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 4d11edf2a3a..dd29a3fab66 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 98b3230ec7b..ff28c96cfc7 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index 83178a8ef91..c340c87c0b1 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index dc0ca4af509..8ec4ba76295 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 9d6d0292eab..f5586c1ee56 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp index 04f87f3bbab..6975fdc2699 100644 --- a/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreterRT_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp index a89eff6f606..51c05b3d4b7 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 07034a48121..48285f46ddd 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp index 3a16d35aa78..3de2675f5a8 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp index 03de86684fa..3f40366c940 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp index a51c2feed41..9291613b1bb 100644 --- a/hotspot/src/os/linux/vm/os_linux.hpp +++ b/hotspot/src/os/linux/vm/os_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp index 5ad280c3b7b..70ce7437886 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/solaris/dtrace/jhelper.d b/hotspot/src/os/solaris/dtrace/jhelper.d index da5837238c8..622e51a1ca0 100644 --- a/hotspot/src/os/solaris/dtrace/jhelper.d +++ b/hotspot/src/os/solaris/dtrace/jhelper.d @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c index afa443092b4..b162f057b5b 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.c +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp index 68be1d43523..d9379c0eaa6 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp index 865cd1ce0f1..4db57ad1e14 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp index 24d2bab7c19..a1cb9732ace 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp index 9777b0a131d..5a175f5fff7 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp index 71f16d94158..e982d220361 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp index 5e27aefb977..ffb0fc9fd5f 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index 44b67e9d035..3d8fc1c44b4 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp index 62fee83dd25..3faa28adaf4 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp index 1a291cd91ff..4b51eef5ee0 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp index bf4d97d21b4..60fde2bd571 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp index 97226fa37dd..300541e0e96 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp index 1e53ed1aaa1..74efbf3df73 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp index e322f5fd1e8..5d9f5cfe330 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp index 1e0c6b334b5..192b381702f 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp index 5f8958567e0..2159d8752da 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/MakeDeps/BuildConfig.java b/hotspot/src/share/tools/MakeDeps/BuildConfig.java index ec26bc698c7..323bfd3f0b1 100644 --- a/hotspot/src/share/tools/MakeDeps/BuildConfig.java +++ b/hotspot/src/share/tools/MakeDeps/BuildConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java b/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java index 109613b45d7..5e47abea0d8 100644 --- a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java +++ b/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC7.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC8.java b/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC8.java index a346b611560..2bf9e68f30a 100644 --- a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC8.java +++ b/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC8.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC9.java b/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC9.java index 4b64a555833..e18f693b174 100644 --- a/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC9.java +++ b/hotspot/src/share/tools/MakeDeps/WinGammaPlatformVC9.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile index c1fd4ca4b9d..605e4218c39 100644 --- a/hotspot/src/share/tools/hsdis/Makefile +++ b/hotspot/src/share/tools/hsdis/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/hsdis/hsdis-demo.c b/hotspot/src/share/tools/hsdis/hsdis-demo.c index 513245350f0..7036cf6dc38 100644 --- a/hotspot/src/share/tools/hsdis/hsdis-demo.c +++ b/hotspot/src/share/tools/hsdis/hsdis-demo.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c index 841a3af62ec..213a6be5be3 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/adlc/adlc.hpp b/hotspot/src/share/vm/adlc/adlc.hpp index 6b92dfd8476..449238d6f37 100644 --- a/hotspot/src/share/vm/adlc/adlc.hpp +++ b/hotspot/src/share/vm/adlc/adlc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index e41fc7e9d31..492f2fd134c 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index 8b4f5bcead8..d89ef4e7b1a 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index dac5e5b2c75..30a1ada8231 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 40332b1e91d..bab43e2ad21 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp index e5b6b66498f..71cffdbd6da 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index e713d51a674..ccce4e539f3 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index 5fc25bae6ab..e58e5a67dfa 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp index 934cca6d99d..ff2e908b7fa 100644 --- a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp +++ b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciStreams.cpp b/hotspot/src/share/vm/ci/ciStreams.cpp index 5401e64f7b9..d343ab8446d 100644 --- a/hotspot/src/share/vm/ci/ciStreams.cpp +++ b/hotspot/src/share/vm/ci/ciStreams.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciStreams.hpp b/hotspot/src/share/vm/ci/ciStreams.hpp index cc3e55ed9ab..448e27cb16a 100644 --- a/hotspot/src/share/vm/ci/ciStreams.hpp +++ b/hotspot/src/share/vm/ci/ciStreams.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index 9bf831ef9f3..cc6cc667917 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 9e48c90a7e4..9871561b420 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 6e0fc7e984d..bb5edc785dc 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/code/vtableStubs.cpp b/hotspot/src/share/vm/code/vtableStubs.cpp index 6c5a937bf4c..67149eae5c6 100644 --- a/hotspot/src/share/vm/code/vtableStubs.cpp +++ b/hotspot/src/share/vm/code/vtableStubs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 290f64872d0..799d9f89202 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp index 418dd584954..3000f010b17 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp index 5cd82d79585..3473fac0186 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp index a97a7c48a17..cd5729cfd58 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp index 3ab9b1958ad..0a89e96ba05 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 20f001d7758..9596aea2183 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp index 23164b6b075..20e38dcd916 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp index a91f319d067..e439bdb44d1 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp index db6a7d09ddc..659d4e78892 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentZFThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp index 5b0dfba7066..19405a0eccb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp index 5670ebe5ac3..492d9f54acb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp index 00aa14452c2..db345b993d0 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index 43af2b52cb7..170d9473eed 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp index 6eee58edcd3..8509a8cadfe 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp index 9f9d9dd1839..060743dd38a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp index 7bee59dbff7..5baa5505662 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp index 40af9313c33..e59dbe483d2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp index 47eb146e7de..6cf0605ec8c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp index dddb3bb7d3c..2894794c1cb 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp index 482b1a452e4..01522a7758c 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp index d046323d266..8351694c6ca 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp index a4ebd858d28..ca1d97169c9 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc_interface/gcCause.hpp b/hotspot/src/share/vm/gc_interface/gcCause.hpp index da23c8e70d4..19c2ab738b1 100644 --- a/hotspot/src/share/vm/gc_interface/gcCause.hpp +++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/includeDB_compiler1 b/hotspot/src/share/vm/includeDB_compiler1 index 6f33d724516..21b26cdc90e 100644 --- a/hotspot/src/share/vm/includeDB_compiler1 +++ b/hotspot/src/share/vm/includeDB_compiler1 @@ -1,5 +1,5 @@ // -// Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/includeDB_jvmti b/hotspot/src/share/vm/includeDB_jvmti index ba6dc9b23fa..1af182ae24c 100644 --- a/hotspot/src/share/vm/includeDB_jvmti +++ b/hotspot/src/share/vm/includeDB_jvmti @@ -1,5 +1,5 @@ // -// Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecode.cpp b/hotspot/src/share/vm/interpreter/bytecode.cpp index f91d5667ed3..0cc8a728950 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.cpp +++ b/hotspot/src/share/vm/interpreter/bytecode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index 64941d8d5fc..49e70e8c1f3 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp index 7a3a0125e0e..5a9fa3223af 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp index ed216864d36..79cee762daa 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 56a89b39864..e55c9ff3851 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp index bf888725992..1f8f2268792 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/invocationCounter.cpp b/hotspot/src/share/vm/interpreter/invocationCounter.cpp index 7ecc70d1997..80be66bebd7 100644 --- a/hotspot/src/share/vm/interpreter/invocationCounter.cpp +++ b/hotspot/src/share/vm/interpreter/invocationCounter.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/rewriter.hpp b/hotspot/src/share/vm/interpreter/rewriter.hpp index 4b8ff7e6012..2546b57ef37 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.hpp +++ b/hotspot/src/share/vm/interpreter/rewriter.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp index 8e116ae77b3..11b5aa0ba23 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.cpp +++ b/hotspot/src/share/vm/interpreter/templateTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index 41d82d5e618..79b2ad8676f 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/blockOffsetTable.hpp b/hotspot/src/share/vm/memory/blockOffsetTable.hpp index b812a243190..2b64487d5b0 100644 --- a/hotspot/src/share/vm/memory/blockOffsetTable.hpp +++ b/hotspot/src/share/vm/memory/blockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp index da80ddf9725..df73a90f24b 100644 --- a/hotspot/src/share/vm/memory/cardTableRS.cpp +++ b/hotspot/src/share/vm/memory/cardTableRS.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/gcLocker.hpp b/hotspot/src/share/vm/memory/gcLocker.hpp index 8a131736976..e88554c641c 100644 --- a/hotspot/src/share/vm/memory/gcLocker.hpp +++ b/hotspot/src/share/vm/memory/gcLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp index ced1bf23c01..4f638fda468 100644 --- a/hotspot/src/share/vm/memory/heap.cpp +++ b/hotspot/src/share/vm/memory/heap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/cpCacheOop.cpp b/hotspot/src/share/vm/oops/cpCacheOop.cpp index 55aa6d9a2ac..6f549afbe38 100644 --- a/hotspot/src/share/vm/oops/cpCacheOop.cpp +++ b/hotspot/src/share/vm/oops/cpCacheOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/generateOopMap.cpp b/hotspot/src/share/vm/oops/generateOopMap.cpp index 36e98c40404..eb533a81e6f 100644 --- a/hotspot/src/share/vm/oops/generateOopMap.cpp +++ b/hotspot/src/share/vm/oops/generateOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/oops/methodDataOop.cpp b/hotspot/src/share/vm/oops/methodDataOop.cpp index e61dffe81f3..a77db3c455b 100644 --- a/hotspot/src/share/vm/oops/methodDataOop.cpp +++ b/hotspot/src/share/vm/oops/methodDataOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index 63932df349d..0af6bafd742 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp index 93940b466c3..0511b46dda3 100644 --- a/hotspot/src/share/vm/opto/block.hpp +++ b/hotspot/src/share/vm/opto/block.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 81ad6b7dbee..90dc89f53e5 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 20e1faff505..9f93ab83773 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 22509077fbb..4ee3a6f5d2c 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index 94a261d4622..44baf2a878c 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index e82f7606b43..fa775de846c 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/coalesce.cpp b/hotspot/src/share/vm/opto/coalesce.cpp index 99584ca165c..fbde9f80fce 100644 --- a/hotspot/src/share/vm/opto/coalesce.cpp +++ b/hotspot/src/share/vm/opto/coalesce.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/connode.cpp b/hotspot/src/share/vm/opto/connode.cpp index 4f7036ca933..431ddbc6271 100644 --- a/hotspot/src/share/vm/opto/connode.cpp +++ b/hotspot/src/share/vm/opto/connode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index 7246fb36d45..5104e648aa6 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index ed3067e9e94..ac17b5c27a1 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index d315a9e6c61..0d4bf7869ea 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 5084e3d8234..206a6f9fd9f 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index b7357f86ab6..80b1735b132 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp index 0067e216355..fe657c53421 100644 --- a/hotspot/src/share/vm/opto/matcher.hpp +++ b/hotspot/src/share/vm/opto/matcher.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index 3c8af599142..7065cebec0e 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp index 7120c51a1c6..4b3ca591297 100644 --- a/hotspot/src/share/vm/opto/parse.hpp +++ b/hotspot/src/share/vm/opto/parse.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index 0b603aa7673..222a2f35a16 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index 40675d41cbc..496b4f230cf 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parse3.cpp b/hotspot/src/share/vm/opto/parse3.cpp index 0869ee6b634..04b63939a77 100644 --- a/hotspot/src/share/vm/opto/parse3.cpp +++ b/hotspot/src/share/vm/opto/parse3.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/parseHelper.cpp b/hotspot/src/share/vm/opto/parseHelper.cpp index 7e87d7702d1..6b3f432eae7 100644 --- a/hotspot/src/share/vm/opto/parseHelper.cpp +++ b/hotspot/src/share/vm/opto/parseHelper.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index ae88d736b10..81e033f2769 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/superword.hpp b/hotspot/src/share/vm/opto/superword.hpp index 4c11ff639b8..647bd27a79e 100644 --- a/hotspot/src/share/vm/opto/superword.hpp +++ b/hotspot/src/share/vm/opto/superword.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvm_misc.hpp b/hotspot/src/share/vm/prims/jvm_misc.hpp index 50644842bbd..e93181ac56b 100644 --- a/hotspot/src/share/vm/prims/jvm_misc.hpp +++ b/hotspot/src/share/vm/prims/jvm_misc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp index 447dcb23766..c8d9865c8b4 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp index 142b60c54e4..c6526995912 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/prims/methodComparator.cpp b/hotspot/src/share/vm/prims/methodComparator.cpp index 494f0482216..a6ef36ef290 100644 --- a/hotspot/src/share/vm/prims/methodComparator.cpp +++ b/hotspot/src/share/vm/prims/methodComparator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/biasedLocking.cpp b/hotspot/src/share/vm/runtime/biasedLocking.cpp index ddc7305c77f..8fbd33aad00 100644 --- a/hotspot/src/share/vm/runtime/biasedLocking.cpp +++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index 586f4f5fd2f..8962bf7dfec 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp index 2de788a2ffd..cd00dea55e3 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp index 7513ca1f4b2..9817a36414a 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/hpi.hpp b/hotspot/src/share/vm/runtime/hpi.hpp index 506b911ca12..f30c2c3ebe4 100644 --- a/hotspot/src/share/vm/runtime/hpi.hpp +++ b/hotspot/src/share/vm/runtime/hpi.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/interfaceSupport.cpp b/hotspot/src/share/vm/runtime/interfaceSupport.cpp index b60f3ffd7bf..1852f7a6b53 100644 --- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp +++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 437192d6ba3..3b21a2094f5 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp index e1715064385..80d626a8031 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/orderAccess.cpp b/hotspot/src/share/vm/runtime/orderAccess.cpp index 1e66d6258f5..8f385a45dce 100644 --- a/hotspot/src/share/vm/runtime/orderAccess.cpp +++ b/hotspot/src/share/vm/runtime/orderAccess.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/orderAccess.hpp b/hotspot/src/share/vm/runtime/orderAccess.hpp index d6b83466da5..38833159df5 100644 --- a/hotspot/src/share/vm/runtime/orderAccess.hpp +++ b/hotspot/src/share/vm/runtime/orderAccess.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/stackValue.cpp b/hotspot/src/share/vm/runtime/stackValue.cpp index 9f3fb0f0ec3..8e601d2e378 100644 --- a/hotspot/src/share/vm/runtime/stackValue.cpp +++ b/hotspot/src/share/vm/runtime/stackValue.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/stackValue.hpp b/hotspot/src/share/vm/runtime/stackValue.hpp index 1715ec65b20..f242ca3eced 100644 --- a/hotspot/src/share/vm/runtime/stackValue.hpp +++ b/hotspot/src/share/vm/runtime/stackValue.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 5c08990e53b..59fb8dbc725 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index f5529e0155a..c1920bb220f 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp index 64215384091..3b6ba813f9c 100644 --- a/hotspot/src/share/vm/runtime/vframe.cpp +++ b/hotspot/src/share/vm/runtime/vframe.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 2924aeae983..034da7d3768 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp index 60a2a23b737..426f57e2cb9 100644 --- a/hotspot/src/share/vm/runtime/vframeArray.cpp +++ b/hotspot/src/share/vm/runtime/vframeArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vframe_hp.cpp b/hotspot/src/share/vm/runtime/vframe_hp.cpp index 1fc0f2b7d18..1c991d91bc9 100644 --- a/hotspot/src/share/vm/runtime/vframe_hp.cpp +++ b/hotspot/src/share/vm/runtime/vframe_hp.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp index e6e4b55a690..94947f58149 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/virtualspace.hpp b/hotspot/src/share/vm/runtime/virtualspace.hpp index f412d11ad55..37f12ad4c3a 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.hpp +++ b/hotspot/src/share/vm/runtime/virtualspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 23d1db27980..c0226759c70 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vmThread.cpp b/hotspot/src/share/vm/runtime/vmThread.cpp index c2d7c11db48..7b2cc45bed8 100644 --- a/hotspot/src/share/vm/runtime/vmThread.cpp +++ b/hotspot/src/share/vm/runtime/vmThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index 8f6e114623b..09fc2eee914 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index 3e7a7e6e0fe..b05e41ffc6b 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/utilities/bitMap.cpp b/hotspot/src/share/vm/utilities/bitMap.cpp index f2f54fa814c..991c7450b6b 100644 --- a/hotspot/src/share/vm/utilities/bitMap.cpp +++ b/hotspot/src/share/vm/utilities/bitMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/utilities/bitMap.hpp b/hotspot/src/share/vm/utilities/bitMap.hpp index 89818dfa6f2..1c0d6dac496 100644 --- a/hotspot/src/share/vm/utilities/bitMap.hpp +++ b/hotspot/src/share/vm/utilities/bitMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/utilities/bitMap.inline.hpp b/hotspot/src/share/vm/utilities/bitMap.inline.hpp index 7abce42c35d..ff104ade44f 100644 --- a/hotspot/src/share/vm/utilities/bitMap.inline.hpp +++ b/hotspot/src/share/vm/utilities/bitMap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp index 0dbfd91c10f..ca01f455c75 100644 --- a/hotspot/src/share/vm/utilities/exceptions.hpp +++ b/hotspot/src/share/vm/utilities/exceptions.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp index 2b64dfc4662..453ff8a75c7 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_visCPP.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp index 1d7cb9cce19..b4d7ea45743 100644 --- a/hotspot/src/share/vm/utilities/macros.hpp +++ b/hotspot/src/share/vm/utilities/macros.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/test/compiler/6772683/InterruptedTest.java b/hotspot/test/compiler/6772683/InterruptedTest.java index c1670a58bc5..8ecaa8cb2be 100644 --- a/hotspot/test/compiler/6772683/InterruptedTest.java +++ b/hotspot/test/compiler/6772683/InterruptedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/test/compiler/6832293/Test.java b/hotspot/test/compiler/6832293/Test.java index 7a2c74d3ca1..cda47a84c90 100644 --- a/hotspot/test/compiler/6832293/Test.java +++ b/hotspot/test/compiler/6832293/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java b/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java index dc49db66122..9d1fc927774 100644 --- a/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java +++ b/hotspot/test/runtime/6819213/TestBootNativeLibraryPath.java @@ -1,5 +1,5 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From 632469b81d4d78fce99e6b6f7cc49a69d4f24262 Mon Sep 17 00:00:00 2001 From: Xiomara Jayasena Date: Tue, 28 Jul 2009 12:12:45 -0700 Subject: [PATCH 85/91] 6862919: Update copyright year Update copyright for files that have been modified in 2009, up to 07/09 Reviewed-by: tbell, ohair --- jaxp/make/build.properties | 2 +- jaxp/make/build.xml | 2 +- jaxp/make/jprt.properties | 2 +- .../sun/org/apache/xerces/internal/impl/PropertyManager.java | 2 +- .../xerces/internal/impl/XMLDocumentFragmentScannerImpl.java | 2 +- .../org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java | 2 +- .../org/apache/xerces/internal/impl/XMLStreamFilterImpl.java | 2 +- .../sun/xml/internal/stream/events/XMLEventAllocatorImpl.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jaxp/make/build.properties b/jaxp/make/build.properties index ed598102aa9..6689159753b 100644 --- a/jaxp/make/build.properties +++ b/jaxp/make/build.properties @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/jaxp/make/build.xml b/jaxp/make/build.xml index c9439d0109e..63a78a18909 100644 --- a/jaxp/make/build.xml +++ b/jaxp/make/build.xml @@ -1,6 +1,6 @@