Mercurial > hg > truffle
annotate src/share/vm/oops/oop.cpp @ 1042:4926bf2d292f
Merge
author | cfang |
---|---|
date | Thu, 29 Oct 2009 08:49:31 -0700 |
parents | c89f86385056 |
children | 4e6abf09f540 |
rev | line source |
---|---|
0 | 1 /* |
665
c89f86385056
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
196
diff
changeset
|
2 * Copyright 1997-2009 Sun Microsystems, Inc. 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 * | |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | |
21 * have any questions. | |
22 * | |
23 */ | |
24 | |
25 # include "incls/_precompiled.incl" | |
26 # include "incls/_oop.cpp.incl" | |
27 | |
28 bool always_do_update_barrier = false; | |
29 | |
30 BarrierSet* oopDesc::_bs = NULL; | |
31 | |
32 #ifdef PRODUCT | |
33 void oopDesc::print_on(outputStream* st) const {} | |
34 void oopDesc::print_value_on(outputStream* st) const {} | |
35 void oopDesc::print_address_on(outputStream* st) const {} | |
36 char* oopDesc::print_value_string() { return NULL; } | |
37 char* oopDesc::print_string() { return NULL; } | |
38 void oopDesc::print() {} | |
39 void oopDesc::print_value() {} | |
40 void oopDesc::print_address() {} | |
41 #else | |
42 void oopDesc::print_on(outputStream* st) const { | |
43 if (this == NULL) { | |
44 st->print_cr("NULL"); | |
45 } else { | |
46 blueprint()->oop_print_on(oop(this), st); | |
47 } | |
48 } | |
49 | |
50 void oopDesc::print_value_on(outputStream* st) const { | |
51 oop obj = oop(this); | |
52 if (this == NULL) { | |
53 st->print("NULL"); | |
54 } else if (java_lang_String::is_instance(obj)) { | |
55 java_lang_String::print(obj, st); | |
56 if (PrintOopAddress) print_address_on(st); | |
57 #ifdef ASSERT | |
58 } else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) { | |
59 st->print("### BAD OOP %p ###", (address)obj); | |
60 #endif | |
61 } else { | |
62 blueprint()->oop_print_value_on(obj, st); | |
63 } | |
64 } | |
65 | |
66 void oopDesc::print_address_on(outputStream* st) const { | |
67 if (PrintOopAddress) { | |
665
c89f86385056
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
196
diff
changeset
|
68 st->print("{"INTPTR_FORMAT"}", this); |
0 | 69 } |
70 } | |
71 | |
72 void oopDesc::print() { print_on(tty); } | |
73 | |
74 void oopDesc::print_value() { print_value_on(tty); } | |
75 | |
76 void oopDesc::print_address() { print_address_on(tty); } | |
77 | |
78 char* oopDesc::print_string() { | |
79 stringStream* st = new stringStream(); | |
80 print_on(st); | |
81 return st->as_string(); | |
82 } | |
83 | |
84 char* oopDesc::print_value_string() { | |
85 stringStream* st = new stringStream(); | |
86 print_value_on(st); | |
87 return st->as_string(); | |
88 } | |
89 | |
90 #endif // PRODUCT | |
91 | |
92 void oopDesc::verify_on(outputStream* st) { | |
93 if (this != NULL) { | |
94 blueprint()->oop_verify_on(this, st); | |
95 } | |
96 } | |
97 | |
98 | |
99 void oopDesc::verify() { | |
100 verify_on(tty); | |
101 } | |
102 | |
103 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
104 // XXX verify_old_oop doesn't do anything (should we remove?) |
0 | 105 void oopDesc::verify_old_oop(oop* p, bool allow_dirty) { |
106 blueprint()->oop_verify_old_oop(this, p, allow_dirty); | |
107 } | |
108 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
109 void oopDesc::verify_old_oop(narrowOop* p, bool allow_dirty) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
110 blueprint()->oop_verify_old_oop(this, p, allow_dirty); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
111 } |
0 | 112 |
113 bool oopDesc::partially_loaded() { | |
114 return blueprint()->oop_partially_loaded(this); | |
115 } | |
116 | |
117 | |
118 void oopDesc::set_partially_loaded() { | |
119 blueprint()->oop_set_partially_loaded(this); | |
120 } | |
121 | |
122 | |
123 intptr_t oopDesc::slow_identity_hash() { | |
124 // slow case; we have to acquire the micro lock in order to locate the header | |
125 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY | |
126 HandleMark hm; | |
127 Handle object((oop)this); | |
128 assert(!is_shared_readonly(), "using identity hash on readonly object?"); | |
129 return ObjectSynchronizer::identity_hash_value_for(object); | |
130 } | |
131 | |
132 VerifyOopClosure VerifyOopClosure::verify_oop; | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
133 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
134 void VerifyOopClosure::do_oop(oop* p) { VerifyOopClosure::do_oop_work(p); } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
135 void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); } |