author | dholmes |
Mon, 07 Oct 2019 18:44:53 -0400 | |
changeset 58488 | 165b193b30dd |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53149
259c36ef27df
8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents:
47816
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3261
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3261
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:
3261
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
53149
diff
changeset
|
25 |
#ifndef SHARE_RUNTIME_STACKVALUE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
53149
diff
changeset
|
26 |
#define SHARE_RUNTIME_STACKVALUE_HPP |
7397 | 27 |
|
28 |
#include "code/location.hpp" |
|
29 |
#include "runtime/handles.hpp" |
|
30 |
||
53149
259c36ef27df
8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents:
47816
diff
changeset
|
31 |
class BasicLock; |
259c36ef27df
8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents:
47816
diff
changeset
|
32 |
class RegisterMap; |
259c36ef27df
8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents:
47816
diff
changeset
|
33 |
class ScopeValue; |
259c36ef27df
8215731: Move forward class definitions out of globalDefinitions.hpp
coleenp
parents:
47816
diff
changeset
|
34 |
|
1 | 35 |
class StackValue : public ResourceObj { |
36 |
private: |
|
37 |
BasicType _type; |
|
47816 | 38 |
intptr_t _integer_value; // Blank java stack slot value |
39 |
Handle _handle_value; // Java stack slot value interpreted as a Handle |
|
1 | 40 |
public: |
41 |
||
42 |
StackValue(intptr_t value) { |
|
47816 | 43 |
_type = T_INT; |
44 |
_integer_value = value; |
|
1 | 45 |
} |
46 |
||
3171
aa289b22b577
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
1
diff
changeset
|
47 |
StackValue(Handle value, intptr_t scalar_replaced = 0) { |
47816 | 48 |
_type = T_OBJECT; |
49 |
_integer_value = scalar_replaced; |
|
50 |
_handle_value = value; |
|
51 |
assert(_integer_value == 0 || _handle_value.is_null(), "not null object should not be marked as scalar replaced"); |
|
1 | 52 |
} |
53 |
||
54 |
StackValue() { |
|
47816 | 55 |
_type = T_CONFLICT; |
56 |
_integer_value = 0; |
|
1 | 57 |
} |
58 |
||
59 |
// Only used during deopt- preserve object type. |
|
60 |
StackValue(intptr_t o, BasicType t) { |
|
61 |
assert(t == T_OBJECT, "should not be used"); |
|
47816 | 62 |
_type = t; |
63 |
_integer_value = o; |
|
1 | 64 |
} |
65 |
||
66 |
Handle get_obj() const { |
|
67 |
assert(type() == T_OBJECT, "type check"); |
|
47816 | 68 |
return _handle_value; |
1 | 69 |
} |
70 |
||
3171
aa289b22b577
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
1
diff
changeset
|
71 |
bool obj_is_scalar_replaced() const { |
aa289b22b577
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
1
diff
changeset
|
72 |
assert(type() == T_OBJECT, "type check"); |
47816 | 73 |
return _integer_value != 0; |
3171
aa289b22b577
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
1
diff
changeset
|
74 |
} |
aa289b22b577
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
1
diff
changeset
|
75 |
|
1 | 76 |
void set_obj(Handle value) { |
77 |
assert(type() == T_OBJECT, "type check"); |
|
47816 | 78 |
_handle_value = value; |
1 | 79 |
} |
80 |
||
81 |
intptr_t get_int() const { |
|
82 |
assert(type() == T_INT, "type check"); |
|
47816 | 83 |
return _integer_value; |
1 | 84 |
} |
85 |
||
86 |
// For special case in deopt. |
|
87 |
intptr_t get_int(BasicType t) const { |
|
88 |
assert(t == T_OBJECT && type() == T_OBJECT, "type check"); |
|
47816 | 89 |
return _integer_value; |
1 | 90 |
} |
91 |
||
92 |
void set_int(intptr_t value) { |
|
93 |
assert(type() == T_INT, "type check"); |
|
47816 | 94 |
_integer_value = value; |
1 | 95 |
} |
96 |
||
97 |
BasicType type() const { return _type; } |
|
98 |
||
99 |
bool equal(StackValue *value) { |
|
100 |
if (_type != value->_type) return false; |
|
101 |
if (_type == T_OBJECT) |
|
47816 | 102 |
return (_handle_value == value->_handle_value); |
1 | 103 |
else { |
104 |
assert(_type == T_INT, "sanity check"); |
|
105 |
// [phh] compare only low addressed portions of intptr_t slots |
|
47816 | 106 |
return (*(int *)&_integer_value == *(int *)&value->_integer_value); |
1 | 107 |
} |
108 |
} |
|
109 |
||
110 |
static StackValue* create_stack_value(const frame* fr, const RegisterMap* reg_map, ScopeValue* sv); |
|
111 |
static BasicLock* resolve_monitor_lock(const frame* fr, Location location); |
|
112 |
||
113 |
#ifndef PRODUCT |
|
114 |
public: |
|
115 |
// Printing |
|
116 |
void print_on(outputStream* st) const; |
|
117 |
#endif |
|
118 |
}; |
|
7397 | 119 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
53149
diff
changeset
|
120 |
#endif // SHARE_RUNTIME_STACKVALUE_HPP |