JDK 11 jdk.hotspot.agent.jmod - Hotspot Agent Module

JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module.

JDK 11 Hotspot Agent module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.hotspot.agent.jmod.

JDK 11 Hotspot Agent module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.

JDK 11 Hotspot Agent module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.hotspot.agent.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

sun/jvm/hotspot/runtime/RegisterMap.java

/*
 * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package sun.jvm.hotspot.runtime;

import java.io.*;
import java.util.*;

import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.interpreter.*;
import sun.jvm.hotspot.code.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;

/** <P> A companion structure used for stack traversal. The
    RegisterMap contains misc. information needed in order to do
    correct stack traversal of stack frames.  Hence, it must always be
    passed in as an argument to Frame.sender(RegisterMap). </P>

    <P> The use of RegisterMaps is slightly different in the
    Serviceability Agent APIs than in the VM itself. In the VM, a
    RegisterMap is created either for a particular thread or cloned
    from another RegisterMap. In these APIs, a JavaThread is the
    top-level factory for RegisterMaps, and RegisterMaps know how to
    copy themselves (through either the clone() or copy()
    methods). </P> */

public abstract class RegisterMap implements Cloneable {
  /** Location of registers */
  protected Address[]  location;
  // FIXME: don't know about LocationValidType
  protected long[]     locationValid;
  /** Should include argument_oop marked locations for compiler */
  protected boolean    includeArgumentOops;
  /** Reference to current thread */
  protected JavaThread thread;
  /** Tells if the register map needs to be updated when traversing the stack */
  protected boolean    updateMap;
  /** Location of a frame where the pc is not at a call (NULL if no frame exists) */
  protected static int regCount;
  protected static int locationValidTypeSize;
  protected static int locationValidSize;

  static {
    VM.registerVMInitializedObserver(new Observer() {
        public void update(Observable o, Object data) {
          initialize(VM.getVM().getTypeDataBase());
        }
      });
  }

  private static void initialize(TypeDataBase db) {
    regCount = db.lookupIntConstant("ConcreteRegisterImpl::number_of_registers").intValue();
    // FIXME: don't know about LocationValidType. The LocationValidType is typedef'ed as julong
    // so used julong to get the size of LocationValidType.
    locationValidTypeSize = (int)db.lookupType("julong").getSize() * 8;
    locationValidSize = (regCount + locationValidTypeSize - 1) / locationValidTypeSize;
  }

  protected RegisterMap(JavaThread thread, boolean updateMap) {
    this.thread    = thread;
    this.updateMap = updateMap;
    location      = new Address[regCount];
    locationValid = new long[locationValidSize];
    clear();
  }

  /** Makes a copy of map into this */
  protected RegisterMap(RegisterMap map) {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(map != null, "RegisterMap must be present");
    }
    this.thread              = map.getThread();
    this.updateMap           = map.getUpdateMap();
    this.includeArgumentOops = map.getIncludeArgumentOops();
    location                 = new Address[map.location.length];
    locationValid            = new long[map.locationValid.length];
    initializeFromPD(map);
    if (updateMap) {
      for (int i = 0; i < locationValidSize; i++) {
        long bits = (!getUpdateMap()) ? 0 : map.locationValid[i];
        locationValid[i] = bits;
        // for whichever bits are set, pull in the corresponding map->_location
        int j = i*locationValidTypeSize;
        while (bits != 0) {
          if ((bits & 1) != 0) {
            if (Assert.ASSERTS_ENABLED) {
              Assert.that(0 <= j && j < regCount, "range check");
            }
            location[j] = map.location[j];
          }
          bits >>>= 1;
          j += 1;
        }
      }
    }
  }

  public abstract Object clone();

  public RegisterMap copy() {
    return (RegisterMap) clone();
  }

  public void clear() {
    setIncludeArgumentOops(true);
    if (!VM.getVM().isCore()) {
      if (updateMap) {
        for (int i = 0; i < locationValid.length; i++) {
          locationValid[i] = 0;
        }
        clearPD();
      } else {
        initializePD();
      }
    }
  }

  public Address getLocation(VMReg reg) {
    int i = reg.getValue();
    int index = i / locationValidTypeSize;
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(0 <= i && i < regCount, "sanity check");
      Assert.that(0 <= index && index < locationValidSize, "sanity check");
    }
    if ((locationValid[index] & (1 << i % locationValidTypeSize)) != 0) {
      return location[i];
    } else {
      return getLocationPD(reg);
    }
  }

  public void setLocation(VMReg reg, Address loc) {
    int i = reg.getValue();
    int index = i / locationValidTypeSize;
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(0 <= i && i < regCount, "sanity check");
      Assert.that(0 <= index && index < locationValidSize, "sanity check");
      Assert.that(updateMap, "updating map that does not need updating");
    }
    location[i]          = loc;
    locationValid[index] |= (1 << (i % locationValidTypeSize));
  }

  public boolean getIncludeArgumentOops() {
    return includeArgumentOops;
  }

  public void setIncludeArgumentOops(boolean f) {
    includeArgumentOops = f;
  }

  public JavaThread getThread() {
    return thread;
  }

  public boolean getUpdateMap() {
    return updateMap;
  }

  public void print() {
    printOn(System.out);
  }

  public void printOn(PrintStream tty) {
    tty.println("Register map");
    for (int i = 0; i < location.length; i++) {
      Address src = getLocation(new VMReg(i));
      if (src != null) {
        tty.print("  " + VMRegImpl.getRegisterName(i) +
                  " [" + src + "] = ");
        if (src.andWithMask(VM.getVM().getAddressSize() - 1) != null) {
          tty.print("<misaligned>");
        } else {
          tty.print(src.getAddressAt(0));
        }
      }
    }
  }

  /** Platform-dependent clear() functionality */
  protected abstract void clearPD();
  /** Platform-dependent initialize() functionality */
  protected abstract void initializePD();
  /** Platform-dependent initializeFrom() functionality */
  protected abstract void initializeFromPD(RegisterMap map);
  /** Platform-dependent getLocation() functionality */
  protected abstract Address getLocationPD(VMReg reg);
}

sun/jvm/hotspot/runtime/RegisterMap.java

 

Or download all of them as a single archive file:

File name: jdk.hotspot.agent-11.0.1-src.zip
File size: 1243786 bytes
Release date: 2018-11-04
Download 

 

JDK 11 jdk.httpserver.jmod - HTTP Server Module

JDK 11 jdk.editpad.jmod - Edit Pad Module

Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-02-29, 133407👍, 0💬