Mercurial > hg > graal-jvmci-8
diff agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java @ 818:b109e761e927
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
Summary: Disable escape analysis when jvmti/debugger is used. Add support for EA ibto SA.
Reviewed-by: never
author | kvn |
---|---|
date | Tue, 09 Jun 2009 16:19:10 -0700 |
parents | a61af66fc99e |
children | bd02caa94611 9987d9d5eb0e |
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java Fri Jun 05 10:25:39 2009 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java Tue Jun 09 16:19:10 2009 -0700 @@ -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<ObjectValue> 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; }