changeset 490:f8ac1c76761f

meth-lazy: removed Ricochet frame code from SA
author twisti
date Thu, 19 Jul 2012 15:15:32 -0700
parents cc59efc75960
children 89a156565b76
files meth-lazy-7023639.review.patch
diffstat 1 files changed, 415 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.review.patch	Thu Jul 19 13:56:52 2012 -0700
+++ b/meth-lazy-7023639.review.patch	Thu Jul 19 15:15:32 2012 -0700
@@ -1,6 +1,421 @@
 # HG changeset patch
 # Parent fe6edd334f2d863f8b842505ef37ea0b4c608f68
 
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java b/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
+--- a/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
++++ b/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
+@@ -93,7 +93,6 @@
+   public boolean isUncommonTrapStub()   { return false; }
+   public boolean isExceptionStub()      { return false; }
+   public boolean isSafepointStub()      { return false; }
+-  public boolean isRicochetBlob()       { return false; }
+   public boolean isAdapterBlob()        { return false; }
+ 
+   // Fine grain nmethod support: isNmethod() == isJavaMethod() || isNativeMethod() || isOSRMethod()
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java b/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
+--- a/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
++++ b/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
+@@ -57,7 +57,6 @@
+     virtualConstructor.addMapping("BufferBlob", BufferBlob.class);
+     virtualConstructor.addMapping("nmethod", NMethod.class);
+     virtualConstructor.addMapping("RuntimeStub", RuntimeStub.class);
+-    virtualConstructor.addMapping("RicochetBlob", RicochetBlob.class);
+     virtualConstructor.addMapping("AdapterBlob", AdapterBlob.class);
+     virtualConstructor.addMapping("MethodHandlesAdapterBlob", MethodHandlesAdapterBlob.class);
+     virtualConstructor.addMapping("SafepointBlob", SafepointBlob.class);
+@@ -127,10 +126,6 @@
+       Assert.that(result.blobContains(start) || result.blobContains(start.addOffsetTo(8)),
+                                                                     "found wrong CodeBlob");
+     }
+-    if (result.isRicochetBlob()) {
+-      // This should probably be done for other SingletonBlobs
+-      return VM.getVM().ricochetBlob();
+-    }
+     return result;
+   }
+ 
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/code/RicochetBlob.java b/agent/src/share/classes/sun/jvm/hotspot/code/RicochetBlob.java
+deleted file mode 100644
+--- a/agent/src/share/classes/sun/jvm/hotspot/code/RicochetBlob.java
++++ /dev/null
+@@ -1,70 +0,0 @@
+-/*
+- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- *
+- */
+-
+-package sun.jvm.hotspot.code;
+-
+-import java.util.*;
+-import sun.jvm.hotspot.debugger.*;
+-import sun.jvm.hotspot.runtime.*;
+-import sun.jvm.hotspot.types.*;
+-
+-/** RicochetBlob (currently only used by Compiler 2) */
+-
+-public class RicochetBlob extends SingletonBlob {
+-  static {
+-    VM.registerVMInitializedObserver(new Observer() {
+-        public void update(Observable o, Object data) {
+-          initialize(VM.getVM().getTypeDataBase());
+-        }
+-      });
+-  }
+-
+-  private static void initialize(TypeDataBase db) {
+-    Type type = db.lookupType("RicochetBlob");
+-
+-    bounceOffsetField                = type.getCIntegerField("_bounce_offset");
+-    exceptionOffsetField             = type.getCIntegerField("_exception_offset");
+-  }
+-
+-  private static CIntegerField bounceOffsetField;
+-  private static CIntegerField exceptionOffsetField;
+-
+-  public RicochetBlob(Address addr) {
+-    super(addr);
+-  }
+-
+-  public boolean isRicochetBlob() {
+-    return true;
+-  }
+-
+-  public Address bounceAddr() {
+-    return codeBegin().addOffsetTo(bounceOffsetField.getValue(addr));
+-  }
+-
+-  public boolean returnsToBounceAddr(Address pc) {
+-    Address bouncePc = bounceAddr();
+-    return (pc.equals(bouncePc) || pc.addOffsetTo(Frame.pcReturnOffset()).equals(bouncePc));
+-  }
+-
+-}
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java
+--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java
++++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java
+@@ -147,12 +147,6 @@
+     }
+   }
+ 
+-  public boolean isRicochetFrame() {
+-    CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
+-    RicochetBlob rcb = VM.getVM().ricochetBlob();
+-    return (cb == rcb && rcb != null && rcb.returnsToBounceAddr(getPC()));
+-  }
+-
+   public boolean isCompiledFrame() {
+     if (Assert.ASSERTS_ENABLED) {
+       Assert.that(!VM.getVM().isCore(), "noncore builds only");
+@@ -216,8 +210,7 @@
+   public Frame realSender(RegisterMap map) {
+     if (!VM.getVM().isCore()) {
+       Frame result = sender(map);
+-      while (result.isRuntimeFrame() ||
+-             result.isRicochetFrame()) {
++      while (result.isRuntimeFrame()) {
+         result = result.sender(map);
+       }
+       return result;
+@@ -631,9 +624,6 @@
+     if (Assert.ASSERTS_ENABLED) {
+       Assert.that(cb != null, "sanity check");
+     }
+-    if (cb == VM.getVM().ricochetBlob()) {
+-      oopsRicochetDo(oopVisitor, regMap);
+-    }
+     if (cb.getOopMaps() != null) {
+       OopMapSet.oopsDo(this, cb, regMap, oopVisitor, VM.getVM().isDebugging());
+ 
+@@ -650,10 +640,6 @@
+     //    }
+   }
+ 
+-  private void oopsRicochetDo      (AddressVisitor oopVisitor, RegisterMap regMap) {
+-    // XXX Empty for now
+-  }
+-
+   // FIXME: implement the above routines, plus add
+   // oops_interpreted_arguments_do and oops_compiled_arguments_do
+ }
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
++++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+@@ -87,8 +87,6 @@
+   private StubRoutines stubRoutines;
+   private Bytes        bytes;
+ 
+-  private RicochetBlob ricochetBlob;
+-
+   /** Flags indicating whether we are attached to a core, C1, or C2 build */
+   private boolean      usingClientCompiler;
+   private boolean      usingServerCompiler;
+@@ -628,18 +626,6 @@
+     return stubRoutines;
+   }
+ 
+-  public RicochetBlob ricochetBlob() {
+-    if (ricochetBlob == null) {
+-      Type ricochetType  = db.lookupType("SharedRuntime");
+-      AddressField ricochetBlobAddress = ricochetType.getAddressField("_ricochet_blob");
+-      Address addr = ricochetBlobAddress.getValue();
+-      if (addr != null) {
+-        ricochetBlob = new RicochetBlob(addr);
+-      }
+-    }
+-    return ricochetBlob;
+-  }
+-
+   public VMRegImpl getVMRegImplInfo() {
+     if (vmregImpl == null) {
+       vmregImpl = new VMRegImpl();
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
+--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
++++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
+@@ -571,8 +571,6 @@
+     //        registers callee-saved, then we will have to copy over
+     //        the RegisterMap update logic from the Intel code.
+ 
+-    if (isRicochetFrame()) return senderForRicochetFrame(map);
+-
+     // The constructor of the sender must know whether this frame is interpreted so it can set the
+     // sender's _interpreter_sp_adjustment field.
+     if (VM.getVM().getInterpreter().contains(pc)) {
+@@ -945,20 +943,6 @@
+   }
+ 
+ 
+-  private Frame senderForRicochetFrame(SPARCRegisterMap map) {
+-    if (DEBUG) {
+-      System.out.println("senderForRicochetFrame");
+-    }
+-    //RicochetFrame* f = RicochetFrame::from_frame(fr);
+-    // Cf. is_interpreted_frame path of frame::sender
+-    Address youngerSP = getSP();
+-    Address sp        = getSenderSP();
+-    map.makeIntegerRegsUnsaved();
+-    map.shiftWindow(sp, youngerSP);
+-    boolean thisFrameAdjustedStack = true;  // I5_savedSP is live in this RF
+-    return new SPARCFrame(biasSP(sp), biasSP(youngerSP), thisFrameAdjustedStack);
+-  }
+-
+   private Frame senderForEntryFrame(RegisterMap regMap) {
+     SPARCRegisterMap map = (SPARCRegisterMap) regMap;
+ 
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRicochetFrame.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRicochetFrame.java
+deleted file mode 100644
+--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRicochetFrame.java
++++ /dev/null
+@@ -1,77 +0,0 @@
+-/*
+- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- *
+- */
+-
+-package sun.jvm.hotspot.runtime.sparc;
+-
+-import java.util.*;
+-import sun.jvm.hotspot.asm.sparc.SPARCRegister;
+-import sun.jvm.hotspot.asm.sparc.SPARCRegisters;
+-import sun.jvm.hotspot.debugger.*;
+-import sun.jvm.hotspot.runtime.*;
+-import sun.jvm.hotspot.types.*;
+-
+-public class SPARCRicochetFrame {
+-  static {
+-    VM.registerVMInitializedObserver(new Observer() {
+-        public void update(Observable o, Object data) {
+-          initialize(VM.getVM().getTypeDataBase());
+-        }
+-      });
+-  }
+-
+-  private SPARCFrame frame;
+-
+-  private static void initialize(TypeDataBase db) {
+-    // Type type = db.lookupType("MethodHandles::RicochetFrame");
+-
+-  }
+-
+-  static SPARCRicochetFrame fromFrame(SPARCFrame f) {
+-    return new SPARCRicochetFrame(f);
+-  }
+-
+-  private SPARCRicochetFrame(SPARCFrame f) {
+-    frame = f;
+-  }
+-
+-  private Address registerValue(SPARCRegister reg) {
+-    return frame.getSP().addOffsetTo(reg.spOffsetInSavedWindow()).getAddressAt(0);
+-  }
+-
+-  public Address savedArgsBase() {
+-    return registerValue(SPARCRegisters.L4);
+-  }
+-  public Address exactSenderSP() {
+-    return registerValue(SPARCRegisters.I5);
+-  }
+-  public Address senderLink() {
+-    return frame.getSenderSP();
+-  }
+-  public Address senderPC() {
+-    return frame.getSenderPC();
+-  }
+-  public Address extendedSenderSP() {
+-    return savedArgsBase();
+-  }
+-}
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java
+--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java
++++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java
+@@ -269,7 +269,6 @@
+ 
+     if (isEntryFrame())       return senderForEntryFrame(map);
+     if (isInterpretedFrame()) return senderForInterpreterFrame(map);
+-    if (isRicochetFrame())    return senderForRicochetFrame(map);
+ 
+     if(cb == null) {
+       cb = VM.getVM().getCodeCache().findBlob(getPC());
+@@ -288,16 +287,6 @@
+     return new X86Frame(getSenderSP(), getLink(), getSenderPC());
+   }
+ 
+-  private Frame senderForRicochetFrame(X86RegisterMap map) {
+-    if (DEBUG) {
+-      System.out.println("senderForRicochetFrame");
+-    }
+-    X86RicochetFrame f = X86RicochetFrame.fromFrame(this);
+-    if (map.getUpdateMap())
+-      updateMapWithSavedLink(map, f.senderLinkAddress());
+-    return new X86Frame(f.extendedSenderSP(), f.exactSenderSP(), f.senderLink(), f.senderPC());
+-  }
+-
+   private Frame senderForEntryFrame(X86RegisterMap map) {
+     if (DEBUG) {
+       System.out.println("senderForEntryFrame");
+diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RicochetFrame.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RicochetFrame.java
+deleted file mode 100644
+--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RicochetFrame.java
++++ /dev/null
+@@ -1,81 +0,0 @@
+-/*
+- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- *
+- */
+-
+-package sun.jvm.hotspot.runtime.x86;
+-
+-import java.util.*;
+-import sun.jvm.hotspot.debugger.*;
+-import sun.jvm.hotspot.runtime.*;
+-import sun.jvm.hotspot.types.*;
+-
+-public class X86RicochetFrame extends VMObject {
+-  static {
+-    VM.registerVMInitializedObserver(new Observer() {
+-        public void update(Observable o, Object data) {
+-          initialize(VM.getVM().getTypeDataBase());
+-        }
+-      });
+-  }
+-
+-  private static void initialize(TypeDataBase db) {
+-    Type type = db.lookupType("MethodHandles::RicochetFrame");
+-
+-    senderLinkField    = type.getAddressField("_sender_link");
+-    savedArgsBaseField = type.getAddressField("_saved_args_base");
+-    exactSenderSPField = type.getAddressField("_exact_sender_sp");
+-    senderPCField      = type.getAddressField("_sender_pc");
+-  }
+-
+-  private static AddressField senderLinkField;
+-  private static AddressField savedArgsBaseField;
+-  private static AddressField exactSenderSPField;
+-  private static AddressField senderPCField;
+-
+-  static X86RicochetFrame fromFrame(X86Frame f) {
+-    return new X86RicochetFrame(f.getFP().addOffsetTo(- senderLinkField.getOffset()));
+-  }
+-
+-  private X86RicochetFrame(Address addr) {
+-    super(addr);
+-  }
+-
+-  public Address senderLink() {
+-    return senderLinkField.getValue(addr);
+-  }
+-  public Address senderLinkAddress() {
+-    return addr.addOffsetTo(senderLinkField.getOffset());
+-  }
+-  public Address savedArgsBase() {
+-    return savedArgsBaseField.getValue(addr);
+-  }
+-  public Address extendedSenderSP() {
+-    return savedArgsBase();
+-  }
+-  public Address exactSenderSP() {
+-    return exactSenderSPField.getValue(addr);
+-  }
+-  public Address senderPC() {
+-    return senderPCField.getValue(addr);
+-  }
+-}
 diff --git a/src/cpu/sparc/vm/interpreter_sparc.cpp b/src/cpu/sparc/vm/interpreter_sparc.cpp
 --- a/src/cpu/sparc/vm/interpreter_sparc.cpp
 +++ b/src/cpu/sparc/vm/interpreter_sparc.cpp