src/share/vm/code/debugInfo.hpp

changeset 4037
da91efe96a93
parent 2314
f95d63e2154a
child 5307
e0c9a1d29eb4
     1.1 --- a/src/share/vm/code/debugInfo.hpp	Fri Aug 31 16:39:35 2012 -0700
     1.2 +++ b/src/share/vm/code/debugInfo.hpp	Sat Sep 01 13:25:18 2012 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -40,6 +40,8 @@
    1.11  // - LocationValue   describes a value in a given location (in frame or register)
    1.12  // - ConstantValue   describes a constant
    1.13  
    1.14 +class ConstantOopReadValue;
    1.15 +
    1.16  class ScopeValue: public ResourceObj {
    1.17   public:
    1.18    // Testers
    1.19 @@ -51,6 +53,11 @@
    1.20    virtual bool is_constant_oop() const { return false; }
    1.21    virtual bool equals(ScopeValue* other) const { return false; }
    1.22  
    1.23 +  ConstantOopReadValue* as_ConstantOopReadValue() {
    1.24 +    assert(is_constant_oop(), "must be");
    1.25 +    return (ConstantOopReadValue*) this;
    1.26 +  }
    1.27 +
    1.28    // Serialization of debugging information
    1.29    virtual void write_on(DebugInfoWriteStream* stream) = 0;
    1.30    static ScopeValue* read_from(DebugInfoReadStream* stream);
    1.31 @@ -94,7 +101,7 @@
    1.32       , _field_values()
    1.33       , _value()
    1.34       , _visited(false) {
    1.35 -    assert(klass->is_constant_oop(), "should be constant klass oop");
    1.36 +    assert(klass->is_constant_oop(), "should be constant java mirror oop");
    1.37    }
    1.38  
    1.39    ObjectValue(int id)
    1.40 @@ -260,7 +267,15 @@
    1.41    } ;
    1.42  
    1.43    oop read_oop() {
    1.44 -    return code()->oop_at(read_int());
    1.45 +    oop o = code()->oop_at(read_int());
    1.46 +    assert(o == NULL || o->is_oop(), "oop only");
    1.47 +    return o;
    1.48 +  }
    1.49 +  Method* read_method() {
    1.50 +    Method* o = (Method*)(code()->metadata_at(read_int()));
    1.51 +    assert(o == NULL ||
    1.52 +           o->is_metadata(), "meta data only");
    1.53 +    return o;
    1.54    }
    1.55    ScopeValue* read_object_value();
    1.56    ScopeValue* get_cached_object();
    1.57 @@ -279,6 +294,8 @@
    1.58    DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size);
    1.59    void write_handle(jobject h);
    1.60    void write_bci(int bci) { write_int(bci - InvocationEntryBci); }
    1.61 +
    1.62 +  void write_metadata(Metadata* m);
    1.63  };
    1.64  
    1.65  #endif // SHARE_VM_CODE_DEBUGINFO_HPP

mercurial