Mercurial > hg > truffle
comparison src/cpu/x86/vm/vtableStubs_x86_64.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d7922586cf6 |
children | 8e47bac5643a |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 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. |
71 | 71 |
72 #ifndef PRODUCT | 72 #ifndef PRODUCT |
73 if (DebugVtables) { | 73 if (DebugVtables) { |
74 Label L; | 74 Label L; |
75 // check offset vs vtable length | 75 // check offset vs vtable length |
76 __ cmpl(Address(rax, instanceKlass::vtable_length_offset() * wordSize), | 76 __ cmpl(Address(rax, InstanceKlass::vtable_length_offset() * wordSize), |
77 vtable_index * vtableEntry::size()); | 77 vtable_index * vtableEntry::size()); |
78 __ jcc(Assembler::greater, L); | 78 __ jcc(Assembler::greater, L); |
79 __ movl(rbx, vtable_index); | 79 __ movl(rbx, vtable_index); |
80 __ call_VM(noreg, | 80 __ call_VM(noreg, |
81 CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), j_rarg0, rbx); | 81 CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), j_rarg0, rbx); |
82 __ bind(L); | 82 __ bind(L); |
83 } | 83 } |
84 #endif // PRODUCT | 84 #endif // PRODUCT |
85 | 85 |
86 // load methodOop and target address | 86 // load Method* and target address |
87 const Register method = rbx; | 87 const Register method = rbx; |
88 | 88 |
89 __ lookup_virtual_method(rax, vtable_index, method); | 89 __ lookup_virtual_method(rax, vtable_index, method); |
90 | 90 |
91 if (DebugVtables) { | 91 if (DebugVtables) { |
92 Label L; | 92 Label L; |
93 __ cmpptr(method, (int32_t)NULL_WORD); | 93 __ cmpptr(method, (int32_t)NULL_WORD); |
94 __ jcc(Assembler::equal, L); | 94 __ jcc(Assembler::equal, L); |
95 __ cmpptr(Address(method, methodOopDesc::from_compiled_offset()), (int32_t)NULL_WORD); | 95 __ cmpptr(Address(method, Method::from_compiled_offset()), (int32_t)NULL_WORD); |
96 __ jcc(Assembler::notZero, L); | 96 __ jcc(Assembler::notZero, L); |
97 __ stop("Vtable entry is NULL"); | 97 __ stop("Vtable entry is NULL"); |
98 __ bind(L); | 98 __ bind(L); |
99 } | 99 } |
100 // rax: receiver klass | 100 // rax: receiver klass |
101 // rbx: methodOop | 101 // rbx: Method* |
102 // rcx: receiver | 102 // rcx: receiver |
103 address ame_addr = __ pc(); | 103 address ame_addr = __ pc(); |
104 __ jmp( Address(rbx, methodOopDesc::from_compiled_offset())); | 104 __ jmp( Address(rbx, Method::from_compiled_offset())); |
105 | 105 |
106 __ flush(); | 106 __ flush(); |
107 | 107 |
108 if (PrintMiscellaneous && (WizardMode || Verbose)) { | 108 if (PrintMiscellaneous && (WizardMode || Verbose)) { |
109 tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d", | 109 tty->print_cr("vtable #%d at "PTR_FORMAT"[%d] left over: %d", |
159 // a spurious fault. Ask me how I know... | 159 // a spurious fault. Ask me how I know... |
160 | 160 |
161 const Register method = rbx; | 161 const Register method = rbx; |
162 Label throw_icce; | 162 Label throw_icce; |
163 | 163 |
164 // Get methodOop and entrypoint for compiler | 164 // Get Method* and entrypoint for compiler |
165 __ lookup_interface_method(// inputs: rec. class, interface, itable index | 165 __ lookup_interface_method(// inputs: rec. class, interface, itable index |
166 r10, rax, itable_index, | 166 r10, rax, itable_index, |
167 // outputs: method, scan temp. reg | 167 // outputs: method, scan temp. reg |
168 method, r11, | 168 method, r11, |
169 throw_icce); | 169 throw_icce); |
170 | 170 |
171 // method (rbx): methodOop | 171 // method (rbx): Method* |
172 // j_rarg0: receiver | 172 // j_rarg0: receiver |
173 | 173 |
174 #ifdef ASSERT | 174 #ifdef ASSERT |
175 if (DebugVtables) { | 175 if (DebugVtables) { |
176 Label L2; | 176 Label L2; |
177 __ cmpptr(method, (int32_t)NULL_WORD); | 177 __ cmpptr(method, (int32_t)NULL_WORD); |
178 __ jcc(Assembler::equal, L2); | 178 __ jcc(Assembler::equal, L2); |
179 __ cmpptr(Address(method, methodOopDesc::from_compiled_offset()), (int32_t)NULL_WORD); | 179 __ cmpptr(Address(method, Method::from_compiled_offset()), (int32_t)NULL_WORD); |
180 __ jcc(Assembler::notZero, L2); | 180 __ jcc(Assembler::notZero, L2); |
181 __ stop("compiler entrypoint is null"); | 181 __ stop("compiler entrypoint is null"); |
182 __ bind(L2); | 182 __ bind(L2); |
183 } | 183 } |
184 #endif // ASSERT | 184 #endif // ASSERT |
185 | 185 |
186 // rbx: methodOop | 186 // rbx: Method* |
187 // j_rarg0: receiver | 187 // j_rarg0: receiver |
188 address ame_addr = __ pc(); | 188 address ame_addr = __ pc(); |
189 __ jmp(Address(method, methodOopDesc::from_compiled_offset())); | 189 __ jmp(Address(method, Method::from_compiled_offset())); |
190 | 190 |
191 __ bind(throw_icce); | 191 __ bind(throw_icce); |
192 __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry())); | 192 __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry())); |
193 | 193 |
194 __ flush(); | 194 __ flush(); |