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/interpreter/BytecodeStream.java

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

package sun.jvm.hotspot.interpreter;

import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.utilities.*;

public class BytecodeStream {
  private Method _method;

  // reading position
  private int     _bci;       // bci if current bytecode
  private int     _next_bci;  // bci of next bytecode
  private int     _end_bci;   // bci after the current iteration interval

  // last bytecode read
  private int     _code;
  private boolean _is_wide;

  // Construction
  public BytecodeStream(Method method) {
    _method = method;
    setInterval(0, (int) method.getCodeSize());
  }

  // Iteration control
  public void setInterval(int beg_bci, int end_bci) {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(0 <= beg_bci && beg_bci <= _method.getCodeSize(), "illegal beg_bci");
      Assert.that(0 <= end_bci && end_bci <= _method.getCodeSize(), "illegal end_bci");
    }
    // setup of iteration pointers
    _bci      = beg_bci;
    _next_bci = beg_bci;
    _end_bci  = end_bci;
  }

  public void setStart(int beg_bci) {
    setInterval(beg_bci, (int) _method.getCodeSize());
  }

  // Iteration
  public int next() {
    int code;
    // set reading position
    _bci = _next_bci;
    if (isLastBytecode()) {
      // indicate end of bytecode stream
      code = Bytecodes._illegal;
    } else {
      // get bytecode
      int rawCode = Bytecodes.codeAt(_method, _bci);
      code = 0; // Make javac happy
      try {
        code = Bytecodes.javaCode(rawCode);
      } catch (AssertionFailure e) {
        e.printStackTrace();
        Assert.that(false, "Failure occurred at bci " + _bci + " in method " + _method.externalNameAndSignature());
      }

      // set next bytecode position
      //
      int l = Bytecodes.lengthFor(code);
      if (l == 0) l = Bytecodes.lengthAt(_method, _bci);
      _next_bci  += l;
      if (Assert.ASSERTS_ENABLED) {
        Assert.that(_bci < _next_bci, "length must be > 0");
      }
      // set attributes
      _is_wide      = false;
      // check for special (uncommon) cases
      if (code == Bytecodes._wide) {
        code = _method.getBytecodeOrBPAt(_bci + 1);
        _is_wide = true;
      }
      if (Assert.ASSERTS_ENABLED) {
        Assert.that(Bytecodes.isJavaCode(code), "sanity check");
      }
    }
    _code = code;
    return _code;
  }

  // Stream attributes
  public Method  method()             { return _method; }
  public int     bci()                { return _bci; }
  public int     nextBCI()            { return _next_bci; }
  public int     endBCI()             { return _end_bci; }
  public int     code()               { return _code; }
  public boolean isWide()             { return _is_wide; }
  public boolean isActiveBreakpoint() { return Bytecodes.isActiveBreakpointAt(_method, _bci); }
  public boolean isLastBytecode()     { return _next_bci >= _end_bci; }

  // State changes
  public void    setNextBCI(int bci)  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(0 <= bci && bci <= _method.getCodeSize(), "illegal bci");
    }
    _next_bci = bci;
  }

  // Bytecode-specific attributes
  public int     dest()               { return bci() + _method.getBytecodeShortArg(bci() + 1); }
  public int     dest_w()             { return bci() + _method.getBytecodeIntArg(bci()   + 1); }

  // Unsigned indices, widening
  public int     getIndex()           { return (isWide())
                                          ? (_method.getBytecodeShortArg(bci() + 2) & 0xFFFF)
                                          : (_method.getBytecodeOrBPAt(bci() + 1) & 0xFF); }
  public int     getIndexU1()         { return _method.getBytecodeOrBPAt(bci() + 1) & 0xFF; }
  public int     getIndexU2()         { return _method.getBytecodeShortArg(bci() + 1) & 0xFFFF; }
  public int     getIndexU4()         { return _method.getNativeIntArg(bci() + 1); }
  public boolean hasIndexU4()         { return code() == Bytecodes._invokedynamic; }

  public int     getIndexU1Cpcache()         { return _method.getBytecodeOrBPAt(bci() + 1) & 0xFF; }
  public int     getIndexU2Cpcache()         { return _method.getNativeShortArg(bci() + 1) & 0xFFFF; }

  // Fetch at absolute BCI (for manual parsing of certain bytecodes)
  public int     codeAt(int bci) {
    return _method.getBytecodeOrBPAt(bci);
  }
}

sun/jvm/hotspot/interpreter/BytecodeStream.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, 23294👍, 0💬