comparison src/share/vm/code/debugInfo.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents f95d63e2154a
children b6a8f2d23057 e0c9a1d29eb4
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
37 // read and write operations. 37 // read and write operations.
38 38
39 // ScopeValue describes the value of a variable/expression in a scope 39 // ScopeValue describes the value of a variable/expression in a scope
40 // - LocationValue describes a value in a given location (in frame or register) 40 // - LocationValue describes a value in a given location (in frame or register)
41 // - ConstantValue describes a constant 41 // - ConstantValue describes a constant
42
43 class ConstantOopReadValue;
42 44
43 class ScopeValue: public ResourceObj { 45 class ScopeValue: public ResourceObj {
44 public: 46 public:
45 // Testers 47 // Testers
46 virtual bool is_location() const { return false; } 48 virtual bool is_location() const { return false; }
49 virtual bool is_constant_double() const { return false; } 51 virtual bool is_constant_double() const { return false; }
50 virtual bool is_constant_long() const { return false; } 52 virtual bool is_constant_long() const { return false; }
51 virtual bool is_constant_oop() const { return false; } 53 virtual bool is_constant_oop() const { return false; }
52 virtual bool equals(ScopeValue* other) const { return false; } 54 virtual bool equals(ScopeValue* other) const { return false; }
53 55
56 ConstantOopReadValue* as_ConstantOopReadValue() {
57 assert(is_constant_oop(), "must be");
58 return (ConstantOopReadValue*) this;
59 }
60
54 // Serialization of debugging information 61 // Serialization of debugging information
55 virtual void write_on(DebugInfoWriteStream* stream) = 0; 62 virtual void write_on(DebugInfoWriteStream* stream) = 0;
56 static ScopeValue* read_from(DebugInfoReadStream* stream); 63 static ScopeValue* read_from(DebugInfoReadStream* stream);
57 }; 64 };
58 65
92 : _id(id) 99 : _id(id)
93 , _klass(klass) 100 , _klass(klass)
94 , _field_values() 101 , _field_values()
95 , _value() 102 , _value()
96 , _visited(false) { 103 , _visited(false) {
97 assert(klass->is_constant_oop(), "should be constant klass oop"); 104 assert(klass->is_constant_oop(), "should be constant java mirror oop");
98 } 105 }
99 106
100 ObjectValue(int id) 107 ObjectValue(int id)
101 : _id(id) 108 : _id(id)
102 , _klass(NULL) 109 , _klass(NULL)
258 _obj_pool = obj_pool; 265 _obj_pool = obj_pool;
259 266
260 } ; 267 } ;
261 268
262 oop read_oop() { 269 oop read_oop() {
263 return code()->oop_at(read_int()); 270 oop o = code()->oop_at(read_int());
271 assert(o == NULL || o->is_oop(), "oop only");
272 return o;
273 }
274 Method* read_method() {
275 Method* o = (Method*)(code()->metadata_at(read_int()));
276 assert(o == NULL ||
277 o->is_metadata(), "meta data only");
278 return o;
264 } 279 }
265 ScopeValue* read_object_value(); 280 ScopeValue* read_object_value();
266 ScopeValue* get_cached_object(); 281 ScopeValue* get_cached_object();
267 // BCI encoding is mostly unsigned, but -1 is a distinguished value 282 // BCI encoding is mostly unsigned, but -1 is a distinguished value
268 int read_bci() { return read_int() + InvocationEntryBci; } 283 int read_bci() { return read_int() + InvocationEntryBci; }
277 DebugInformationRecorder* recorder() const { return _recorder; } 292 DebugInformationRecorder* recorder() const { return _recorder; }
278 public: 293 public:
279 DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size); 294 DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size);
280 void write_handle(jobject h); 295 void write_handle(jobject h);
281 void write_bci(int bci) { write_int(bci - InvocationEntryBci); } 296 void write_bci(int bci) { write_int(bci - InvocationEntryBci); }
297
298 void write_metadata(Metadata* m);
282 }; 299 };
283 300
284 #endif // SHARE_VM_CODE_DEBUGINFO_HPP 301 #endif // SHARE_VM_CODE_DEBUGINFO_HPP