comparison src/share/vm/code/scopeDesc.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 e522a00b91aa 933c8a58c9dc
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.
25 #ifndef SHARE_VM_CODE_SCOPEDESC_HPP 25 #ifndef SHARE_VM_CODE_SCOPEDESC_HPP
26 #define SHARE_VM_CODE_SCOPEDESC_HPP 26 #define SHARE_VM_CODE_SCOPEDESC_HPP
27 27
28 #include "code/debugInfo.hpp" 28 #include "code/debugInfo.hpp"
29 #include "code/pcDesc.hpp" 29 #include "code/pcDesc.hpp"
30 #include "oops/methodOop.hpp" 30 #include "oops/method.hpp"
31 #include "utilities/growableArray.hpp" 31 #include "utilities/growableArray.hpp"
32 32
33 // SimpleScopeDesc is used when all you need to extract from 33 // SimpleScopeDesc is used when all you need to extract from
34 // a given pc,nmethod pair is a methodOop and a bci. This is 34 // a given pc,nmethod pair is a Method* and a bci. This is
35 // quite a bit faster than allocating a full ScopeDesc, but 35 // quite a bit faster than allocating a full ScopeDesc, but
36 // very limited in abilities. 36 // very limited in abilities.
37 37
38 class SimpleScopeDesc : public StackObj { 38 class SimpleScopeDesc : public StackObj {
39 private: 39 private:
40 methodOop _method; 40 Method* _method;
41 int _bci; 41 int _bci;
42 42
43 public: 43 public:
44 SimpleScopeDesc(nmethod* code,address pc) { 44 SimpleScopeDesc(nmethod* code,address pc) {
45 PcDesc* pc_desc = code->pc_desc_at(pc); 45 PcDesc* pc_desc = code->pc_desc_at(pc);
46 assert(pc_desc != NULL, "Must be able to find matching PcDesc"); 46 assert(pc_desc != NULL, "Must be able to find matching PcDesc");
47 DebugInfoReadStream buffer(code, pc_desc->scope_decode_offset()); 47 DebugInfoReadStream buffer(code, pc_desc->scope_decode_offset());
48 int ignore_sender = buffer.read_int(); 48 int ignore_sender = buffer.read_int();
49 _method = methodOop(buffer.read_oop()); 49 _method = buffer.read_method();
50 _bci = buffer.read_bci(); 50 _bci = buffer.read_bci();
51 } 51 }
52 52
53 methodOop method() { return _method; } 53 Method* method() { return _method; }
54 int bci() { return _bci; } 54 int bci() { return _bci; }
55 }; 55 };
56 56
57 // ScopeDescs contain the information that makes source-level debugging of 57 // ScopeDescs contain the information that makes source-level debugging of
58 // nmethods possible; each scopeDesc describes a method activation 58 // nmethods possible; each scopeDesc describes a method activation
66 // "obj_decode_offset" argument. (We don't use a default argument to 66 // "obj_decode_offset" argument. (We don't use a default argument to
67 // avoid a .hpp-.hpp dependency.) 67 // avoid a .hpp-.hpp dependency.)
68 ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop); 68 ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop);
69 69
70 // JVM state 70 // JVM state
71 methodHandle method() const { return _method; } 71 Method* method() const { return _method; }
72 int bci() const { return _bci; } 72 int bci() const { return _bci; }
73 bool should_reexecute() const { return _reexecute; } 73 bool should_reexecute() const { return _reexecute; }
74 bool return_oop() const { return _return_oop; } 74 bool return_oop() const { return _return_oop; }
75 75
76 GrowableArray<ScopeValue*>* locals(); 76 GrowableArray<ScopeValue*>* locals();
92 private: 92 private:
93 // Alternative constructor 93 // Alternative constructor
94 ScopeDesc(const ScopeDesc* parent); 94 ScopeDesc(const ScopeDesc* parent);
95 95
96 // JVM state 96 // JVM state
97 methodHandle _method; 97 Method* _method;
98 int _bci; 98 int _bci;
99 bool _reexecute; 99 bool _reexecute;
100 bool _return_oop; 100 bool _return_oop;
101 101
102 // Decoding offsets 102 // Decoding offsets