Mercurial > hg > truffle
annotate src/share/vm/runtime/objectMonitor.inline.hpp @ 1721:413ad0331a0c
6977924: Changes for 6975078 produce build error with certain gcc versions
Summary: The changes introduced for 6975078 assign badHeapOopVal to the _allocation field in the ResourceObj class. In 32 bit linux builds with certain versions of gcc this assignment will be flagged as an error while compiling allocation.cpp. In 32 bit builds the constant value badHeapOopVal (which is cast to an intptr_t) is negative. The _allocation field is typed as an unsigned intptr_t and gcc catches this as an error.
Reviewed-by: jcoomes, ysr, phh
author | johnc |
---|---|
date | Wed, 18 Aug 2010 10:59:06 -0700 |
parents | c18cbe5936b8 |
children | fa83ab460c54 |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 inline intptr_t ObjectMonitor::is_entered(TRAPS) const { | |
26 if (THREAD == _owner || THREAD->is_lock_owned((address) _owner)) { | |
27 return 1; | |
28 } | |
29 return 0; | |
30 } | |
31 | |
32 inline markOop ObjectMonitor::header() const { | |
33 return _header; | |
34 } | |
35 | |
36 inline void ObjectMonitor::set_header(markOop hdr) { | |
37 _header = hdr; | |
38 } | |
39 | |
40 inline intptr_t ObjectMonitor::count() const { | |
41 return _count; | |
42 } | |
43 | |
44 inline void ObjectMonitor::set_count(intptr_t count) { | |
45 _count= count; | |
46 } | |
47 | |
48 inline intptr_t ObjectMonitor::waiters() const { | |
49 return _waiters; | |
50 } | |
51 | |
52 inline void* ObjectMonitor::owner() const { | |
53 return _owner; | |
54 } | |
55 | |
56 inline void ObjectMonitor::clear() { | |
57 assert(_header, "Fatal logic error in ObjectMonitor header!"); | |
58 assert(_count == 0, "Fatal logic error in ObjectMonitor count!"); | |
59 assert(_waiters == 0, "Fatal logic error in ObjectMonitor waiters!"); | |
60 assert(_recursions == 0, "Fatal logic error in ObjectMonitor recursions!"); | |
61 assert(_object, "Fatal logic error in ObjectMonitor object!"); | |
62 assert(_owner == 0, "Fatal logic error in ObjectMonitor owner!"); | |
63 | |
64 _header = NULL; | |
65 _object = NULL; | |
66 } | |
67 | |
68 | |
69 inline void* ObjectMonitor::object() const { | |
70 return _object; | |
71 } | |
72 | |
73 inline void* ObjectMonitor::object_addr() { | |
74 return (void *)(&_object); | |
75 } | |
76 | |
77 inline void ObjectMonitor::set_object(void* obj) { | |
78 _object = obj; | |
79 } | |
80 | |
81 inline bool ObjectMonitor::check(TRAPS) { | |
82 if (THREAD != _owner) { | |
83 if (THREAD->is_lock_owned((address) _owner)) { | |
84 _owner = THREAD; // regain ownership of inflated monitor | |
85 OwnerIsThread = 1 ; | |
86 assert (_recursions == 0, "invariant") ; | |
87 } else { | |
88 check_slow(THREAD); | |
89 return false; | |
90 } | |
91 } | |
92 return true; | |
93 } | |
94 | |
95 | |
96 // return number of threads contending for this monitor | |
97 inline intptr_t ObjectMonitor::contentions() const { | |
98 return _count; | |
99 } | |
100 | |
101 inline void ObjectMonitor::set_owner(void* owner) { | |
102 _owner = owner; | |
103 _recursions = 0; | |
104 _count = 0; | |
105 } | |
106 | |
107 | |
108 // here are the platform-dependent bodies: | |
109 | |
110 # include "incls/_objectMonitor_pd.inline.hpp.incl" |