当前位置: 首页>>代码示例>>Java>>正文


Java SystemDictionary类代码示例

本文整理汇总了Java中sun.jvm.hotspot.memory.SystemDictionary的典型用法代码示例。如果您正苦于以下问题:Java SystemDictionary类的具体用法?Java SystemDictionary怎么用?Java SystemDictionary使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SystemDictionary类属于sun.jvm.hotspot.memory包,在下文中一共展示了SystemDictionary类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doit

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        SystemDictionary sysDict = VM.getVM().getSystemDictionary();
        sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
                public void visit(Klass k) {
                    if (k instanceof InstanceKlass && ((InstanceKlass)k).getConstants().getCache() != null) {
                        MethodArray methods = ((InstanceKlass)k).getMethods();
                        for (int i = 0; i < methods.length(); i++) {
                            Method m = methods.at(i);
                            HTMLGenerator gen = new HTMLGenerator(false);
                            out.println(gen.genHTML(m));
                        }
                    }
                }
            }
            );
    }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:21,代码来源:CommandProcessor.java

示例2: writeClassDumpRecords

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
private void writeClassDumpRecords() throws IOException {
  SystemDictionary sysDict = VM.getVM().getSystemDictionary();
  try {
    sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
      public void visit(Klass k) {
        try {
          writeHeapRecordPrologue();
          writeClassDumpRecord(k);
          writeHeapRecordEpilogue();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
    });
  } catch (RuntimeException re) {
    handleRuntimeException(re);
  }
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:19,代码来源:HeapHprofBinWriter.java

示例3: run

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
@Override
public void run() {
    SystemDictionary dictionary = VM.getVM().getSystemDictionary();
    Klass klass = dictionary.find("java/security/PrivateKey", null, null);

    VM.getVM().getObjectHeap().iterateObjectsOfKlass(new DefaultHeapVisitor() {
        @Override
        public boolean doObj(Oop oop) {
            oop.iterate(new KeyPrinter(), false);
            return false;
        }
    }, klass);
}
 
开发者ID:odnoklassniki,项目名称:stack-traces-heap-dumps,代码行数:14,代码来源:KeyScanner.java

示例4: getSystemDictionary

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
private SystemDictionary getSystemDictionary() {
    return vm.saSystemDictionary();
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:ClassLoaderReferenceImpl.java

示例5: saSystemDictionary

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
SystemDictionary saSystemDictionary() {
    return saSystemDictionary;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:4,代码来源:VirtualMachineImpl.java

示例6: retrieveAllClasses

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
private void retrieveAllClasses() {
    final List saKlasses = new ArrayList();
    SystemDictionary.ClassVisitor visitor = new SystemDictionary.ClassVisitor() {
            public void visit(Klass k) {
                for (Klass l = k; l != null; l = l.arrayKlassOrNull()) {
                    // for non-array classes filter out un-prepared classes
                    // refer to 'allClasses' in share/back/VirtualMachineImpl.c
                    if (l instanceof ArrayKlass) {
                       saKlasses.add(l);
                    } else {
                       int status = l.getClassStatus();
                       if ((status & JVMDIClassStatus.PREPARED) != 0) {
                           saKlasses.add(l);
                       }
                    }
                }
            }
    };

    // refer to jvmtiGetLoadedClasses.cpp - getLoadedClasses in VM code.

    // classes from SystemDictionary
    saSystemDictionary.classesDo(visitor);

    // From SystemDictionary we do not get primitive single
    // dimensional array classes. add primitive single dimensional array
    // klasses from Universe.
    saVM.getUniverse().basicTypeClassesDo(visitor);

    // Hold lock during processing to improve performance
    // and to have safe check/set of retrievedAllTypes
    synchronized (this) {
        if (!retrievedAllTypes) {
            // Number of classes
            int count = saKlasses.size();
            for (int ii = 0; ii < count; ii++) {
                Klass kk = (Klass)saKlasses.get(ii);
                ReferenceTypeImpl type = referenceType(kk);
            }
            retrievedAllTypes = true;
        }
    }
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:44,代码来源:VirtualMachineImpl.java

示例7: writeClasses

import sun.jvm.hotspot.memory.SystemDictionary; //导入依赖的package包/类
private void writeClasses() throws IOException {
  final Set klasses = new HashSet();
  // write class list (id, name) association
  SystemDictionary sysDict = VM.getVM().getSystemDictionary();
  try {
    sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
      public void visit(Klass k) {
        try {
          klasses.add(k.getAddress());
          writeClassLoadRecord(k);
        } catch (IOException exp) {
          throw new RuntimeException(exp);
        }
      }
    });
  } catch (RuntimeException re) {
    handleRuntimeException(re);
  }

  final Symbol javaLangClass = symTbl.probe("java/lang/Class");
  System.out.println("Dumping lambda classes");
  objectHeap.iterate(new DefaultHeapVisitor() {
    @Override
    public boolean doObj(Oop oop) {
      if (oop instanceof Instance) {
        Instance instance = (Instance)oop;
        Klass klass = instance.getKlass();
        Symbol name = klass.getName();
        if (name.equals(javaLangClass)) {
          try {
            Klass reflectedKlass = objectHeap.getKlassForClass(instance);
            if (reflectedKlass != null && !klasses.contains(reflectedKlass.getAddress())) {
              klasses.add(reflectedKlass.getAddress());
              writeClassLoadRecord(reflectedKlass);
            }
          } catch (IOException e) {
            throw new RuntimeException(e);
          }
        }
      }
      return false;
    }
  });
  System.out.println("Done dumping lambda classes");
}
 
开发者ID:geoff-addepar,项目名称:heap-dump,代码行数:46,代码来源:HeapHprofBinWriter.java


注:本文中的sun.jvm.hotspot.memory.SystemDictionary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。