< prev index next >

src/hotspot/share/code/debugInfo.hpp

Print this page




  25 #ifndef SHARE_CODE_DEBUGINFO_HPP
  26 #define SHARE_CODE_DEBUGINFO_HPP
  27 
  28 #include "code/compressedStream.hpp"
  29 #include "code/location.hpp"
  30 #include "code/nmethod.hpp"
  31 #include "code/oopRecorder.hpp"
  32 #include "runtime/stackValue.hpp"
  33 #include "runtime/thread.hpp"
  34 #include "utilities/growableArray.hpp"
  35 
  36 // Classes used for serializing debugging information.
  37 // These abstractions are introducted to provide symmetric
  38 // read and write operations.
  39 
  40 // ScopeValue        describes the value of a variable/expression in a scope
  41 // - LocationValue   describes a value in a given location (in frame or register)
  42 // - ConstantValue   describes a constant
  43 
  44 class ConstantOopReadValue;

  45 class ObjectValue;
  46 
  47 class ScopeValue: public ResourceObj {
  48  public:
  49   // Testers
  50   virtual bool is_location() const { return false; }
  51   virtual bool is_object() const { return false; }
  52   virtual bool is_auto_box() const { return false; }
  53   virtual bool is_constant_int() const { return false; }
  54   virtual bool is_constant_double() const { return false; }
  55   virtual bool is_constant_long() const { return false; }
  56   virtual bool is_constant_oop() const { return false; }
  57   virtual bool equals(ScopeValue* other) const { return false; }
  58 
  59   ConstantOopReadValue* as_ConstantOopReadValue() {
  60     assert(is_constant_oop(), "must be");
  61     return (ConstantOopReadValue*) this;
  62   }
  63 
  64   ObjectValue* as_ObjectValue() {
  65     assert(is_object(), "must be");
  66     return (ObjectValue*)this;
  67   }
  68 





  69   // Serialization of debugging information
  70   virtual void write_on(DebugInfoWriteStream* stream) = 0;
  71   static ScopeValue* read_from(DebugInfoReadStream* stream);
  72 };
  73 
  74 
  75 // A Location value describes a value in a given location; i.e. the corresponding
  76 // logical entity (e.g., a method temporary) lives in this location.
  77 
  78 class LocationValue: public ScopeValue {
  79  private:
  80   Location  _location;
  81  public:
  82   LocationValue(Location location)           { _location = location; }
  83   bool      is_location() const              { return true; }
  84   Location  location() const                 { return _location; }
  85 
  86   // Serialization of debugging information
  87   LocationValue(DebugInfoReadStream* stream);
  88   void write_on(DebugInfoWriteStream* stream);




  25 #ifndef SHARE_CODE_DEBUGINFO_HPP
  26 #define SHARE_CODE_DEBUGINFO_HPP
  27 
  28 #include "code/compressedStream.hpp"
  29 #include "code/location.hpp"
  30 #include "code/nmethod.hpp"
  31 #include "code/oopRecorder.hpp"
  32 #include "runtime/stackValue.hpp"
  33 #include "runtime/thread.hpp"
  34 #include "utilities/growableArray.hpp"
  35 
  36 // Classes used for serializing debugging information.
  37 // These abstractions are introducted to provide symmetric
  38 // read and write operations.
  39 
  40 // ScopeValue        describes the value of a variable/expression in a scope
  41 // - LocationValue   describes a value in a given location (in frame or register)
  42 // - ConstantValue   describes a constant
  43 
  44 class ConstantOopReadValue;
  45 class LocationValue;
  46 class ObjectValue;
  47 
  48 class ScopeValue: public ResourceObj {
  49  public:
  50   // Testers
  51   virtual bool is_location() const { return false; }
  52   virtual bool is_object() const { return false; }
  53   virtual bool is_auto_box() const { return false; }
  54   virtual bool is_constant_int() const { return false; }
  55   virtual bool is_constant_double() const { return false; }
  56   virtual bool is_constant_long() const { return false; }
  57   virtual bool is_constant_oop() const { return false; }
  58   virtual bool equals(ScopeValue* other) const { return false; }
  59 
  60   ConstantOopReadValue* as_ConstantOopReadValue() {
  61     assert(is_constant_oop(), "must be");
  62     return (ConstantOopReadValue*) this;
  63   }
  64 
  65   ObjectValue* as_ObjectValue() {
  66     assert(is_object(), "must be");
  67     return (ObjectValue*)this;
  68   }
  69 
  70   LocationValue* as_LocationValue() {
  71     assert(is_location(), "must be");
  72     return (LocationValue*)this;
  73   }
  74 
  75   // Serialization of debugging information
  76   virtual void write_on(DebugInfoWriteStream* stream) = 0;
  77   static ScopeValue* read_from(DebugInfoReadStream* stream);
  78 };
  79 
  80 
  81 // A Location value describes a value in a given location; i.e. the corresponding
  82 // logical entity (e.g., a method temporary) lives in this location.
  83 
  84 class LocationValue: public ScopeValue {
  85  private:
  86   Location  _location;
  87  public:
  88   LocationValue(Location location)           { _location = location; }
  89   bool      is_location() const              { return true; }
  90   Location  location() const                 { return _location; }
  91 
  92   // Serialization of debugging information
  93   LocationValue(DebugInfoReadStream* stream);
  94   void write_on(DebugInfoWriteStream* stream);


< prev index next >