Mercurial > hg > truffle
diff agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d7922586cf6 |
children | c5f6a7397eb1 |
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java Fri Aug 31 16:39:35 2012 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java Sat Sep 01 13:25:18 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,8 +72,8 @@ }); } - /** Size of constMethodOopDesc for computing BCI from BCP (FIXME: hack) */ - private static long constMethodOopDescSize; + /** Size of ConstMethod for computing BCI from BCP (FIXME: hack) */ + private static long ConstMethodSize; private static int pcReturnOffset; @@ -82,10 +82,10 @@ } private static synchronized void initialize(TypeDataBase db) { - Type constMethodOopType = db.lookupType("constMethodOopDesc"); + Type ConstMethodType = db.lookupType("ConstMethod"); // FIXME: not sure whether alignment here is correct or how to // force it (round up to address size?) - constMethodOopDescSize = constMethodOopType.getSize(); + ConstMethodSize = ConstMethodType.getSize(); pcReturnOffset = db.lookupIntConstant("frame::pc_return_offset").intValue(); } @@ -97,7 +97,7 @@ if (bcp == null) return 0; long bci = bcp.minus(null); if (bci >= 0 && bci < cm.getCodeSize()) return (int) bci; - return (int) (bcp.minus(cm.getHandle()) - constMethodOopDescSize); + return (int) (bcp.minus(cm.getAddress()) - ConstMethodSize); } protected int bcpToBci(Address bcp, Method m) { @@ -285,7 +285,7 @@ // NOTE that the accessor "addressOfInterpreterFrameBCX" has // necessarily been eliminated. The byte code pointer is inherently // an interior pointer to a Method (the bytecodes follow the - // methodOopDesc data structure) and therefore acquisition of it in + // Method data structure) and therefore acquisition of it in // this system can not be allowed. All accesses to interpreter frame // byte codes are via the byte code index (BCI). @@ -374,7 +374,7 @@ /** Current method */ public Method getInterpreterFrameMethod() { - return (Method) VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameMethod().getOopHandleAt(0)); + return (Method)Metadata.instantiateWrapperFor(addressOfInterpreterFrameMethod().getAddressAt(0)); } /** Current method */ @@ -385,7 +385,7 @@ public abstract Address addressOfInterpreterFrameCPCache(); /** Constant pool cache */ public ConstantPoolCache getInterpreterFrameCPCache() { - return (ConstantPoolCache) VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameCPCache().getOopHandleAt(0)); + return (ConstantPoolCache) Metadata.instantiateWrapperFor(addressOfInterpreterFrameCPCache().getAddressAt(0)); } //-------------------------------------------------------------------------------- @@ -583,8 +583,9 @@ // } // process fixed part - oopVisitor.visitAddress(addressOfInterpreterFrameMethod()); - oopVisitor.visitAddress(addressOfInterpreterFrameCPCache()); + // FIXME: these are no longer oops, so should anything be visitied? + // oopVisitor.visitAddress(addressOfInterpreterFrameMethod()); + // oopVisitor.visitAddress(addressOfInterpreterFrameCPCache()); // FIXME: expose interpreterFrameMirrorOffset // if (m.isNative() && m.isStatic()) {