comparison src/share/vm/code/scopeDesc.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents 5857923e563c da91efe96a93
children b6a8f2d23057
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
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 rethrow_exception, bool return_oop); 68 ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool rethrow_exception, 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 rethrow_exception() const { return _rethrow_exception; } 74 bool rethrow_exception() const { return _rethrow_exception; }
75 bool return_oop() const { return _return_oop; } 75 bool return_oop() const { return _return_oop; }
76 76
93 private: 93 private:
94 // Alternative constructor 94 // Alternative constructor
95 ScopeDesc(const ScopeDesc* parent); 95 ScopeDesc(const ScopeDesc* parent);
96 96
97 // JVM state 97 // JVM state
98 methodHandle _method; 98 Method* _method;
99 int _bci; 99 int _bci;
100 bool _reexecute; 100 bool _reexecute;
101 bool _rethrow_exception; 101 bool _rethrow_exception;
102 bool _return_oop; 102 bool _return_oop;
103 103