1 /*
2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // A ConstantPoolCacheEntry describes an individual entry of the constant
26 // pool cache. There's 2 principal kinds of entries: field entries for in-
27 // stance & static field access, and method entries for invokes. Some of
28 // the entry layout is shared and looks as follows:
29 //
30 // bit number |31 0|
31 // bit length |-8--|-8--|---16----|
32 // --------------------------------
33 // _indices [ b2 | b1 | index ]
34 // _f1 [ entry specific ]
35 // _f2 [ entry specific ]
36 // _flags [t|f|vf|v|m|h|unused|field_index] (for field entries)
37 // bit length |4|1|1 |1|1|0|---7--|----16-----]
38 // _flags [t|f|vf|v|m|h|unused|eidx|psze] (for method entries)
39 // bit length |4|1|1 |1|1|1|---7--|-8--|-8--]
40
41 // --------------------------------
42 //
43 // with:
44 // index = original constant pool index
386 void set_is_conc_safe(bool v) { _is_conc_safe = v; }
387
388 // Code generation
389 static ByteSize base_offset() { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
390 static ByteSize entry_offset(int raw_index) {
391 int index = raw_index;
392 if (is_secondary_index(raw_index))
393 index = decode_secondary_index(raw_index);
394 return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index);
395 }
396
397 // RedefineClasses() API support:
398 // If any entry of this constantPoolCache points to any of
399 // old_methods, replace it with the corresponding new_method.
400 // trace_name_printed is set to true if the current call has
401 // printed the klass name so that other routines in the adjust_*
402 // group don't print the klass name.
403 void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
404 int methods_length, bool * trace_name_printed);
405 };
|
1 /*
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OOPS_CPCACHEOOP_HPP
26 #define SHARE_VM_OOPS_CPCACHEOOP_HPP
27
28 #include "interpreter/bytecodes.hpp"
29 #include "memory/allocation.hpp"
30 #include "oops/arrayOop.hpp"
31 #include "utilities/array.hpp"
32
33 // A ConstantPoolCacheEntry describes an individual entry of the constant
34 // pool cache. There's 2 principal kinds of entries: field entries for in-
35 // stance & static field access, and method entries for invokes. Some of
36 // the entry layout is shared and looks as follows:
37 //
38 // bit number |31 0|
39 // bit length |-8--|-8--|---16----|
40 // --------------------------------
41 // _indices [ b2 | b1 | index ]
42 // _f1 [ entry specific ]
43 // _f2 [ entry specific ]
44 // _flags [t|f|vf|v|m|h|unused|field_index] (for field entries)
45 // bit length |4|1|1 |1|1|0|---7--|----16-----]
46 // _flags [t|f|vf|v|m|h|unused|eidx|psze] (for method entries)
47 // bit length |4|1|1 |1|1|1|---7--|-8--|-8--]
48
49 // --------------------------------
50 //
51 // with:
52 // index = original constant pool index
394 void set_is_conc_safe(bool v) { _is_conc_safe = v; }
395
396 // Code generation
397 static ByteSize base_offset() { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); }
398 static ByteSize entry_offset(int raw_index) {
399 int index = raw_index;
400 if (is_secondary_index(raw_index))
401 index = decode_secondary_index(raw_index);
402 return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index);
403 }
404
405 // RedefineClasses() API support:
406 // If any entry of this constantPoolCache points to any of
407 // old_methods, replace it with the corresponding new_method.
408 // trace_name_printed is set to true if the current call has
409 // printed the klass name so that other routines in the adjust_*
410 // group don't print the klass name.
411 void adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
412 int methods_length, bool * trace_name_printed);
413 };
414
415 #endif // SHARE_VM_OOPS_CPCACHEOOP_HPP
|