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/SignatureIterator.java

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

package sun.jvm.hotspot.runtime;

import sun.jvm.hotspot.oops.*;

/** <P> SignatureIterators iterate over a Java signature (or parts of it).
    (Syntax according to: "The Java Virtual Machine Specification" by
    Tim Lindholm & Frank Yellin; section 4.3 Descriptors; p. 89ff.) </P>

    <P> Example: Iterating over
<PRE>
([Lfoo;D)I
0123456789
</PRE>

    using </P>

<PRE>
iterateParameters() calls: do_array(2, 7); do_double();
iterateReturntype() calls:                              do_int();
iterate()           calls: do_array(2, 7); do_double(); do_int();

is_returnType()        is: false         ; false      ; true
</PRE>
*/

public abstract class SignatureIterator {
  protected Symbol _signature;       // the signature to iterate over
  protected int    _index;           // the current character index (only valid during iteration)
  protected int    _parameter_index; // the current parameter index (0 outside iteration phase)

  protected void expect(char c) {
    if (_signature.getByteAt(_index) != (byte) c) {
      throw new RuntimeException("expecting '" + c + "'");
    }
    _index++;
  }
  protected void skipOptionalSize() {
    byte c = _signature.getByteAt(_index);
    while ('0' <= c && c <= '9') {
      c = _signature.getByteAt(++_index);
    }
  }
  // returns the parameter size in words (0 for void)
  protected int parseType() {
    switch(_signature.getByteAt(_index)) {
    case 'B': doByte  (); _index++; return BasicTypeSize.getTByteSize();
    case 'C': doChar  (); _index++; return BasicTypeSize.getTCharSize();
    case 'D': doDouble(); _index++; return BasicTypeSize.getTDoubleSize();
    case 'F': doFloat (); _index++; return BasicTypeSize.getTFloatSize();
    case 'I': doInt   (); _index++; return BasicTypeSize.getTIntSize();
    case 'J': doLong  (); _index++; return BasicTypeSize.getTLongSize();
    case 'S': doShort (); _index++; return BasicTypeSize.getTShortSize();
    case 'Z': doBool  (); _index++; return BasicTypeSize.getTBooleanSize();
    case 'V':
      {
        if (!isReturnType()) {
          throw new RuntimeException("illegal parameter type V (void)");
        }

        doVoid(); _index++;
        return BasicTypeSize.getTVoidSize();
      }
    case 'L':
      {
        int begin = ++_index;
        while (_signature.getByteAt(_index++) != ';') ;
        doObject(begin, _index);
        return BasicTypeSize.getTObjectSize();
      }
    case '[':
      {
        int begin = ++_index;
        skipOptionalSize();
        while (_signature.getByteAt(_index) == '[') {
          _index++;
          skipOptionalSize();
        }
        if (_signature.getByteAt(_index) == 'L') {
          while (_signature.getByteAt(_index++) != ';') ;
        } else {
          _index++;
        }
        doArray(begin, _index);
        return BasicTypeSize.getTArraySize();
      }
    }
    throw new RuntimeException("Should not reach here: char " + (char)_signature.getByteAt(_index) + " @ " + _index + " in " + _signature.asString());
  }
  protected void checkSignatureEnd() {
    if (_index < _signature.getLength()) {
      System.err.println("too many chars in signature");
      _signature.printValueOn(System.err);
      System.err.println(" @ " + _index);
    }
  }

  public SignatureIterator(Symbol signature) {
    _signature       = signature;
    _parameter_index = 0;
  }

  //
  // Iteration
  //

  // dispatches once for field signatures
  public void dispatchField() {
    // no '(', just one (field) type
    _index = 0;
    _parameter_index = 0;
    parseType();
    checkSignatureEnd();
  }

  // iterates over parameters only
  public void iterateParameters() {
    // Parse parameters
    _index = 0;
    _parameter_index = 0;
    expect('(');
    while (_signature.getByteAt(_index) != ')') {
      _parameter_index += parseType();
    }
    expect(')');
    _parameter_index = 0; // so isReturnType() is false outside iteration
  }

  // iterates over returntype only
  public void iterateReturntype() {
    // Ignore parameters
    _index = 0;
    expect('(');
    while (_signature.getByteAt(_index) != ')') {
      _index++;
    }
    expect(')');
    // Parse return type
    _parameter_index = -1;
    parseType();
    checkSignatureEnd();
    _parameter_index = 0; // so isReturnType() is false outside iteration
  }

  // iterates over whole signature
  public void iterate() {
    // Parse parameters
    _index = 0;
    _parameter_index = 0;
    expect('(');
    while (_signature.getByteAt(_index) != ')') {
      _parameter_index += parseType();
    }
    expect(')');
    // Parse return type
    _parameter_index = -1;
    parseType();
    checkSignatureEnd();
    _parameter_index = 0; // so isReturnType() is false outside iteration
  }

  // Returns the word index of the current parameter; returns a negative value at the return type
  public int  parameterIndex()               { return _parameter_index; }
  public boolean isReturnType()              { return (parameterIndex() < 0); }

  // Basic types
  public abstract void doBool  ();
  public abstract void doChar  ();
  public abstract void doFloat ();
  public abstract void doDouble();
  public abstract void doByte  ();
  public abstract void doShort ();
  public abstract void doInt   ();
  public abstract void doLong  ();
  public abstract void doVoid  ();

  // Object types (begin indexes the first character of the entry, end
  // indexes the first character after the entry)
  public abstract void doObject(int begin, int end);
  public abstract void doArray (int begin, int end);
}

sun/jvm/hotspot/runtime/SignatureIterator.java

 

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, 23119👍, 0💬