src/hotspot/share/code/debugInfo.hpp
author jlaskey
Thu, 14 Nov 2019 12:33:47 -0400
branchjlaskey-prng
changeset 59084 b8fb85ee91e9
parent 55159 a38132298eda
permissions -rw-r--r--
restarting random branch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49449
diff changeset
     2
 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3686
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3686
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3686
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49449
diff changeset
    25
#ifndef SHARE_CODE_DEBUGINFO_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49449
diff changeset
    26
#define SHARE_CODE_DEBUGINFO_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "code/compressedStream.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "code/location.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "code/nmethod.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "code/oopRecorder.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
#include "runtime/stackValue.hpp"
46271
979ebd346ecf 8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents: 38133
diff changeset
    33
#include "runtime/thread.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    34
#include "utilities/growableArray.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// Classes used for serializing debugging information.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// These abstractions are introducted to provide symmetric
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// read and write operations.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// ScopeValue        describes the value of a variable/expression in a scope
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// - LocationValue   describes a value in a given location (in frame or register)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// - ConstantValue   describes a constant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    44
class ConstantOopReadValue;
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 31406
diff changeset
    45
class ObjectValue;
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    46
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
class ScopeValue: public ResourceObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // Testers
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  virtual bool is_location() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  virtual bool is_object() const { return false; }
55159
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
    52
  virtual bool is_auto_box() const { return false; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  virtual bool is_constant_int() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  virtual bool is_constant_double() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  virtual bool is_constant_long() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  virtual bool is_constant_oop() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  virtual bool equals(ScopeValue* other) const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    59
  ConstantOopReadValue* as_ConstantOopReadValue() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    60
    assert(is_constant_oop(), "must be");
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    61
    return (ConstantOopReadValue*) this;
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    62
  }
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
    63
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 31406
diff changeset
    64
  ObjectValue* as_ObjectValue() {
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 31406
diff changeset
    65
    assert(is_object(), "must be");
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 31406
diff changeset
    66
    return (ObjectValue*)this;
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 31406
diff changeset
    67
  }
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 31406
diff changeset
    68
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  virtual void write_on(DebugInfoWriteStream* stream) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  static ScopeValue* read_from(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
// A Location value describes a value in a given location; i.e. the corresponding
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
// logical entity (e.g., a method temporary) lives in this location.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
class LocationValue: public ScopeValue {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  Location  _location;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  LocationValue(Location location)           { _location = location; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  bool      is_location() const              { return true; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  Location  location() const                 { return _location; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  LocationValue(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
// An ObjectValue describes an object eliminated by escape analysis.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
class ObjectValue: public ScopeValue {
55159
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
    98
 protected:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  int                        _id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  ScopeValue*                _klass;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  GrowableArray<ScopeValue*> _field_values;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  Handle                     _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  bool                       _visited;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  ObjectValue(int id, ScopeValue* klass)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
     : _id(id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
     , _klass(klass)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
     , _field_values()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
     , _value()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
     , _visited(false) {
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   111
    assert(klass->is_constant_oop(), "should be constant java mirror oop");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  ObjectValue(int id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
     : _id(id)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
     , _klass(NULL)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
     , _field_values()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
     , _value()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
     , _visited(false) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  // Accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  bool                        is_object() const         { return true; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  int                         id() const                { return _id; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  ScopeValue*                 klass() const             { return _klass; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  GrowableArray<ScopeValue*>* field_values()            { return &_field_values; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  ScopeValue*                 field_at(int i) const     { return _field_values.at(i); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  int                         field_size()              { return _field_values.length(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  Handle                      value() const             { return _value; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  bool                        is_visited() const        { return _visited; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
49449
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47216
diff changeset
   131
  void                        set_value(oop value);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  void                        set_visited(bool visited) { _visited = false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  void read_object(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  void print_fields_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
55159
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   143
class AutoBoxObjectValue : public ObjectValue {
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   144
  bool                       _cached;
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   145
public:
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   146
  bool                       is_auto_box() const        { return true; }
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   147
  bool                       is_cached() const          { return _cached; }
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   148
  void                       set_cached(bool cached)    { _cached = cached; }
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   149
  AutoBoxObjectValue(int id, ScopeValue* klass) : ObjectValue(id, klass), _cached(false) { }
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   150
  AutoBoxObjectValue(int id) : ObjectValue(id), _cached(false) { }
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   151
};
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   152
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
// A ConstantIntValue describes a constant int; i.e., the corresponding logical entity
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
// is either a source constant or its computation has been constant-folded.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
class ConstantIntValue: public ScopeValue {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  jint _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  ConstantIntValue(jint value)         { _value = value; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  jint value() const                   { return _value;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  bool is_constant_int() const         { return true;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  bool equals(ScopeValue* other) const { return false;   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  ConstantIntValue(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
class ConstantLongValue: public ScopeValue {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  jlong _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  ConstantLongValue(jlong value)       { _value = value; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  jlong value() const                  { return _value;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  bool is_constant_long() const        { return true;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  bool equals(ScopeValue* other) const { return false;   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  ConstantLongValue(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
class ConstantDoubleValue: public ScopeValue {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  jdouble _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  ConstantDoubleValue(jdouble value)   { _value = value; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  jdouble value() const                { return _value;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  bool is_constant_double() const      { return true;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  bool equals(ScopeValue* other) const { return false;   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  ConstantDoubleValue(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
// A ConstantOopWriteValue is created by the compiler to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
// be written as debugging information.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
class ConstantOopWriteValue: public ScopeValue {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  jobject _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  ConstantOopWriteValue(jobject value) { _value = value; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  jobject value() const                { return _value;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  bool is_constant_oop() const         { return true;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  bool equals(ScopeValue* other) const { return false;   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
// A ConstantOopReadValue is created by the VM when reading
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
// debug information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
class ConstantOopReadValue: public ScopeValue {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  Handle _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  Handle value() const                 { return _value;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  bool is_constant_oop() const         { return true;    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  bool equals(ScopeValue* other) const { return false;   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  ConstantOopReadValue(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
// MonitorValue describes the pair used for monitor_enter and monitor_exit.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
class MonitorValue: public ResourceObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  ScopeValue* _owner;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  Location    _basic_lock;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  bool        _eliminated;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  // Constructor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  MonitorValue(ScopeValue* owner, Location basic_lock, bool eliminated = false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  // Accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  ScopeValue*  owner()      const { return _owner; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  Location     basic_lock() const { return _basic_lock;  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  bool         eliminated() const { return _eliminated; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  // Serialization of debugging information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  MonitorValue(DebugInfoReadStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  void write_on(DebugInfoWriteStream* stream);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  // Printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
  void print_on(outputStream* st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
// DebugInfoReadStream specializes CompressedReadStream for reading
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
// debugging information. Used by ScopeDesc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
class DebugInfoReadStream : public CompressedReadStream {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
 private:
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 33160
diff changeset
   275
  const CompiledMethod* _code;
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 33160
diff changeset
   276
  const CompiledMethod* code() const { return _code; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  GrowableArray<ScopeValue*>* _obj_pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
 public:
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 33160
diff changeset
   279
  DebugInfoReadStream(const CompiledMethod* code, int offset, GrowableArray<ScopeValue*>* obj_pool = NULL) :
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    CompressedReadStream(code->scopes_data_begin(), offset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
    _code = code;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    _obj_pool = obj_pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  } ;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
31406
4121166054b6 8087183: Fix call to inline function is_oop in header debugInfo.hpp.
goetz
parents: 23182
diff changeset
   286
  oop read_oop();
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   287
  Method* read_method() {
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   288
    Method* o = (Method*)(code()->metadata_at(read_int()));
23182
6940057d6552 8035735: Metaspace::contains become extremely slow in some cases
coleenp
parents: 22234
diff changeset
   289
    // is_metadata() is a faster check than is_metaspace_object()
6940057d6552 8035735: Metaspace::contains become extremely slow in some cases
coleenp
parents: 22234
diff changeset
   290
    assert(o == NULL || o->is_metadata(), "meta data only");
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   291
    return o;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  }
55159
a38132298eda 8223320: [AOT] jck test api/javax_script/ScriptEngine/PutGet.html fails when test classes are AOTed
iveresov
parents: 53244
diff changeset
   293
  ScopeValue* read_object_value(bool is_auto_box);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  ScopeValue* get_cached_object();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  // BCI encoding is mostly unsigned, but -1 is a distinguished value
3686
69c1b5228547 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 3600
diff changeset
   296
  int read_bci() { return read_int() + InvocationEntryBci; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
// DebugInfoWriteStream specializes CompressedWriteStream for
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
// writing debugging information. Used by ScopeDescRecorder.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
class DebugInfoWriteStream : public CompressedWriteStream {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  DebugInformationRecorder* _recorder;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  DebugInformationRecorder* recorder() const { return _recorder; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  void write_handle(jobject h);
3686
69c1b5228547 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 3600
diff changeset
   309
  void write_bci(int bci) { write_int(bci - InvocationEntryBci); }
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   310
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 7397
diff changeset
   311
  void write_metadata(Metadata* m);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   313
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49449
diff changeset
   314
#endif // SHARE_CODE_DEBUGINFO_HPP