Java Code Examples for sun.jvm.hotspot.memory.Dictionary

Following code examples demonstrate how to use sun.jvm.hotspot.memory.Dictionaryfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use sun.jvm.hotspot.memory.Dictionaryand various code implementation of this class.

    public void run() {
        SystemDictionary systemDictionary = VM.getVM().getSystemDictionary();
        Dictionary dictionary = systemDictionary.dictionary();

        new SystemDictionaryPrinter(dictionary.getAddress()).print();
    } 


            if (ratingsShouldBeUpdated) {
                String updatedCount = null;

                String matchedCount = (String)moviesToBestRatingsCount.get(movieID);
                if (matchedCount != null) {
                    int currentCount = Integer.parseInt(matchedCount);

                    updatedCount = String.valueOf((currentCount + 1));
                } else {
                    updatedCount = String.valueOf(1);
                }
                moviesToBestRatingsCount.put(movieID, updatedCount);
            } 

  public boolean isShared() {
    VM vm = VM.getVM();
    if (vm.isSharingEnabled()) {
      Dictionary sharedDictionary = vm.getSystemDictionary().sharedDictionary();
      if (sharedDictionary != null) {
        if (sharedDictionary.contains(this, null)) {
          return true;
        }
      }
    }
    return false;
  } 

          if (f instanceof ByteField) {
            ByteField bf = (ByteField)f;
            out.println(bf.getValue(mirror));
          } else if (f instanceof BooleanField) {
            BooleanField bf = (BooleanField)f;
            out.println(bf.getValue(mirror) ? 1 : 0);
          } else if (f instanceof ShortField) {
            ShortField bf = (ShortField)f;
            out.println(bf.getValue(mirror));
          } else if (f instanceof CharField) {
            CharField bf = (CharField)f;
            out.println(bf.getValue(mirror) & 0xffff);
          } else if (f instanceof IntField) {
            IntField bf = (IntField)f;
            out.println(bf.getValue(mirror));
          } else  if (f instanceof LongField) {
            LongField bf = (LongField)f;
            out.println(bf.getValue(mirror));
          } else if (f instanceof FloatField) {
            FloatField bf = (FloatField)f;
            out.println(Float.floatToRawIntBits(bf.getValue(mirror)));
          } else if (f instanceof DoubleField) {
            DoubleField bf = (DoubleField)f;
            out.println(Double.doubleToRawLongBits(bf.getValue(mirror)));
          } else if (f instanceof OopField) {
            OopField bf = (OopField)f;

            Oop value = bf.getValue(mirror);
            if (value == null) {
              out.println("null");
            } else if (value.isInstance()) {
              Instance inst = (Instance)value;
              if (inst.isA(SystemDictionary.getStringKlass())) {
                out.println("\"" + OopUtilities.stringOopToEscapedString(inst) + "\"");
              } else {
                out.println(inst.getKlass().getName().asString());
              }
            } else if (value.isObjArray()) {
              ObjArray oa = (ObjArray)value;
              Klass ek = (ObjArrayKlass)oa.getKlass();
              out.println(oa.getLength() + " " + ek.getName().asString());
            } else if (value.isTypeArray()) {
              TypeArray ta = (TypeArray)value;
              out.println(ta.getLength());
            } else {
              out.println(value);
            }
          } 

Advertisement
Advertisement