author | duke |
Wed, 05 Jul 2017 17:20:17 +0200 | |
changeset 6218 | 5e435a178db7 |
parent 5547 | f4b087cbb361 |
child 6271 | 271ac8e393e4 |
permissions | -rw-r--r-- |
4013 | 1 |
/* |
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5425
diff
changeset
|
2 |
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. |
5418 | 3 |
* Copyright 2007, 2008, 2010 Red Hat, Inc. |
4013 | 4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 |
* |
|
6 |
* This code is free software; you can redistribute it and/or modify it |
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
|
8 |
* published by the Free Software Foundation. |
|
9 |
* |
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
* accompanied this code). |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License version |
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5425
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5425
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5425
diff
changeset
|
22 |
* questions. |
4013 | 23 |
* |
24 |
*/ |
|
25 |
||
5418 | 26 |
private: |
27 |
ZeroFrame* volatile _last_Java_fp; |
|
28 |
||
4013 | 29 |
public: |
30 |
// Each arch must define reset, save, restore |
|
31 |
// These are used by objects that only care about: |
|
32 |
// 1 - initializing a new state (thread creation, javaCalls) |
|
33 |
// 2 - saving a current state (javaCalls) |
|
34 |
// 3 - restoring an old state (javaCalls) |
|
5418 | 35 |
// Note that whenever _last_Java_sp != NULL other anchor fields |
36 |
// must be valid. The profiler apparently depends on this. |
|
4013 | 37 |
|
38 |
void clear() { |
|
39 |
// clearing _last_Java_sp must be first |
|
40 |
_last_Java_sp = NULL; |
|
41 |
// fence? |
|
5418 | 42 |
_last_Java_fp = NULL; |
4013 | 43 |
_last_Java_pc = NULL; |
44 |
} |
|
45 |
||
46 |
void copy(JavaFrameAnchor* src) { |
|
5418 | 47 |
set(src->_last_Java_sp, src->_last_Java_pc, src->_last_Java_fp); |
48 |
} |
|
49 |
||
50 |
void set(intptr_t* sp, address pc, ZeroFrame* fp) { |
|
4013 | 51 |
// In order to make sure the transition state is valid for "this" |
52 |
// We must clear _last_Java_sp before copying the rest of the new |
|
53 |
// data |
|
54 |
// |
|
55 |
// Hack Alert: Temporary bugfix for 4717480/4721647 To act like |
|
56 |
// previous version (pd_cache_state) don't NULL _last_Java_sp |
|
57 |
// unless the value is changing |
|
58 |
// |
|
5418 | 59 |
if (_last_Java_sp != sp) |
4013 | 60 |
_last_Java_sp = NULL; |
61 |
||
5418 | 62 |
_last_Java_fp = fp; |
63 |
_last_Java_pc = pc; |
|
4013 | 64 |
// Must be last so profiler will always see valid frame if |
65 |
// has_last_frame() is true |
|
5418 | 66 |
_last_Java_sp = sp; |
4013 | 67 |
} |
68 |
||
69 |
bool walkable() { |
|
70 |
return true; |
|
71 |
} |
|
72 |
||
73 |
void make_walkable(JavaThread* thread) { |
|
74 |
// nothing to do |
|
75 |
} |
|
76 |
||
77 |
intptr_t* last_Java_sp() const { |
|
78 |
return _last_Java_sp; |
|
79 |
} |
|
80 |
||
5418 | 81 |
ZeroFrame* last_Java_fp() const { |
82 |
return _last_Java_fp; |
|
4013 | 83 |
} |
5425 | 84 |
|
85 |
static ByteSize last_Java_fp_offset() { |
|
86 |
return byte_offset_of(JavaFrameAnchor, _last_Java_fp); |
|
87 |
} |